FastClaw Docs
Runtime

Project Runtime

Long-lived dev-server sandboxes for coding agents and live previews.

The project runtime lets FastClaw scaffold a web project from a template, run its dev server in a long-lived sandbox, and return a preview URL while the agent continues editing files.

Two Layers

LayerOwnsLifecycle
ProjectSource tree and chat groupingCreated by the user, persistent
Project RuntimeRunning dev-server container and preview URLBooted on demand, evictable

The runtime is keyed by (user_id, agent_id, project_id). Deleting runtime records removes previews but does not delete project files or chat history.

Live Preview Model

In the Docker backend, the runtime container and the agent's per-turn sandbox bind-mount the same host project directory. When the agent edits files, the dev server sees the edits and HMR updates the preview.

Runtime API

MethodPathPurpose
GET/api/agents/{id}/projects/{pid}/runtimeCurrent runtime state
POST/api/agents/{id}/projects/{pid}/runtime/upProvision and boot
POST/api/agents/{id}/projects/{pid}/runtime/sleepStop container, keep files
POST/api/agents/{id}/projects/{pid}/runtime/wakeReboot sleeping runtime
DELETE/api/agents/{id}/projects/{pid}/runtimeTear down runtime, keep files
GET/api/agents/{id}/projects/{pid}/previewPreview URL and status
GET/api/agents/{id}/projects/{pid}/runtime/logsDev-server logs

Template Env

FASTCLAW_PREVIEW_BASE
FASTCLAW_SHIPANY_TEMPLATE_DIR
FASTCLAW_SHIPANY_SCAFFOLD
FASTCLAW_SHIPANY_DEV
FASTCLAW_VITE_REACT_SCAFFOLD
FASTCLAW_VITE_REACT_DEV

FASTCLAW_PREVIEW_BASE may use {project} as a placeholder, for example:

https://{project}.preview.example.com

Agent Tools

When the runtime is wired, agents can use:

  • start_app_preview
  • app_preview_logs

These tools are only available on agents that have a runtime manager registered.