Skip to main content

Overview

IronClaw’s container orchestration extends the sandbox system to support persistent Docker containers running full agent worker processes. Unlike ephemeral command containers, orchestrated containers maintain state and communicate with the main agent via an internal HTTP API.

Architecture

Job Modes

Worker Mode

Standard IronClaw worker with proxied LLM calls:
Worker Container:
  • Runs ironclaw worker command
  • LLM requests proxied to orchestrator
  • Full tool access (Bash, Read, Write, etc.)
  • Multi-turn agent loop
  • Custom tools via WASM/MCP
Use Cases:
  • Long-running background jobs
  • Isolated project work
  • Multi-step workflows
  • Testing in clean environment

Claude Code Mode

Bridge to the official Claude CLI:
Claude Container:
  • Spawns claude CLI directly
  • Native Claude Code tool use
  • Anthropic API or OAuth authentication
  • Tool allowlist for security
  • Automatic session management
Use Cases:
  • Use Claude’s native computer use
  • Access Claude-specific features
  • Compare IronClaw vs Claude behavior
  • Development and testing

Container Job Manager

Creating Jobs

Stopping Jobs

Stopping a job:
  1. Stops the container (10 second grace period)
  2. Removes the container
  3. Revokes the auth token
  4. Updates job state to Stopped

Listing Jobs

Authentication

Bearer Token System

Each job gets a unique bearer token:
Security Properties:
  • Tokens are never logged or serialized
  • Stored in-memory only (lost on restart)
  • Automatically revoked when job completes
  • Single token per job

Credential Grants

Jobs can be granted access to specific credentials:
Workers request credentials via the orchestrator API:
Response:

Orchestrator API

Endpoints

POST /worker//llm/complete

Proxy LLM completion request:
Response:

GET /worker//job

Get job metadata:
Response:

POST /worker//status

Update worker status:

POST /worker//complete

Mark job complete:

Container Configuration

Worker Container

Environment Variables (injected by orchestrator):

Claude Code Container

Same base image plus:
Environment Variables:

Volume Mounts

Project directories are bind-mounted:
Mount Configuration:

Resource Limits

Claude containers get more memory due to heavier node_modules.

Security

Lifecycle Management

Container States

State Transitions

Cleanup

Automatic cleanup on completion:

Manual Cleanup

Remove completed job from memory:

Configuration

Building Worker Images

Standard Worker

Custom Worker

Add project-specific tools:
Build:
Configure:

Troubleshooting

Container Creation Fails

Solution:

Orchestrator Connection Failed

Solutions:
  1. Check orchestrator is running: lsof -i :50051
  2. Verify firewall allows port 50051
  3. For Linux, ensure 172.17.0.1 is accessible from containers
  4. For macOS/Windows, ensure host.docker.internal resolves

Token Validation Failed

Causes:
  1. Orchestrator restarted (tokens are in-memory only)
  2. Job completed and token was revoked
  3. Token expired or corrupted
Solution: Recreate the job.

Volume Mount Rejected

Cause: Security validation prevents mounting paths outside ~/.ironclaw/projects/. Solution:

Source Code

Key files:
  • src/orchestrator/mod.rs - Module overview
  • src/orchestrator/job_manager.rs - Container lifecycle management
  • src/orchestrator/api.rs - HTTP API implementation
  • src/orchestrator/auth.rs - Token store and credential grants
  • Dockerfile.worker - Worker container definition