Learning resourcesReviewed · Anthropic

Claude Agent SDK Quickstart

The Claude Agent SDK quickstart teaches Python and TypeScript developers to build agents that work on local code, but its example approves file changes automatically. It covers installation, API authentication and a streaming agent loop through a small bug-fixing exercise.

Researched 13 Nov 2026

In short.

This quickstart is a practical guide for Python and TypeScript developers building Claude agents, but the supplied example can edit project files without asking. It introduces package installation, API credentials, streamed messages and tool permissions through two deliberately faulty Python functions. The examples were not executed, and the page does not establish repair reliability, execution cost or production suitability.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete selected page at [https://code.claude.com/docs/en/agent-sdk/quickstart.md], including installation exceptions, authentication routes and restrictions, automatic edit approvals, the bug-fixing example and customization options. Linked pages, the documentation index, SDK package contents and demo repositories are excluded. No examples were executed; repair correctness, permission enforcement, release compatibility, costs and production behavior remain unverified.

The overview

identity

This is the Claude Agent SDK quickstart at [https://code.claude.com/docs/en/agent-sdk/quickstart.md]. It teaches developers to write an agent that reads a local Python file and modifies it to address crashes.

The resource is a tutorial rather than the SDK package itself. It provides parallel examples for claude-agent-sdk in Python and @anthropic-ai/claude-agent-sdk in TypeScript.

assessment

The guide provides enough detail to attempt a first file-editing agent: installation commands, authentication settings, sample input, agent scripts and launch commands. Its strongest teaching point is showing how a short application can delegate tool use and task execution to an agent loop.

The example automatically approves file edits. Its claimed successful repairs are expected tutorial outcomes, not independently observed results, and it supplies neither a corrected reference file nor a test suite.

users

The guide suits developers who can create files, install packages, set environment variables and run Python or TypeScript scripts. Beginners receive concrete commands; experienced developers get an introduction to SDK configuration, message handling and tool approvals.

The central exercise concerns local code maintenance. Documentation, type hints and test-writing are suggested extensions, while broader applications such as research agents are only linked elsewhere.

capabilities

The basic example preapproves Read, Edit and Glob so the agent can inspect files, locate them and make changes. The page also describes read-only analysis with Read, Glob and Grep, optional web search through WebSearch, and terminal commands through Bash.

Customization examples add a system prompt or additional tool approvals. Sessions, hooks, MCP connections and hosting are presented as further topics through links; their implementation details are not included.

Using it

requirements

The listed prerequisites are Node.js 18.14+ or Python 3.10+, plus an Anthropic account. The direct API walkthrough uses ANTHROPIC_API_KEY. The SDK reads the running process's environment and does not automatically load .env files.

Both SDKs normally bundle a native Claude Code executable. Python source-distribution installs can lack it, including the ARM64 Windows example given. TypeScript installations that omit npm optional dependencies also lack it. Python can find a separately installed executable on PATH; TypeScript supports pathToClaudeCodeExecutable.

mechanism

The application passes a task prompt and configuration to query, which returns an asynchronous message stream. The documented loop lets Claude choose tools, observe their results and continue until completion or an error. The SDK manages orchestration, tool execution, context and retries.

The examples print assistant text, tool names and the final result subtype. allowed_tools in Python and allowedTools in TypeScript preapprove named tools; permission_mode or permissionMode set to acceptEdits automatically approves file edits. Detailed permission precedence is deferred to another page.

setup

For Python, the guide offers uv init followed by uv add claude-agent-sdk, or installation with pip inside a virtual environment. For TypeScript, it installs @anthropic-ai/claude-agent-sdk and the tsx development dependency. New TypeScript projects use ES modules; existing CommonJS projects can name the script agent.mts to support top-level await.

After configuring credentials, the reader creates utils.py and an agent script, then launches it with uv run agent.py, python agent.py or npx tsx agent.ts, using agent.mts where applicable. Alternative authentication routes are listed for Amazon Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform and Microsoft Foundry; their full setup instructions are linked elsewhere.

example

The sample utils.py contains calculate_average, which divides by zero for an empty list, and get_user_name, which fails when given None. The agent receives a prompt to find crash-causing bugs and fix them.

The page says the resulting file should handle those inputs defensively and the stream should end with Done: success. It does not show the resulting implementation or define whether invalid inputs should return defaults or raise deliberate exceptions. The example has not been executed here, so its actual changes and correctness are unknown.

Assessment & evidence

limitations

The exercise covers two small crash cases. It does not establish performance on larger repositories, accuracy across bug types, latency, recovery behavior or dependable unattended operation. The basic script does not include test execution; using Bash to write and run tests is a suggested extension.

The page says the agent has access to the working directory and its subdirectories by default. It explains preapprovals but does not fully document filesystem isolation or permission evaluation. Automatically approved edits and a successful result message do not establish that the resulting code meets a project's requirements.

reasoning

The guide is most useful when the immediate goal is learning file-oriented agent automation. Its small input makes proposed changes easy to inspect, while the parallel language examples show the same interaction pattern in Python and TypeScript.

The central tradeoff is convenient automation versus explicit oversight: the sample allows changes without individual approval, but leaves correctness to subsequent inspection. It is a starting point for understanding the SDK, with insufficient evidence to judge production reliability.

alternatives

Within the page, read-only analysis is an alternative to the editing example. Developers can also choose Python or TypeScript, uv or pip for Python installation, and direct API authentication or one of the listed cloud-provider routes.

The page does not compare competing agent frameworks or coding assistants. Relative cost, reliability and implementation effort are therefore not assessed.

evidence

The evidence is the complete quickstart at [https://code.claude.com/docs/en/agent-sdk/quickstart.md]. It contains setup instructions, sample code, expected outcomes, installation exceptions and an authentication restriction.

Linked API references, permission documentation, provider guides and example repositories are outside the available evidence. No execution logs, independently verified repairs, benchmarks or package contents are supplied.

Access & freshness

costs

The page provides no prices, free allowance, token consumption or per-run cost estimate. It also does not identify the model used by the example.

API or cloud credentials are required for the documented authentication routes, but credentials do not establish billing terms. The cost of completing the tutorial or operating a resulting agent is unknown from this evidence.

rights

The selected page does not provide a documentation licence, SDK package licence, redistribution grant or generated-code ownership terms. Those rights are unknown from this evidence.

A separate authentication notice says third-party developers need prior approval to offer claude.ai login or rate limits in their products, including SDK-based agents. It directs integrations to the documented API authentication methods.

freshness

The supplied documentation copy was captured on 13 November 2026 at 01:38:25 UTC. The page itself gives no publication or update date.

The installation commands do not pin an SDK release, and the example does not specify a model or native executable version. Compatibility with a particular installed release and changes after the capture are unknown.

actions

To evaluate the tutorial, use a disposable project directory, choose the Python or TypeScript route, and configure the intended API credentials. Check whether the native executable was installed, especially when using a Python source distribution or omitting npm optional dependencies.

Before relying on a repair, inspect the changed file, define the intended behavior for empty lists and missing users, and verify that behavior with tests. For broader use, consult the linked permission and hosting documentation and obtain applicable pricing and licence terms; those details are not established by this quickstart.

Evidence for this report

selected-page.txtselected · checked 2026-11-13