What is Claude Agent SDK?
Claude Agent SDK is Anthropic’s official CLI tool for Claude that enables:- Interactive AI-assisted coding
- Tool execution (file operations, shell commands)
- Extended thinking for complex reasoning
- Session persistence for long-running tasks
Why Use Moru for Claude Agents?
Running Claude agents in Moru sandboxes provides:Isolation
Each agent runs in a dedicated microVM, preventing one agent’s actions from affecting others.
Security
Sandboxes limit what agents can access, protecting sensitive systems.
Persistence
Pause and resume sandboxes to maintain agent state across sessions.
Scalability
Spin up sandboxes on demand for concurrent agent sessions.
Architecture
Components
| Component | Description |
|---|---|
| Your Application | Backend managing sandbox lifecycle |
| Moru Sandbox | Isolated environment for the agent |
| Claude Agent SDK | Anthropic’s agent framework |
| Claude API | Anthropic’s LLM API |
| Workspace | Persistent filesystem for agent work |
Quick Example
Create a sandbox with Claude Agent SDK and run a task:Key Concepts
Session Management
Claude Agent SDK maintains session state in JSONL files. This enables:- Resuming conversations across sandbox restarts
- Preserving context between interactions
- Auditing agent actions
Workspace Persistence
The agent’s workspace (files, configuration) can be:- Saved before pausing a sandbox
- Restored when resuming
- Synced to external storage
Tool Execution
Claude Agent SDK executes tools within the sandbox:- File operations: Read, write, edit files
- Shell commands: Run any shell command
- Code execution: Run Python, Node.js, etc.
Use Cases
Development Assistants
Build AI coding assistants that can:- Write and edit code
- Run tests
- Debug issues
- Manage git operations
Data Processing
Create agents that:- Transform data files
- Run analysis scripts
- Generate reports
Automation
Automate workflows with agents that:- Execute multi-step tasks
- Handle errors gracefully
- Persist state across runs