If you searched “claude managed agents vs claude code,” you are probably staring at two Anthropic products with overlapping names and trying to figure out if one replaces the other. It doesn’t. Claude Managed Agents is a hosted API for running autonomous agent sessions on Anthropic’s infrastructure. Claude Code is the terminal tool you install locally and drive interactively. They share the same underlying agent loop, but they solve different problems, and mixing them up leads to the wrong architecture decision.
This guide covers what each one actually is, where the confusion comes from, the real cost difference, and — since our readers are mostly Claude Code users configuring CLAUDE.md and rules files — what happens to your existing configuration when you move work from one to the other.
The One-Sentence Version
| What it is | Who runs the infrastructure | |
|---|---|---|
| Claude Code | A terminal-native coding agent you install and run interactively | You (your laptop, your CI runner) |
| Claude Managed Agents | A REST API (/v1/agents, /v1/sessions) that runs agent sessions in Anthropic-hosted containers | Anthropic |
| Claude Agent SDK | A Python/TypeScript library that gives you Claude Code’s tool-execution loop as code | You (your process, your server) |
Managed Agents launched in public beta on April 8, 2026, alongside Claude Cowork reaching general availability. It is not a new CLI, not a new model, and not a Claude Code replacement — it’s a hosting layer for the same kind of agent loop Claude Code and the Agent SDK already run, minus the part where you provision and babysit the infrastructure yourself.
Why People Confuse These Two
The name is the whole problem. “Managed Agents” sounds like it could mean “Claude Code, but Anthropic manages it for you” — which is close to true operationally, but wrong about the interface. You never type into a Managed Agents session the way you type into Claude Code. There is no terminal. There is no interactive back-and-forth where you watch Claude read a file and then approve an edit. You send an HTTP request, a container spins up, the agent runs (for minutes or hours), and it streams events back over server-sent events.
The other source of confusion: both products can execute bash commands, edit files, and use MCP servers. If you only look at what the agent can do, they look identical. The difference is entirely about where it runs and who’s driving.
Claude Code: The Interactive Harness
Claude Code is what you already know if you’re reading The Prompt Shelf. It’s the CLI you install with npm install -g @anthropic-ai/claude-code, run in a project directory, and interact with directly. It reads your CLAUDE.md for project context, respects permission modes, and gives you real-time visibility into every tool call.
Key traits:
- Interface: interactive terminal session (or IDE extension, or headless
-pmode for scripting) - Runs on: your machine or your CI runner
- Config: CLAUDE.md, settings.json, hooks, subagents, skills — all the local project configuration this site documents
- Billing: included in your Claude subscription (Pro/Max) or metered via the standard Claude API
Claude Code is built for a human driving the loop — even in headless/automated mode, a person or a CI job owns the process and its lifecycle.
Claude Managed Agents: The Hosted API
Managed Agents is Anthropic’s REST API for running that same agent loop without owning the infrastructure. According to Anthropic’s documentation, it “provisions a container per session as the agent’s workspace” — the agent loop runs on Anthropic’s orchestration layer, and the container is where the agent’s tools actually execute (bash, file operations, code).
The API enforces a clean separation between two resources:
Agents — persistent, versioned configuration, created via POST /v1/agents:
curl https://api.anthropic.com/v1/agents \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: managed-agents-2026-04-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-opus-4-6-20260601",
"system_prompt": "You are a code review agent for the billing service.",
"tools": [{"type": "bash"}, {"type": "text_editor"}],
"mcp_servers": [{"name": "github", "url": "https://mcp.example.com/github"}]
}'
An agent is a persisted, immutable-per-version config. Every update via POST /v1/agents/{id} creates a new version — you never recreate an agent for a config tweak; you version it and reuse the same id.
Sessions — the ephemeral runtime instance, created via POST /v1/sessions, referencing an agent by {type: "agent", id, version}. A session is where the actual work happens: it streams events, accepts user messages and tool results, and runs in an isolated container until it completes, hits a budget cap, or is stopped.
curl https://api.anthropic.com/v1/sessions \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: managed-agents-2026-04-01" \
-H "content-type: application/json" \
-d '{
"agent": {"type": "agent", "id": "agent_01Xyz", "version": 3},
"input": {"messages": [{"role": "user", "content": "Review PR #482 for SQL injection risks."}]}
}'
You then subscribe to GET /v1/sessions/{id}/events/stream to watch it work. Note: the SSE stream has no replay — if your connection drops, you need reconnection logic with event deduplication, since dropped connections don’t automatically resume where they left off.
Key traits:
- Interface: REST API only — no terminal, no local process
- Runs on: Anthropic-managed containers, one per session
- Config: agent definitions via API (model, system prompt, tools, MCP servers, skills), not CLAUDE.md
- Billing: standard Claude token rates plus $0.08 per session-hour of active container runtime, billed to the millisecond and only while the session status is
running(idle time isn’t charged)
Managed Agents also adds things Claude Code doesn’t have out of the box: vault-managed credentials for tool authentication (OAuth, static bearer tokens, env vars), memory stores that persist state across sessions, webhook notifications, session pinning to specific agent versions for A/B testing and safe rollback, and a coordinator/subagent pattern for multi-agent orchestration at the infrastructure level.
Claude Agent SDK: The Middle Option
There’s a third option that the “vs” framing usually leaves out, and it matters because it’s often the right answer: the Claude Agent SDK. It’s a Python (pip install claude-agent-sdk) or TypeScript (npm install @anthropic-ai/claude-agent-sdk) library that gives you Claude Code’s exact tool-execution loop — Read, Write, Edit, Bash, Glob, Grep, WebSearch — as an importable function you call from your own code.
The Agent SDK runs in your process, on your infrastructure, same as Claude Code. The difference from Claude Code is that there’s no terminal UI — you’re writing a program, not driving a session. The difference from Managed Agents is that you own the deployment: your server, your scaling, your crash recovery, your uptime.
Agent SDK → library, runs in YOUR process, YOU manage infra
Claude Code CLI → interactive terminal, runs in YOUR terminal
Managed Agents → REST API, runs in ANTHROPIC'S containers
A common progression: prototype with the Agent SDK locally, and when you’re ready for production and don’t want to operate the sandboxing and crash-recovery infrastructure yourself, move the same agent logic to Managed Agents.
Head-to-Head Comparison
| Claude Code | Claude Agent SDK | Claude Managed Agents | |
|---|---|---|---|
| Interface | Interactive terminal / headless CLI | Python/TypeScript library | REST API |
| Infrastructure owner | You | You | Anthropic |
| Config format | CLAUDE.md, settings.json, hooks | ClaudeAgentOptions in code | Agent JSON via API (model, system prompt, tools, MCP) |
| File access | Your local filesystem directly | Your local filesystem directly | Isolated container filesystem |
| Session lifetime | As long as your terminal/process lives | As long as your process lives | Hours, persisted server-side |
| Reconnect after disconnect | N/A (local process) | N/A (local process) | Yes, via SSE stream + event IDs |
| Billing | Subscription (Pro/Max) or API tokens | API tokens (separate Agent SDK credit pool since June 15, 2026) | API tokens + $0.08/session-hour |
| Multi-agent orchestration | Subagents (in-session) | agents option (in-process) | Coordinator/subagent pattern (infrastructure-level) |
| Best for | Daily interactive development | Custom apps, CI, self-hosted automation | Long-running production agents you don’t want to operate |
Does CLAUDE.md Work with Managed Agents?
This is the question our readers actually care about, and the honest answer is: not directly. CLAUDE.md is a Claude Code convention — Claude Code’s memory system looks for that file at session start and loads it as context. Managed Agents has no filesystem to look in before a session starts; there’s no local directory for it to discover a CLAUDE.md in.
What carries over is the content, not the mechanism. If you’ve already written a solid CLAUDE.md for a project, you can:
- Paste it into
system_promptwhen creating the agent viaPOST /v1/agents. This is the direct equivalent — your coding standards, boundaries, and commands become the agent’s system prompt instead of a loaded memory file. - Mount it as a session resource if your workflow needs the agent to read the file itself (for example, if a subagent-style step re-reads project conventions mid-session) rather than baking it into the prompt upfront.
- Keep hooks logic conceptually, not literally. Managed Agents supports its own event model, but PreToolUse/PostToolUse-style hook callbacks from Claude Code or the Agent SDK don’t transfer as-is — you’d re-implement equivalent guardrails using the Managed Agents event stream and tool permission config.
If your team has invested in a detailed CLAUDE.md, moving that project’s automation to Managed Agents means a one-time translation step: CLAUDE.md → system prompt. It’s not automatic, and no current Anthropic tooling does this conversion for you.
Pricing, With Real Numbers
Managed Agents billing has two components, and people underestimate the second one:
- Token usage — same rates as the standard Claude API (input, output, cache read, cache write). No discount, no markup.
- Session runtime — $0.08 per session-hour, metered to the millisecond, charged only while a session’s status is
running. A session that’s created but waiting on a webhook or paused for a budget check doesn’t burn runtime charges during the idle window.
Worked example: a coordinator agent orchestrating three subagent sessions, each running for 40 minutes to review a pull request, migrate a config, and update tests, totals 2 hours of session runtime — $0.16 — on top of whatever tokens the three sessions consumed. For an individual developer running occasional one-off tasks, that’s negligible. For a platform running hundreds of overnight agent sessions, session-hours become a real line item worth modeling before you commit to the architecture, separate from your token spend.
There’s no flat monthly fee and no per-agent license — you pay for what runs.
When to Use Each One
Use Claude Code if:
- You’re a developer working interactively in a repo, day to day
- You want to see and approve every tool call as it happens
- Your work fits inside a session you’re actively watching or a CI job with a defined start and end
Use the Claude Agent SDK if:
- You’re building a custom application, CLI, or internal tool with agent capabilities baked in
- You want full control over the deployment and are fine operating your own infrastructure
- You need the agent embedded in an existing process (a Slack bot, a review pipeline, a support tool)
Use Claude Managed Agents if:
- You want long-running, autonomous sessions (hours, not a single terminal command) without operating sandboxes yourself
- You need session persistence, resumability after disconnects, and audit-grade event logs out of the box
- You’re building a product feature where end users trigger agent work and you don’t want to be in the business of container orchestration and crash recovery
Skip all three and use the plain Messages API if: your task doesn’t need tool execution at all — it’s a single prompt-response exchange with no file reads, bash commands, or multi-step tool use. Managed Agents’ whole value proposition is the orchestration framework around tool use; paying for containers you don’t need is wasted cost.
FAQ
Is Claude Code being replaced by Managed Agents? No. They’re complementary. Claude Code remains Anthropic’s interactive, local-first coding tool. Managed Agents is a separate hosted API aimed at production and background automation use cases.
Can I run Claude Code sessions inside Managed Agents?
Not as a literal port. Managed Agents runs its own agent loop configured through the Agents/Sessions API, not the Claude Code CLI itself. You recreate equivalent behavior (system prompt, tools, MCP servers) through the API rather than launching claude inside a container.
What’s the practical difference between Managed Agents and the Agent SDK if both are “the agent loop as an API”? Who owns the infrastructure. The Agent SDK is a library — you write the program and run it on your servers. Managed Agents is a hosted service — Anthropic runs the containers, and you send API requests. If you don’t want to build and maintain sandboxing, retry logic, and scaling for agent sessions, Managed Agents removes that work. If you want full control (or need to run inside an existing process/VPC with no external container dependency), the Agent SDK keeps that control with you.
Does Managed Agents cost more than running Claude Code myself? It depends on what you’re comparing. Claude Code interactive use is covered by a Pro/Max subscription (or metered API tokens if you’re on API billing). Managed Agents always uses metered API tokens plus $0.08/session-hour, because it’s provisioning dedicated infrastructure per session. For a solo developer’s daily coding work, Claude Code (subscription) is cheaper. For unattended, long-running, or multi-agent production workloads, the session-hour cost buys you infrastructure you’d otherwise have to build.
Further Reading
- Claude Agent SDK: Build Custom AI Agents with Python and TypeScript — the self-hosted middle ground between Claude Code and Managed Agents
- Claude Code vs Cursor in 2026 — how Claude Code compares to IDE-native AI tools
- Claude Code Permission Modes: Complete Guide — how tool approval works in interactive Claude Code sessions
- Claude Code Multi-Agent Orchestration Patterns — subagent patterns you can compare against Managed Agents’ coordinator model
- CLAUDE.md Guide — the configuration format referenced in the CLAUDE.md → system prompt section above
Browse our gallery for real-world CLAUDE.md and AGENTS.md examples from production repositories.