Skip to main content

Running Agents

Caged supports any AI coding agent that can work inside a Linux terminal. This guide covers setup for popular agents.

Claude Code

Claude Code is Anthropic’s agentic coding tool.
# Create a sandbox with your repo
caged up --template node-20 --repo https://github.com/user/project

# Connect to the sandbox
caged connect cage-a1b2c3d4

# Inside the sandbox, run Claude Code
claude
# .caged.yaml
template: node-20
resources:
  cpu: 2
  memory: 2048
timeout: 3600
budget: 10.00
secrets:
  - ANTHROPIC_API_KEY
init_script: npm install -g @anthropic-ai/claude-code

Cursor

Use Cursor’s remote SSH feature to connect to a Caged sandbox.
  1. Create a sandbox: caged up --template node-20
  2. Get SSH details: caged ssh-config cage-a1b2c3d4
  3. Add to ~/.ssh/config
  4. In Cursor: Remote SSH → Connect to Host → cage-a1b2c3d4

Aider

Aider works directly in the terminal.
caged connect cage-a1b2c3d4
# Inside sandbox:
pip install aider-chat
aider
template: python-312
resources:
  cpu: 2
  memory: 1024
budget: 5.00
secrets:
  - OPENAI_API_KEY
init_script: pip install aider-chat

Custom MCP Agents

Connect any MCP-compatible agent via WebSocket:
# Get the MCP WebSocket URL
curl https://api.caged.dev/v1/sandboxes/cage-a1b2c3d4/mcp \
  -H "Authorization: Bearer caged_sk_..."
The WebSocket endpoint provides:
  • File read/write tools
  • Terminal execution tools
  • Git operations
  • Environment management

Agent Comparison

AgentInterfaceBest For
Claude CodeTerminalAutonomous coding tasks
CursorIDE (SSH)Interactive development
AiderTerminalGit-integrated pair programming
Custom MCPWebSocketCustom workflows

Monitoring Agent Activity

While an agent is running, you can monitor it from the dashboard or CLI:
# Real-time cost tracking
caged status cage-a1b2c3d4

# Stream agent logs
caged logs cage-a1b2c3d4 -f

# View trust score
caged trust cage-a1b2c3d4
All agent actions (file writes, terminal commands, LLM calls) are recorded and visible in the session replay.