Spawn each Claude agent session as an isolated Docker sibling container instead of a local CLI process. Platform talks to the Docker socket via dockerode to create/manage agent containers alongside itself.
- Spawn agent sessions as Docker sibling containers via dockerode (
268f27f) - Harden Docker agent containers: credential isolation, resource limits (CPU/memory/PIDs), socket control, MCP bridge (
bc7831a) - Add Dockerfiles for platform and agent containers (
cb534e9) - Fix read-only
.claudemount preventing platform startup (efbcadf) - Make projects root path configurable via
PROJECTS_ROOTenv var (d0bf6e1) - Build agent image alongside platform in
docker compose up --build(26c782e) - Fix Docker agent pathing and MCP tool resolution issues (
eb9bf31)
Docker mode is the primary runtime. AGENT_MODE no longer needs to be set — Docker is the default. Set AGENT_MODE=local to use bare-metal mode.
- Change
AGENT_MODEdefault fromlocaltodocker—isDockerMode()now returnsprocess.env.AGENT_MODE !== 'local' - Update
context.tsandindex.tsto use!== 'local'pattern consistently - Remove explicit
AGENT_MODE=dockerfromdocker-compose.yml(now redundant) - Add startup Docker health check — verifies socket, image, and network on boot; exits with clear remediation on failure
- Surface Docker errors in the UI — enhanced error messages for "No such image" and socket failures
- Add
/api/healthendpoint with Docker status:{ ok, mode, docker: { socketConnected, imageAvailable, imageName, networkExists } } - Change default image from
claude-agent-reacttoclaude-agent-base - Move agent Dockerfile to
docker/agent/base/Dockerfile - Set up vitest test infrastructure (config, test script,
__tests__directory) - Add tests for
isDockerMode()andcheckDockerHealth()
Each agent persona can specify which Docker image it runs in. Images are resolved in priority order: explicit param > agent's docker_image > project's agent_image > env default > claude-agent-base.
- Add
docker_imagecolumn to agents table (DB migration inschema.ts) - Add
docker_imagetoAgenttype inshared/types.ts - Update agent CRUD routes —
docker_imagein POST/PUT,GET /imagesendpoint - Update image resolution chain in
spawn.ts— agent > project > env > default - Add
validateImageExists()— checks image before spawning, surfaces clear error if missing - Create per-stack Dockerfiles:
base,node,python,browser,flutter - Update
docker-compose.ymlwith build-only services for each image - Update Agent UI — image dropdown in create/edit form, image badge on agent cards
- Add
create_agent_imageMCP tool — builds custom images from base + packages via Docker API - Add image resolution priority tests
When multiple write sessions target the same project, each gets its own git worktree for isolated file changes. Explore sessions share the main checkout.
- Create
server/src/claude/worktree.ts—needsWorktree,createWorktree,removeWorktree,getSessionWorkPath,cleanupStaleWorktrees - Add
worktree_pathcolumn to sessions table (DB migration inschema.ts) - Add
worktree_pathtoSessiontype inshared/types.ts - Integrate worktree creation at spawn time in
ws/handler.ts— checksneedsWorktree(), creates if needed, stores path - Update
context.tsto useCOALESCE(s.worktree_path, p.path)for effective project path - Update all git routes to accept
?session_id=and use worktree path viagetWorkingDir() - Update
useGithook to accept optionalsessionIdand pass on all API calls - Update
SourceControlcomponent to accept and forwardsessionId - Add worktree cleanup on session DELETE and status →
done - Auto-append
.worktreesto project.gitignore - Skip worktree for explore mode and single-session projects
- Add tests for worktree lifecycle (create, remove, isolation, fallback)
docker-compose.yml— Multi-service stack (platform, agent images, chrome)docker/platform/Dockerfile— Express/WebSocket server containerdocker/agent/base/Dockerfile— Base agent container (Node 22 + git + Claude CLI)docker/agent/{node,python,browser,flutter}/Dockerfile— Specialized agent imagesserver/src/claude/docker-spawn.ts— Container spawn, health check, image validationserver/src/claude/spawn.ts— Agent spawning with Docker/local mode detection and image resolutionserver/src/claude/worktree.ts— Git worktree lifecycle managementserver/src/claude/context.ts— System prompt assembly with worktree-aware pathsserver/src/ws/handler.ts— WebSocket handler with worktree integration at spawn timeserver/src/routes/git.ts— Git operations with session-aware working directoryserver/src/routes/sessions.ts— Session CRUD with worktree cleanupserver/src/mcp/tool-handlers.ts— MCP tools includingcreate_agent_imageclient/src/components/agents/AgentManager.tsx— Agent UI with image selectorclient/src/hooks/useGit.ts— Git hook with session-aware API callsclient/src/components/git/SourceControl.tsx— Source control UI with session support
| Variable | Description | Default |
|---|---|---|
AGENT_MODE |
Set to local to disable Docker agents |
(docker) |
AGENT_DEFAULT_IMAGE |
Docker image for agent containers | claude-agent-base |
AGENT_MEMORY_LIMIT |
Memory limit per agent container | 4 GB |
AGENT_CPU_LIMIT |
CPU limit per agent container | 2 CPUs |
AGENT_PIDS_LIMIT |
PID limit per agent container | 512 |
AGENT_DOCKER_ACCESS |
Set to socket to mount Docker socket into agents |
(none) |
AGENT_RUNTIME |
Set to sysbox-runc for isolated Docker-in-Docker |
(default) |
PROJECTS_ROOT |
Root path for project directories | ~/projects |
(none)