Agent Sandboxesagentsandboxes.org
Head-to-head

Claude code execution tool vs Claude Managed Agents

Answer in brief

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.

By the Agent Sandboxes editors · Updated

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

AttributeClaude code execution toolClaude Managed Agents
What it isServer-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.
TypeCloud or model provider serviceCloud or model provider service
IsolationAnthropic-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 hypervisorCloud 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 sourceNoNo
Self-host / BYOCNo / NoYes / Yes
SDKsPython, JavaScript/TypeScript, Go, Java, C#, PHP, Ruby, REST API, CLIPython, JavaScript/TypeScript, Go, Java, C#, PHP, Ruby, REST API, CLI
Cold start (vendor claim)Not documentedNot documented
Max sessionContainers 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 limitNot documented
PersistenceFiles 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 APIConversation 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 / pauseNot documented / Not documentedNot documented / Not documented
GPUNot documented; each container has 1 CPU, 5 GiB RAM and 5 GiB of workspace storageNot documented; cloud sandboxes run Ubuntu 24.04 on x86_64 with up to 8 GB of memory and up to 10 GB of disk
NetworkingInternet access is completely disabled and no outbound connections are allowed; packages cannot be installed at runtime, only the pre-installed libraries are availableSet 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
PricingBilled 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 tier1,550 free container-hours per organisation per monthNot documented
ComplianceNot 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
RegionsAvailable 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 documentedBeta 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 headquartersSan Francisco, California, United StatesSan Francisco, California, United States
Good fit forData analysis, file generation and multi-step scripting inside a Claude API conversation without running your own sandboxLong-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?
Neither is better for every workload. Claude code execution tool suits data analysis, file generation and multi-step scripting inside a Claude API conversation without running your own sandbox. Claude Managed Agents suits long-running Claude agents that need a managed sandbox with network access and persistent session state, without building an agent loop.
What is the difference between Claude code execution tool and Claude Managed Agents?
Claude Managed Agents documents a self-hosted option; Claude code execution tool does not. Claude Managed Agents documents a bring-your-own-cloud deployment; Claude code execution tool does not.
Which is open source, Claude code execution tool or Claude Managed Agents?
Neither is open source.
How do Claude code execution tool and Claude Managed Agents isolate code?
Claude code execution tool: 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. Claude Managed Agents: 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.
How does Claude code execution tool pricing compare with Claude Managed Agents?
Claude code execution tool: 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). Claude Managed Agents: 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. 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?
Claude Managed Agents can be self-hosted; Claude code execution tool does not document a self-hosted option.
How long can sessions run on Claude code execution tool and Claude Managed Agents?
Claude code execution tool: 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. Claude Managed Agents: Not documented.

Sources

  1. platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool
  2. platform.claude.com/docs/en/managed-agents/overview
  3. platform.claude.com/docs/en/managed-agents/choosing-an-environment
  4. platform.claude.com/docs/en/managed-agents/environments
  5. 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/