Claude code execution tool vs Claude Managed Agents
Choose Claude code execution tool for data analysis, file generation and multi-step scripting inside a Claude API conversation without running your own sandbox; choose Claude Managed Agents for long-running Claude agents that need a managed sandbox with network access and persistent session state, without building an agent loop. Claude code execution tool uses Hosted Linux container isolation; Claude Managed Agents uses Hosted Linux container isolation.
Key differences between Claude code execution tool and Claude Managed Agents
- Self-hosting: Claude Managed Agents documents a self-hosted option; Claude code execution tool does not.
- Your own cloud account: Claude Managed Agents documents a bring-your-own-cloud deployment; Claude code execution tool does not.
What they have in common
- Both are from Anthropic.
- Both are cloud or model provider services.
- Both use container isolation.
- Neither is open source.
- Both list Python, TypeScript, Go, Java, C#, PHP, Ruby, REST API and CLI.
Claude code execution tool vs Claude Managed Agents at a glance
| Attribute | Claude code execution tool | Claude Managed Agents |
|---|---|---|
| What it is | Server-side tool in the Claude API that runs Bash commands, Python and file edits inside an Anthropic-hosted container with no internet access. | Anthropic's hosted agent harness: each session runs Claude in its own Anthropic-managed Linux container, or sends tool calls to a sandbox you run through a worker. |
| Type | Cloud or model provider service | Cloud or model provider service |
| Isolation | Anthropic-hosted Linux container per request ("secure, sandboxed container"); the docs state full isolation from the host and other containers but do not name the container runtime or hypervisor | Cloud environments: an isolated Linux container per session on Anthropic-managed infrastructure (the container runtime is not named). Self-hosted sandboxes: bash and file tool calls run wherever your worker runs them, with isolation set by you |
| Open source | No | No |
| Self-host / BYOC | No / No | Yes / Yes |
| SDKs | Python, JavaScript/TypeScript, Go, Java, C#, PHP, Ruby, REST API, CLI | Python, JavaScript/TypeScript, Go, Java, C#, PHP, Ruby, REST API, CLI |
| Cold start (vendor claim) | Not documented | Not documented |
| Max session | Containers expire 30 days after creation; after about 5 minutes of inactivity a container is checkpointed and restored when its ID is sent again; each tool call has a maximum execution time and each REPL cell in programmatic tool calling has a 90-second wall-clock limit | Not documented |
| Persistence | Files written to the container persist across requests when you pass the container ID back; with code_execution_20260120 or later the Python REPL state (variable bindings) also persists; generated files are returned through the Files API | Conversation history is kept until you delete the session. When a session goes idle the service checkpoints its sandbox, including the filesystem, installed packages and files the agent created; sandbox state is kept for 30 days from sandbox creation, after which a resumed session starts from a fresh sandbox. Memory stores mount at /mnt/memory/ and deliverables go to /mnt/session/outputs |
| Snapshots / pause | Not documented / Not documented | Not documented / Not documented |
| GPU | Not documented; each container has 1 CPU, 5 GiB RAM and 5 GiB of workspace storage | Not documented; cloud sandboxes run Ubuntu 24.04 on x86_64 with up to 8 GB of memory and up to 10 GB of disk |
| Networking | Internet access is completely disabled and no outbound connections are allowed; packages cannot be installed at runtime, only the pre-installed libraries are available | Set per environment: limited allows only hosts in allowed_hosts, plus optional package-manager hosts and the agent's MCP servers; unrestricted allows any host except a general safety blocklist. API create requests that omit the field get unrestricted; the Console form starts at Limited. With self-hosted sandboxes, network policy is yours |
| Pricing | Billed by execution time, separate from tokens: 1,550 free container-hours per organisation per month, then $0.05 per hour per container, with a 5-minute minimum per execution; free of additional charge in requests that also use the web search or web fetch tools (web_search_20260209 / web_fetch_20260209 or later) | Tokens at standard model rates (prompt caching multipliers apply; web search $10 per 1,000 searches) plus $0.08 per session-hour, metered to the millisecond only while the session is running; idle, rescheduling and terminated time is not billed. Session runtime replaces code execution container-hour billing. Self-hosted Managed Agents: pricing through the Anthropic account team |
| Free tier | 1,550 free container-hours per organisation per month | Not documented |
| Compliance | Not eligible for zero data retention (container data retained up to 30 days) | Not eligible for zero data retention (except self-hosted Managed Agents) or HIPAA BAA coverage; sessions are stored server-side until deleted |
| Regions | Available on the Claude API, the Claude Platform on AWS, Claude Models on Google Cloud (Anthropic managed) and Microsoft Foundry (hosted on Anthropic); no region selection documented | Beta on the Claude API, Claude Platform on AWS and Claude Models on Google Cloud (Anthropic managed); no sandbox region selection documented. An agent's model.inference_geo can pin inference to the US at 1.1x token rates |
| Company headquarters | San Francisco, California, United States | San Francisco, California, United States |
| Good fit for | Data analysis, file generation and multi-step scripting inside a Claude API conversation without running your own sandbox | Long-running Claude agents that need a managed sandbox with network access and persistent session state, without building an agent loop |
Verified November 14, 2026 (Claude code execution tool) and November 18, 2026 (Claude Managed Agents) from each provider’s documentation. Cold-start figures are vendor claims, not our measurements.
Which should you choose?
Reasons to choose Claude code execution tool
- You want Claude to analyse uploaded files or produce charts and documents without operating a sandbox yourself
- You need the execution environment to be fully offline for data-handling reasons
- You are already on the Claude API (or its AWS, Google Cloud or Microsoft Foundry distributions) and want a one-line opt-in
- You want REPL state and files to survive across turns by reusing a container ID
Reasons to choose Claude Managed Agents
- You want Anthropic to run the agent loop, context management and sandbox for long-running Claude tasks.
- You need a sandbox with network access and preinstalled toolchains, controlled by a host allowlist.
- You want to keep files and processes on your own infrastructure while Anthropic runs the agent, via self-hosted sandboxes.
- You want runtime billed only while the agent is actively working.
Trade-offs to check first
- Claude code execution tool: No internet access at all, so no package installation, git clones or API calls from inside the container
- Claude code execution tool: Fixed resources: 1 CPU, 5 GiB RAM, 5 GiB disk; GPU and custom images are not documented
- Claude Managed Agents: Beta, and tied to Claude models; it is not a general-purpose sandbox API for your own code.
- Claude Managed Agents: Not eligible for zero data retention (except self-hosted Managed Agents) or HIPAA coverage.
Both are worth piloting with your own image and region. See the full Claude code execution tool profile and Claude Managed Agents profile, or the complete comparison.
More comparisons
Frequently asked questions
Is Claude code execution tool or Claude Managed Agents better for AI agents?
What is the difference between Claude code execution tool and Claude Managed Agents?
Which is open source, Claude code execution tool or Claude Managed Agents?
How do Claude code execution tool and Claude Managed Agents isolate code?
How does Claude code execution tool pricing compare with Claude Managed Agents?
running; idle, rescheduling and terminated time is not billed. Session runtime replaces code execution container-hour billing. Self-hosted Managed Agents: pricing through the Anthropic account team. Rates change, so check the Claude code execution tool and Claude Managed Agents pricing pages before deciding.Can you self-host Claude code execution tool or Claude Managed Agents?
How long can sessions run on Claude code execution tool and Claude Managed Agents?
Sources
- platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool
- platform.claude.com/docs/en/managed-agents/overview
- platform.claude.com/docs/en/managed-agents/choosing-an-environment
- platform.claude.com/docs/en/managed-agents/environments
- platform.claude.com/docs/en/managed-agents/cloud-sandboxes-reference
Check before you rely on it. Products change quickly, and this page reflects public documentation as of November 18, 2026. Confirm anything that matters in the provider’s own documentation.
Cite this page
Agent Sandboxes. (2026). Claude code execution tool vs Claude Managed Agents. agentsandboxes.org. Last reviewed November 18, 2026. https://agentsandboxes.org/compare/anthropic-code-execution-vs-claude-managed-agents/