Follow Discord
Sweep 22 Oct 2026 · 21:04Z Build v2.1.309 528 read Stable v2.1.308 Latest v2.1.309 Next v2.1.309 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · claude-code

Quickstart changedagent-sdk/quickstart

Nearest release: v2.1.291, published under an hour after upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Upstream edited this page at 6 Oct 2026 03:21 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 22 Oct 2026 18:07 UTC.

Upstream edited
Recorded here
Lines+16added
Lines−16removed
From line 87 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits10to this page, all time

The whole hunk

from line 87, old and new numbered
/
lines
from line 87
8787>
8888> Both the TypeScript and Python SDKs bundle a native Claude Code binary, so most installs need no separate Claude Code install. Some installs have no bundled binary:
8989>
90> * If pip installs the Python SDK's source distribution instead of a platform wheel, for example on ARM64 Windows, no binary is bundled. [Install Claude Code natively](/docs/en/setup#install-claude-code). The Python SDK finds it on your `PATH`.
91> * The TypeScript SDK installs its binary through npm optional dependencies, so an install that skips them, for example `npm ci --omit=optional`, gets no binary even on a supported platform. Reinstall without skipping optional dependencies, or [install Claude Code natively](/docs/en/setup#install-claude-code) and set `pathToClaudeCodeExecutable` to its path.
90> * If pip installs the Python SDK's source distribution instead of a platform wheel, for example on ARM64 Windows, no binary is bundled. [Install Claude Code natively](/docs/en/setup.md#install-claude-code). The Python SDK finds it on your `PATH`.
91> * The TypeScript SDK installs its binary through npm optional dependencies, so an install that skips them, for example `npm ci --omit=optional`, gets no binary even on a supported platform. Reinstall without skipping optional dependencies, or [install Claude Code natively](/docs/en/setup.md#install-claude-code) and set `pathToClaudeCodeExecutable` to its path.
9292 
9393**3. Set your API key**
9494 
from line 115
115115* **Google Cloud's Agent Platform**: set `CLAUDE_CODE_USE_VERTEX=1` environment variable and configure Google Cloud credentials
116116* **Microsoft Foundry**: set `CLAUDE_CODE_USE_FOUNDRY=1` environment variable and configure Azure credentials
117117 
118See the setup guides for [Amazon Bedrock](/docs/en/amazon-bedrock), [Claude Platform on AWS](/docs/en/claude-platform-on-aws), [Google Cloud's Agent Platform](/docs/en/google-vertex-ai), or [Microsoft Foundry](/docs/en/microsoft-foundry) for details.
118See the setup guides for [Amazon Bedrock](/docs/en/amazon-bedrock.md), [Claude Platform on AWS](/docs/en/claude-platform-on-aws.md), [Google Cloud's Agent Platform](/docs/en/google-vertex-ai.md), or [Microsoft Foundry](/docs/en/microsoft-foundry.md) for details.
119119 
120120> [!NOTE]
121121>
from line 202
202202 
203203This code has three main parts:
204204 
2051. **`query`**: the main entry point that creates the agentic loop. It returns an async iterator, so you use `async for` to stream messages as Claude works. See the full API in the [Python](/docs/en/agent-sdk/python#query) or [TypeScript](/docs/en/agent-sdk/typescript#query) SDK reference.
2051. **`query`**: the main entry point that creates the agentic loop. It returns an async iterator, so you use `async for` to stream messages as Claude works. See the full API in the [Python](/docs/en/agent-sdk/python.md#query) or [TypeScript](/docs/en/agent-sdk/typescript.md#query) SDK reference.
206206 
2072072. **`prompt`**: what you want Claude to do. Claude figures out which tools to use based on the task.
208208 
2093. **`options`**: configuration for the agent. This example uses `allowedTools` to pre-approve `Read`, `Edit`, and `Glob`, and `permissionMode: "acceptEdits"` to auto-approve file changes. Other options include `systemPrompt`, `mcpServers`, and more. See all options for [Python](/docs/en/agent-sdk/python#claudeagentoptions) or [TypeScript](/docs/en/agent-sdk/typescript#options).
2093. **`options`**: configuration for the agent. This example uses `allowedTools` to pre-approve `Read`, `Edit`, and `Glob`, and `permissionMode: "acceptEdits"` to auto-approve file changes. Other options include `systemPrompt`, `mcpServers`, and more. See all options for [Python](/docs/en/agent-sdk/python.md#claudeagentoptions) or [TypeScript](/docs/en/agent-sdk/typescript.md#options).
210210 
211211The `async for` loop keeps running as Claude thinks, calls tools, observes results, and decides what to do next. Each iteration yields a message: Claude's reasoning, a tool call, a tool result, or the final outcome. The SDK handles the orchestration, tool execution, context management, and retries, so you consume the stream. The loop ends when Claude finishes the task or hits an error.
212212 
from line 214
214214 
215215> [!NOTE]
216216>
217> This example uses streaming to show progress in real-time. If you don't need live output (for example, for background jobs or CI pipelines), you can collect all messages at once. See [Streaming vs. single-turn mode](/docs/en/agent-sdk/streaming-vs-single-mode) for details.
217> This example uses streaming to show progress in real-time. If you don't need live output (for example, for background jobs or CI pipelines), you can collect all messages at once. See [Streaming vs. single-turn mode](/docs/en/agent-sdk/streaming-vs-single-mode.md) for details.
218218 
219219### Run your agent
220220 
from line 254
254254>
255255> If you see an authentication error such as `Not logged in` or `Invalid API key`, make sure you've set the `ANTHROPIC_API_KEY` environment variable in the shell where you run your agent. The SDK doesn't load `.env` files automatically.
256256>
257> For the causes and fixes behind these and other authentication errors, see [Authentication errors](/docs/en/errors#authentication-errors) in the Error reference.
257> For the causes and fixes behind these and other authentication errors, see [Authentication errors](/docs/en/errors.md#authentication-errors) in the Error reference.
258258 
259259### Try other prompts
260260 
from line 324
324324 
325325With `Bash` enabled, try: `"Write unit tests for utils.py, run them, and fix any failures"`
326326 
327Each of these snippets sets fields on the same options object. For more information, see [Configure your agent](/docs/en/agent-sdk/configuration).
327Each of these snippets sets fields on the same options object. For more information, see [Configure your agent](/docs/en/agent-sdk/configuration.md).
328328 
329329## Key concepts
330330 
from line 336
336336| `Read`, `Edit`, `Glob` | Analyze and modify code |
337337| `Read`, `Edit`, `Bash`, `Glob`, `Grep` | Full automation |
338338 
339**Permission modes** control how much human oversight you want. The SDK evaluates the active mode together with your allow and deny rules in a fixed order, described in [How permissions are evaluated](/docs/en/agent-sdk/permissions#how-permissions-are-evaluated). For the full list of modes, their behavior, and when to use each, see [Permission mode in How the agent loop works](/docs/en/agent-sdk/agent-loop#permission-mode).
339**Permission modes** control how much human oversight you want. The SDK evaluates the active mode together with your allow and deny rules in a fixed order, described in [How permissions are evaluated](/docs/en/agent-sdk/permissions.md#how-permissions-are-evaluated). For the full list of modes, their behavior, and when to use each, see [Permission mode in How the agent loop works](/docs/en/agent-sdk/agent-loop.md#permission-mode).
340340 
341341## Next steps
342342 
343343Now that you've created your first agent, learn how to extend its capabilities and tailor it to your use case:
344344 
345* **[Configure your agent](/docs/en/agent-sdk/configuration)**: compose the options object and find the page that covers each setting
346* **[Permissions](/docs/en/agent-sdk/permissions)**: control what your agent can do and when it needs approval
347* **[Hooks](/docs/en/agent-sdk/hooks)**: run custom code before or after tool calls
348* **[Sessions](/docs/en/agent-sdk/sessions)**: build multi-turn agents that maintain context
349* **[MCP servers](/docs/en/agent-sdk/mcp)**: connect to databases, browsers, APIs, and other external systems
350* **[Hosting](/docs/en/agent-sdk/hosting)**: deploy agents to Docker, cloud, and CI/CD
345* **[Configure your agent](/docs/en/agent-sdk/configuration.md)**: compose the options object and find the page that covers each setting
346* **[Permissions](/docs/en/agent-sdk/permissions.md)**: control what your agent can do and when it needs approval
347* **[Hooks](/docs/en/agent-sdk/hooks.md)**: run custom code before or after tool calls
348* **[Sessions](/docs/en/agent-sdk/sessions.md)**: build multi-turn agents that maintain context
349* **[MCP servers](/docs/en/agent-sdk/mcp.md)**: connect to databases, browsers, APIs, and other external systems
350* **[Hosting](/docs/en/agent-sdk/hosting.md)**: deploy agents to Docker, cloud, and CI/CD
351351* **[Example agents](https://github.com/anthropics/claude-agent-sdk-demos)**: see complete examples: email assistant, research agent, and more
352* **[Troubleshooting](/docs/en/agent-sdk/troubleshooting)**: fix errors when the CLI fails to start or exits, or a result arrives without structured output
352* **[Troubleshooting](/docs/en/agent-sdk/troubleshooting.md)**: fix errors when the CLI fails to start or exits, or a result arrives without structured output
353353 
Feedback