Harness profile
Claude Code and the Claude Agent SDK: Anthropic's coding agent, and the same agent as a library
Claude Code is Anthropic's agentic coding tool that reads a codebase, edits files and runs commands from the terminal, IDE, desktop app or browser. The Claude Agent SDK packages the same agent loop and tools as a Python and TypeScript library, for building your own agents on Claude.
Explained from public sources. Mai has not built this yet.
On this page
In plain English
Claude Code is Anthropic’s agent for software work. You describe what you want, and it reads the code, plans an approach, edits files across a project, runs commands and tests, and handles git. You can use it in a terminal, inside VS Code or JetBrains, in a desktop app or in the browser. The Claude Agent SDK takes the same engine and makes it a library, so a developer can build an agent of their own, for code or for other work, with the same tools and safety controls.
How it works
Claude Code installs with a one-line script, Homebrew or WinGet, and runs as claude in a project folder. It needs a Claude subscription or an Anthropic Console account; the terminal and IDE versions can also use third-party providers. Every surface uses the same engine, so a project’s instructions, settings and MCP servers work wherever you open it. It is not open source: its licence reserves all rights to Anthropic, with use subject to Anthropic’s Commercial Terms of Service.
The Agent SDK is installed as @anthropic-ai/claude-agent-sdk for TypeScript or claude-agent-sdk for Python, and bundles a Claude Code binary, so most installs need nothing else. It authenticates with an API key, either from the Anthropic Console or through Amazon Bedrock, Google Cloud or Microsoft Foundry. The Python repository carries an MIT label, but the README and docs say use of the SDK is governed by the Commercial Terms.
Ask: CLI or IDE, Your app via the SDK. Then Agent loop. Then Checks: Hooks, Deny and ask rules, Permission mode, Allow rules. Then Your approval callback. Then Act: Files and shell, Web, MCP servers, Sub-agents.
What the two share, according to the docs:
- Built-in tools to read, write and edit files, run commands and search the web, plus MCP for external systems.
- Sub-agents for focused subtasks, where a lead agent hands out work and merges results.
- Hooks that run your own code at points in the agent’s lifecycle, such as before a tool call.
- Permissions. Each tool call passes, in order, hooks, deny rules, ask rules, the permission mode, allow rules and finally a callback in your code. Modes run from
default, which asks about anything not pre-approved, todontAsk, which turns every would-be prompt into a refusal for headless use, through tobypassPermissions, which the docs say to use only in controlled environments. - Sessions that keep context across turns and can be resumed or forked.
- Memory and skills. A
CLAUDE.mdfile holds project instructions read at the start of every session, Claude Code can save its own learnings as auto memory, and skills package repeatable workflows.
Claude Code adds surfaces of its own: scheduled tasks in the cloud or on the desktop, GitHub Actions and GitLab CI, a Slack integration that turns a bug report into a pull request, and Channels for pushing events from Telegram, Discord or webhooks into a session.
What it does best
For software work it is a complete, polished agent: it plans, edits across many files, runs tests and opens pull requests, with careful permission handling. The SDK’s strength is that you inherit all of that rather than writing your own loop, tools and context management. The permission sequence is documented step by step, and the ability to start strict and loosen mid-session as trust builds suits real deployments. MCP support means the same agent reaches business systems as easily as code.
Where it stops
It is built around Claude models; the documented provider options are different clouds for reaching Claude, not a way to swap in other model families. It is proprietary, governed by commercial terms, and products built on the SDK must keep their own branding and use API keys rather than claude.ai login. The SDK is offered for Python and TypeScript; other languages drive the command line as a subprocess. If you want Anthropic to host the agent loop and sandbox for you, the docs point to a separate product, Managed Agents.
Where it goes wrong
The permissions page is full of warnings worth heeding. Tools that are auto-approved never reach your approval callback, so checks you place there are silently skipped for them. In bypassPermissions mode, an allow list does not restrict anything; only deny rules, ask rules and hooks still bite. A deny rule on a path stops Claude’s own file tools, but a script it runs can still write there unless you use operating-system sandboxing. Sub-agents can inherit broad modes from the main session.
How Mai AI uses it
I would reach for the Agent SDK when a client system needs an agent that works with files, documents and commands, and the client is happy to run on Claude. Starting from a tested loop with strong permissions is better than rebuilding one.
The idea I take from it, whatever the stack, is the fixed order of permission checks ending in a human decision, which is the backbone of human approval gates and agent safety. Its single MCP layer across every surface is a good model for the tool layer and MCP. For how these pieces fit a system built around one business, see how Mai AI designs custom AI operations systems.
Questions and answers
What is the difference between Claude Code and the Claude Agent SDK?
Claude Code is the finished tool you use interactively, in a terminal, IDE, desktop app or browser. The Agent SDK is a Python and TypeScript library that runs the same agent, with the same tools, permissions, sessions and hooks, inside an application you build and operate.
Is Claude Code open source?
No. The licence file in its GitHub repository reserves all rights to Anthropic and says use is subject to Anthropic's Commercial Terms of Service. The Agent SDK is also governed by those terms, including when you use it in products for your own customers.
Do I need a Claude subscription to use the Agent SDK?
No. The SDK uses API key authentication, through an Anthropic Console key or through Amazon Bedrock, Google Cloud or Microsoft Foundry. Anthropic does not allow third-party products built on the SDK to offer claude.ai login unless previously approved.
Does Claude Code support MCP?
Yes. Claude Code and the Agent SDK both connect to external tools and data through the Model Context Protocol, so an agent can reach systems such as Google Drive, Jira or your own services.
Can a Claude Agent SDK agent ask a person before it acts?
Yes. Each tool call passes through hooks, deny rules, ask rules, the permission mode and allow rules, and anything still undecided goes to a callback in your code, where you can ask a person to approve or refuse it.
Patterns it is known for
- PatternThe tool layer and MCP
AI agents reach real systems through tools: named functions such as "find invoice" that the model asks to run, while ordinary code does the actual work. MCP, the Model Context Protocol, is an open standard for offering those tools and data to any AI application in the same way.
- PatternSub-agents and parallel work
Sub-agents are helper agents that a lead agent starts for one well-defined piece of a larger job, each with its own fresh context, instructions and tools. Several can run at once and report back short findings, which makes broad tasks faster, at the price of more model usage.
- PatternHuman approval gates
Human approval gates sort every action an AI agent can take into three levels: draft only, needs a person to approve, or allowed to run automatically. The agent prepares, a person signs off anything that matters, and the system refuses any action that does not match what was approved.
- PatternAgent safety
You make an AI agent safe by limiting what it can do, not by trusting what it says. Give it the narrowest tools and permissions, run risky work in a sandbox, require a person to approve consequential actions, and treat every email, document and web page it reads as possibly hostile.
- PatternAgent memory
AI agents remember in layers: short-term context is what the model can see in the current conversation, and long-term memory is stored outside the model and fetched back in when relevant. Vector stores find memories by meaning, graph stores by how people, records and events connect.
- PatternHeartbeats and schedules
AI agents work without being asked when something other than a person wakes them: a schedule, a regular heartbeat check or an incoming event. Each wake-up gives the agent a fixed job, a time budget and a way to report back, so it can chase, prepare and flag things before anyone thinks to ask.
Related entries
- Harness profileOpenAI Agents SDK
The OpenAI Agents SDK is an open-source library, in Python and TypeScript, for building agents that use tools, hand work to each other and pause for approval. It suits teams that want a light agent loop with tracing built in, rather than a full orchestration platform.
- Harness profileDeepSeek Harness
DeepSeek Harness (dsh) is DeepSeek's open-source agent harness, in public preview, built on the idea that every feature is a plugin. It suits developers who want a self-hosted coding and task agent they can reshape, running DeepSeek models or any provider that speaks a supported API.
Sources
- Claude Code overviewcode.claude.com
- Agent SDK overviewcode.claude.com
- Agent SDK quickstartcode.claude.com
- Agent SDK permissionscode.claude.com
- claude-code on GitHub (README)github.com
- claude-code licence filegithub.com
- claude-agent-sdk-python on GitHubgithub.com