docs/integrations/block-integrations/claude_code.md
The Claude Code block executes complex coding tasks using Anthropic's Claude Code AI assistant in a secure E2B sandbox environment.
This block allows you to delegate coding tasks to Claude Code, which can autonomously create files, install packages, run commands, and build complete applications within a sandboxed environment. Claude Code can handle multi-step development tasks and maintain conversation context across multiple turns.
When activated, the block:
The block supports conversation continuation through three mechanisms:
session_id + sandbox_id): Resume on the same live sandboxconversation_history): Restore context on a new sandbox if the previous one timed outdispose_sandbox flag): Keep sandbox alive for multi-turn conversations| Input | Description |
|---|---|
| E2B Credentials | API key for the E2B platform to create the sandbox. Get one at e2b.dev |
| Anthropic Credentials | API key for Anthropic to power Claude Code. Get one at Anthropic's website |
| Prompt | The task or instruction for Claude Code to execute. Claude Code can create files, install packages, run commands, and perform complex coding tasks |
| Timeout | Sandbox timeout in seconds (default: 300). Set higher for complex tasks. Note: Only applies when creating a new sandbox |
| Setup Commands | Optional shell commands to run before executing Claude Code (e.g., installing dependencies) |
| Working Directory | Working directory for Claude Code to operate in (default: /home/user) |
| Session ID | Session ID to resume a previous conversation. Leave empty for new conversations |
| Sandbox ID | Sandbox ID to reconnect to an existing sandbox. Required when resuming a session |
| Conversation History | Previous conversation history to restore context on a fresh sandbox if the previous one timed out |
| Dispose Sandbox | Whether to dispose of the sandbox after execution (default: true). Set to false to continue conversations later |
| Output | Description |
|---|---|
| Response | The output/response from Claude Code execution |
| Files | List of text files created/modified during execution. Each file includes path, relative_path, name, and content fields |
| Conversation History | Full conversation history including this turn. Use to restore context on a fresh sandbox |
| Session ID | Session ID for this conversation. Pass back with sandbox_id to continue the conversation |
| Sandbox ID | ID of the sandbox instance (null if disposed). Pass back with session_id to continue the conversation |
| Error | Error message if execution failed |
API Documentation to Full Application: A product team wants to quickly prototype applications based on API documentation. They create an agent that:
The team can then iterate on the application by passing the sandbox_id and session_id back to Claude Code with refinement requests like "Add authentication" or "Improve the UI", and Claude Code will modify the existing files in the same sandbox.
Multi-turn Development: A developer uses Claude Code to scaffold a new project:
Each turn builds on the previous work in the same sandbox environment.