Migrate to Claude Agent SDK
Show diff (113 lines)
--- a/migration-guide.md
+++ b/migration-guide.md
@@ -1,16 +1,8 @@
-##
-
-
-
-Overview
+## Overview
The Claude Code SDK has been renamed to the **Claude Agent SDK** and its documentation has been reorganized. This change reflects the SDK’s broader capabilities for building AI agents beyond coding tasks. Migrating from the OpenAI Agents SDK instead? The [OpenAI Agents SDK migration recipe](<https://platform.claude.com/cookbook/claude-agent-sdk-04-migrating-from-openai-agents-sdk>) maps each primitive onto the Claude Agent SDK through a single worked example.
-##
-
-
-
-What’s Changed
+## What’s Changed
Aspect| Old| New
---|---|---
@@ -18,17 +10,9 @@
**Python Package**| `claude-code-sdk`| `claude-agent-sdk`
**Documentation Location**| Claude Code docs| Claude Code docs → dedicated [Agent SDK](</docs/en/agent-sdk/overview>) section
-##
+## Migration Steps
-
-
-Migration Steps
-
-###
-
-
-
-Migrate a TypeScript or JavaScript project
+### Migrate a TypeScript or JavaScript project
**1\. Uninstall the old package:**
@@ -48,11 +32,7 @@
**4\. Update package.json:** If `@anthropic-ai/claude-code` is still listed in your `package.json`, replace it with `@anthropic-ai/claude-agent-sdk` and update the version range as well, for example from `"^0.0.42"` to `"^0.3.0"`. **5\. Reviewbreaking changes** Make any code changes needed to complete the migration.
-###
-
-
-
-Migrate a Python project
+### Migrate a Python project
**1\. Uninstall the old package:**
@@ -72,19 +52,11 @@
**4\. Reviewbreaking changes** Make any code changes needed to complete the migration.
-##
-
-
-
-Breaking changes
+## Breaking changes
To improve isolation and explicit configuration, Claude Agent SDK v0.1.0 introduces breaking changes for users migrating from Claude Code SDK.
-###
-
-
-
-Python: ClaudeCodeOptions renamed to ClaudeAgentOptions
+### Python: ClaudeCodeOptions renamed to ClaudeAgentOptions
**What changed:** The Python SDK type `ClaudeCodeOptions` has been renamed to `ClaudeAgentOptions`. **Migration:**
@@ -98,11 +70,7 @@
options = ClaudeAgentOptions(model="claude-opus-4-7", permission_mode="acceptEdits")
-###
-
-
-
-System prompt no longer default
+### System prompt no longer default
**What changed:** The SDK no longer uses Claude Code’s system prompt by default. **Migration:**
@@ -159,21 +127,13 @@
asyncio.run(main())
-###
-
-
-
-Settings sources default
+### Settings sources default
This default was briefly changed in v0.1.0 to load no filesystem settings and then reverted, so no migration action is needed. **Current behavior:** Omitting `settingSources` on `query()` loads user, project, and local filesystem settings, matching the CLI. This includes `~/.claude/settings.json`, `.claude/settings.json`, `.claude/settings.local.json`, CLAUDE.md files, and custom commands. To run isolated from filesystem settings, pass `settingSources: []`, or `setting_sources=[]` in Python. See [Control filesystem settings with settingSources](</docs/en/agent-sdk/claude-code-features#control-filesystem-settings-with-settingsources>) for what each source loads. Isolation is especially important for CI/CD pipelines, deployed applications, test environments, and multi-tenant systems where local customizations should not leak in.
Python SDK 0.1.59 and earlier treated an empty list the same as omitting the option, so upgrade before relying on `setting_sources=[]`. See [What settingSources does not control](</docs/en/agent-sdk/claude-code-features#what-settingsources-does-not-control>) for inputs that are read even when `settingSources` is `[]`.
-##
-
-
-
-Next Steps
+## Next Steps
* Explore the [Agent SDK Overview](</docs/en/agent-sdk/overview>) to learn about available features
* Check out the [TypeScript SDK Reference](</docs/en/agent-sdk/typescript>) for detailed API documentation
--- a/migration-guide.md
+++ b/migration-guide.md
@@ -28,7 +28,7 @@
-For TypeScript/JavaScript Projects
+Migrate a TypeScript or JavaScript project
**1\. Uninstall the old package:**
@@ -52,7 +52,7 @@
-For Python Projects
+Migrate a Python project
**1\. Uninstall the old package:**
--- a/migration-guide.md
+++ b/migration-guide.md
@@ -4,7 +4,7 @@
Overview
-The Claude Code SDK has been renamed to the **Claude Agent SDK** and its documentation has been reorganized. This change reflects the SDK’s broader capabilities for building AI agents beyond just coding tasks. Migrating from the OpenAI Agents SDK instead? The [OpenAI Agents SDK migration recipe](<https://platform.claude.com/cookbook/claude-agent-sdk-04-migrating-from-openai-agents-sdk>) maps each primitive onto the Claude Agent SDK through a single worked example.
+The Claude Code SDK has been renamed to the **Claude Agent SDK** and its documentation has been reorganized. This change reflects the SDK’s broader capabilities for building AI agents beyond coding tasks. Migrating from the OpenAI Agents SDK instead? The [OpenAI Agents SDK migration recipe](<https://platform.claude.com/cookbook/claude-agent-sdk-04-migrating-from-openai-agents-sdk>) maps each primitive onto the Claude Agent SDK through a single worked example.
##
--- a/migration-guide.md
+++ b/migration-guide.md
@@ -4,7 +4,7 @@
Overview
-The Claude Code SDK has been renamed to the **Claude Agent SDK** and its documentation has been reorganized. This change reflects the SDK’s broader capabilities for building AI agents beyond just coding tasks.
+The Claude Code SDK has been renamed to the **Claude Agent SDK** and its documentation has been reorganized. This change reflects the SDK’s broader capabilities for building AI agents beyond just coding tasks. Migrating from the OpenAI Agents SDK instead? The [OpenAI Agents SDK migration recipe](<https://platform.claude.com/cookbook/claude-agent-sdk-04-migrating-from-openai-agents-sdk>) maps each primitive onto the Claude Agent SDK through a single worked example.
##
--- a/migration-guide.md
+++ b/migration-guide.md
@@ -46,23 +46,7 @@
// After
import { query, tool, createSdkMcpServer } from "@anthropic-ai/claude-agent-sdk";
-**4\. Update package.json dependencies:** If you have the package listed in your `package.json`, update it: Before:
-
- {
- "dependencies": {
- "@anthropic-ai/claude-code": "^0.0.42"
- }
- }
-
-After:
-
- {
- "dependencies": {
- "@anthropic-ai/claude-agent-sdk": "^0.3.0"
- }
- }
-
-**5\. Reviewbreaking changes** Make any code changes needed to complete the migration.
+**4\. Update package.json:** If `@anthropic-ai/claude-code` is still listed in your `package.json`, replace it with `@anthropic-ai/claude-agent-sdk` and update the version range as well, for example from `"^0.0.42"` to `"^0.3.0"`. **5\. Reviewbreaking changes** Make any code changes needed to complete the migration.
###
@@ -175,59 +159,13 @@
asyncio.run(main())
-**Why this changed:** Provides better control and isolation for SDK applications. You can now build agents with custom behavior without inheriting Claude Code’s CLI-focused instructions.
-
###
Settings sources default
-This default was briefly changed in v0.1.0 to load no filesystem settings and then reverted, so no migration action is needed. **Current behavior:** Omitting `settingSources` on `query()` loads user, project, and local filesystem settings, matching the CLI. This includes `~/.claude/settings.json`, `.claude/settings.json`, `.claude/settings.local.json`, CLAUDE.md files, and custom commands. To run isolated from filesystem settings, pass an empty array:
-
-TypeScript
-
-Python
-
- import { query } from "@anthropic-ai/claude-agent-sdk";
-
- const isolatedResult = query({
- prompt: "Hello",
- options: {
- settingSources: [] // No filesystem settings loaded
- }
- });
-
- // Or load only specific sources:
- const projectOnlyResult = query({
- prompt: "Hello",
- options: {
- settingSources: ["project"] // Only project settings
- }
- });
-
- from claude_agent_sdk import query, ClaudeAgentOptions
- import asyncio
-
- async def main():
- async for message in query(
- prompt="Hello",
- options=ClaudeAgentOptions(setting_sources=[]), # No filesystem settings loaded
- ):
- print(message)
-
- # Or load only specific sources:
- async for message in query(
- prompt="Hello",
- options=ClaudeAgentOptions(
- setting_sources=["project"] # Only project settings
- ),
- ):
- print(message)
-
- asyncio.run(main())
-
-Isolation is especially important for CI/CD pipelines, deployed applications, test environments, and multi-tenant systems where local customizations should not leak in.
+This default was briefly changed in v0.1.0 to load no filesystem settings and then reverted, so no migration action is needed. **Current behavior:** Omitting `settingSources` on `query()` loads user, project, and local filesystem settings, matching the CLI. This includes `~/.claude/settings.json`, `.claude/settings.json`, `.claude/settings.local.json`, CLAUDE.md files, and custom commands. To run isolated from filesystem settings, pass `settingSources: []`, or `setting_sources=[]` in Python. See [Control filesystem settings with settingSources](</docs/en/agent-sdk/claude-code-features#control-filesystem-settings-with-settingsources>) for what each source loads. Isolation is especially important for CI/CD pipelines, deployed applications, test environments, and multi-tenant systems where local customizations should not leak in.
Python SDK 0.1.59 and earlier treated an empty list the same as omitting the option, so upgrade before relying on `setting_sources=[]`. See [What settingSources does not control](</docs/en/agent-sdk/claude-code-features#what-settingsources-does-not-control>) for inputs that are read even when `settingSources` is `[]`.
--- a/migration-guide.md
+++ b/migration-guide.md
@@ -86,19 +86,7 @@
# After
from claude_agent_sdk import query, ClaudeAgentOptions
-**4\. Update type names:** Change `ClaudeCodeOptions` to `ClaudeAgentOptions`:
-
- # Before
- from claude_code_sdk import query, ClaudeCodeOptions
-
- options = ClaudeCodeOptions(model="claude-opus-4-7")
-
- # After
- from claude_agent_sdk import query, ClaudeAgentOptions
-
- options = ClaudeAgentOptions(model="claude-opus-4-7")
-
-**5\. Reviewbreaking changes** Make any code changes needed to complete the migration.
+**4\. Reviewbreaking changes** Make any code changes needed to complete the migration.
##
@@ -106,7 +94,7 @@
Breaking changes
-To improve isolation and explicit configuration, Claude Agent SDK v0.1.0 introduces breaking changes for users migrating from Claude Code SDK. Review this section carefully before migrating.
+To improve isolation and explicit configuration, Claude Agent SDK v0.1.0 introduces breaking changes for users migrating from Claude Code SDK.
###
--- a/migration-guide.md
+++ b/migration-guide.md
@@ -78,7 +78,7 @@
pip install claude-agent-sdk
-**3\. Update your imports:** Change all imports from `claude_code_sdk` to `claude_agent_sdk`:
+If `claude-code-sdk` is listed in your `requirements.txt` or `pyproject.toml`, replace it with `claude-agent-sdk`. **3\. Update your imports:** Change all imports from `claude_code_sdk` to `claude_agent_sdk`:
# Before
from claude_code_sdk import query, ClaudeCodeOptions
@@ -125,8 +125,6 @@
from claude_agent_sdk import query, ClaudeAgentOptions
options = ClaudeAgentOptions(model="claude-opus-4-7", permission_mode="acceptEdits")
-
-**Why this changed:** The type name now matches the “Claude Agent SDK” branding and provides consistency across the SDK’s naming conventions.
###
@@ -197,7 +195,7 @@
Settings sources default
-This default was briefly changed in v0.1.0 and then reverted, so no migration action is needed. **Current behavior:** Omitting `settingSources` on `query()` loads user, project, and local filesystem settings, matching the CLI. This includes `~/.claude/settings.json`, `.claude/settings.json`, `.claude/settings.local.json`, CLAUDE.md files, and custom commands. To run isolated from filesystem settings, pass an empty array:
+This default was briefly changed in v0.1.0 to load no filesystem settings and then reverted, so no migration action is needed. **Current behavior:** Omitting `settingSources` on `query()` loads user, project, and local filesystem settings, matching the CLI. This includes `~/.claude/settings.json`, `.claude/settings.json`, `.claude/settings.local.json`, CLAUDE.md files, and custom commands. To run isolated from filesystem settings, pass an empty array:
TypeScript
@@ -243,37 +241,7 @@
Isolation is especially important for CI/CD pipelines, deployed applications, test environments, and multi-tenant systems where local customizations should not leak in.
-SDK v0.1.0 briefly defaulted to no settings loaded; this was reverted in subsequent releases. Python SDK 0.1.59 and earlier treated an empty list the same as omitting the option, so upgrade before relying on `setting_sources=[]`. See [What settingSources does not control](</docs/en/agent-sdk/claude-code-features#what-settingsources-does-not-control>) for inputs that are read even when `settingSources` is `[]`.
-
-##
-
-
-
-Why the Rename?
-
-The Claude Code SDK was originally designed for coding tasks, but it has evolved into a powerful framework for building all types of AI agents. The new name “Claude Agent SDK” better reflects its capabilities:
-
- * Building business agents (legal assistants, finance advisors, customer support)
- * Creating specialized coding agents (SRE bots, security reviewers, code review agents)
- * Developing custom agents for any domain with tool use, MCP integration, and more
-
-##
-
-
-
-Getting Help
-
-If you encounter any issues during migration: **For TypeScript/JavaScript:**
-
- 1. Check that all imports are updated to use `@anthropic-ai/claude-agent-sdk`
- 2. Verify your package.json has the new package name
- 3. Run `npm install` to ensure dependencies are updated
-
-**For Python:**
-
- 1. Check that all imports are updated to use `claude_agent_sdk`
- 2. Verify your requirements.txt or pyproject.toml has the new package name
- 3. Run `pip install claude-agent-sdk` to ensure the package is installed
+Python SDK 0.1.59 and earlier treated an empty list the same as omitting the option, so upgrade before relying on `setting_sources=[]`. See [What settingSources does not control](</docs/en/agent-sdk/claude-code-features#what-settingsources-does-not-control>) for inputs that are read even when `settingSources` is `[]`.
##
--- a/migration-guide.md
+++ b/migration-guide.md
@@ -16,9 +16,7 @@
---|---|---
**Package Name (TS/JS)**| `@anthropic-ai/claude-code`| `@anthropic-ai/claude-agent-sdk`
**Python Package**| `claude-code-sdk`| `claude-agent-sdk`
-**Documentation Location**| Claude Code docs| API Guide → Agent SDK section
-
-**Documentation Changes:** The Agent SDK documentation has moved from the Claude Code docs to the API Guide under a dedicated [Agent SDK](</docs/en/agent-sdk/overview>) section. The Claude Code docs now focus on the CLI tool and automation features.
+**Documentation Location**| Claude Code docs| Claude Code docs → dedicated [Agent SDK](</docs/en/agent-sdk/overview>) section
##
Show diff (120 lines)
--- a/migration-guide.md
+++ b/migration-guide.md
@@ -60,7 +60,7 @@
{
"dependencies": {
- "@anthropic-ai/claude-agent-sdk": "^0.2.0"
+ "@anthropic-ai/claude-agent-sdk": "^0.3.0"
}
}
@@ -74,9 +74,9 @@
**1\. Uninstall the old package:**
- pip uninstall claude-code-sdk
-
-**2\. Install the new package:**
+ pip uninstall -y claude-code-sdk
+
+If the old package isn’t installed, pip prints `WARNING: Skipping claude-code-sdk as it is not installed.` That’s expected and you can continue to the next step. **2\. Install the new package:**
pip install claude-agent-sdk
@@ -164,28 +164,32 @@
}
});
- # BEFORE (v0.0.x) - Used Claude Code's system prompt by default
- async for message in query(prompt="Hello"):
- print(message)
-
- # AFTER (v0.1.0) - Uses minimal system prompt by default
- # To get the old behavior, explicitly request Claude Code's preset:
- from claude_agent_sdk import query, ClaudeAgentOptions
-
- async for message in query(
- prompt="Hello",
- options=ClaudeAgentOptions(
- system_prompt={"type": "preset", "preset": "claude_code"} # Use the preset
- ),
- ):
- print(message)
-
- # Or use a custom system prompt:
- async for message in query(
- prompt="Hello",
- options=ClaudeAgentOptions(system_prompt="You are a helpful coding assistant"),
- ):
- print(message)
+ from claude_agent_sdk import query, ClaudeAgentOptions
+ import asyncio
+
+ async def main():
+ # BEFORE (v0.0.x) - Used Claude Code's system prompt by default
+ async for message in query(prompt="Hello"):
+ print(message)
+
+ # AFTER (v0.1.0) - Uses minimal system prompt by default
+ # To get the old behavior, explicitly request Claude Code's preset:
+ async for message in query(
+ prompt="Hello",
+ options=ClaudeAgentOptions(
+ system_prompt={"type": "preset", "preset": "claude_code"} # Use the preset
+ ),
+ ):
+ print(message)
+
+ # Or use a custom system prompt:
+ async for message in query(
+ prompt="Hello",
+ options=ClaudeAgentOptions(system_prompt="You are a helpful coding assistant"),
+ ):
+ print(message)
+
+ asyncio.run(main())
**Why this changed:** Provides better control and isolation for SDK applications. You can now build agents with custom behavior without inheriting Claude Code’s CLI-focused instructions.
@@ -219,21 +223,25 @@
});
from claude_agent_sdk import query, ClaudeAgentOptions
-
- async for message in query(
- prompt="Hello",
- options=ClaudeAgentOptions(setting_sources=[]), # No filesystem settings loaded
- ):
- print(message)
-
- # Or load only specific sources:
- async for message in query(
- prompt="Hello",
- options=ClaudeAgentOptions(
- setting_sources=["project"] # Only project settings
- ),
- ):
- print(message)
+ import asyncio
+
+ async def main():
+ async for message in query(
+ prompt="Hello",
+ options=ClaudeAgentOptions(setting_sources=[]), # No filesystem settings loaded
+ ):
+ print(message)
+
+ # Or load only specific sources:
+ async for message in query(
+ prompt="Hello",
+ options=ClaudeAgentOptions(
+ setting_sources=["project"] # Only project settings
+ ),
+ ):
+ print(message)
+
+ asyncio.run(main())
Isolation is especially important for CI/CD pipelines, deployed applications, test environments, and multi-tenant systems where local customizations should not leak in.
--- a/migration-guide.md
+++ b/migration-guide.md
@@ -164,6 +164,29 @@
}
});
+ # BEFORE (v0.0.x) - Used Claude Code's system prompt by default
+ async for message in query(prompt="Hello"):
+ print(message)
+
+ # AFTER (v0.1.0) - Uses minimal system prompt by default
+ # To get the old behavior, explicitly request Claude Code's preset:
+ from claude_agent_sdk import query, ClaudeAgentOptions
+
+ async for message in query(
+ prompt="Hello",
+ options=ClaudeAgentOptions(
+ system_prompt={"type": "preset", "preset": "claude_code"} # Use the preset
+ ),
+ ):
+ print(message)
+
+ # Or use a custom system prompt:
+ async for message in query(
+ prompt="Hello",
+ options=ClaudeAgentOptions(system_prompt="You are a helpful coding assistant"),
+ ):
+ print(message)
+
**Why this changed:** Provides better control and isolation for SDK applications. You can now build agents with custom behavior without inheriting Claude Code’s CLI-focused instructions.
###
@@ -194,6 +217,23 @@
settingSources: ["project"] // Only project settings
}
});
+
+ from claude_agent_sdk import query, ClaudeAgentOptions
+
+ async for message in query(
+ prompt="Hello",
+ options=ClaudeAgentOptions(setting_sources=[]), # No filesystem settings loaded
+ ):
+ print(message)
+
+ # Or load only specific sources:
+ async for message in query(
+ prompt="Hello",
+ options=ClaudeAgentOptions(
+ setting_sources=["project"] # Only project settings
+ ),
+ ):
+ print(message)
Isolation is especially important for CI/CD pipelines, deployed applications, test environments, and multi-tenant systems where local customizations should not leak in.
--- a/migration-guide.md
+++ b/migration-guide.md
@@ -64,7 +64,7 @@
}
}
-That’s it! No other code changes are required.
+**5\. Reviewbreaking changes** Make any code changes needed to complete the migration.
###
@@ -142,12 +142,14 @@
Python
+ import { query } from "@anthropic-ai/claude-agent-sdk";
+
// BEFORE (v0.0.x) - Used Claude Code's system prompt by default
- const result = query({ prompt: "Hello" });
+ const before = query({ prompt: "Hello" });
// AFTER (v0.1.0) - Uses minimal system prompt by default
// To get the old behavior, explicitly request Claude Code's preset:
- const result = query({
+ const presetResult = query({
prompt: "Hello",
options: {
systemPrompt: { type: "preset", preset: "claude_code" }
@@ -155,7 +157,7 @@
});
// Or use a custom system prompt:
- const result = query({
+ const customResult = query({
prompt: "Hello",
options: {
systemPrompt: "You are a helpful coding assistant"
@@ -176,7 +178,9 @@
Python
- const result = query({
+ import { query } from "@anthropic-ai/claude-agent-sdk";
+
+ const isolatedResult = query({
prompt: "Hello",
options: {
settingSources: [] // No filesystem settings loaded
@@ -184,7 +188,7 @@
});
// Or load only specific sources:
- const result = query({
+ const projectOnlyResult = query({
prompt: "Hello",
options: {
settingSources: ["project"] // Only project settings
--- a/migration-guide.md
+++ b/migration-guide.md
@@ -1,9 +1,3 @@
-> ## Documentation Index
->
-> Fetch the complete documentation index at: <https://code.claude.com/docs/llms.txt>
->
-> Use this file to discover all available pages before exploring further.
-
##
--- a/migration-guide.md
+++ b/migration-guide.md
@@ -174,29 +174,18 @@
-Settings Sources No Longer Loaded by Default
-
-**What changed:** The SDK no longer reads from filesystem settings (CLAUDE.md, settings.json, slash commands, etc.) by default. **Migration:**
+Settings sources default
+
+This default was briefly changed in v0.1.0 and then reverted, so no migration action is needed. **Current behavior:** Omitting `settingSources` on `query()` loads user, project, and local filesystem settings, matching the CLI. This includes `~/.claude/settings.json`, `.claude/settings.json`, `.claude/settings.local.json`, CLAUDE.md files, and custom commands. To run isolated from filesystem settings, pass an empty array:
TypeScript
Python
- // BEFORE (v0.0.x) - Loaded all settings automatically
- const result = query({ prompt: "Hello" });
- // Would read from:
- // - ~/.claude/settings.json (user)
- // - .claude/settings.json (project)
- // - .claude/settings.local.json (local)
- // - CLAUDE.md files
- // - Custom slash commands
-
- // AFTER (v0.1.0) - No settings loaded by default
- // To get the old behavior:
- const result = query({
- prompt: "Hello",
- options: {
- settingSources: ["user", "project", "local"]
+ const result = query({
+ prompt: "Hello",
+ options: {
+ settingSources: [] // No filesystem settings loaded
}
});
@@ -208,14 +197,9 @@
}
});
-**Why this changed:** Ensures SDK applications have predictable behavior independent of local filesystem configurations. This is especially important for:
-
- * **CI/CD environments** \- Consistent behavior without local customizations
- * **Deployed applications** \- No dependency on filesystem settings
- * **Testing** \- Isolated test environments
- * **Multi-tenant systems** \- Prevent settings leakage between users
-
-Current SDK releases have reverted this default for `query()`: omitting the option once again loads user, project, and local settings, matching the CLI. Pass `settingSources: []` in TypeScript or `setting_sources=[]` in Python if your application depends on the isolated behavior described above. Python SDK 0.1.59 and earlier treated an empty list the same as omitting the option, so upgrade before relying on `setting_sources=[]`. See [What settingSources does not control](</docs/en/agent-sdk/claude-code-features#what-settingsources-does-not-control>) for inputs that are read even when `settingSources` is `[]`.
+Isolation is especially important for CI/CD pipelines, deployed applications, test environments, and multi-tenant systems where local customizations should not leak in.
+
+SDK v0.1.0 briefly defaulted to no settings loaded; this was reverted in subsequent releases. Python SDK 0.1.59 and earlier treated an empty list the same as omitting the option, so upgrade before relying on `setting_sources=[]`. See [What settingSources does not control](</docs/en/agent-sdk/claude-code-features#what-settingsources-does-not-control>) for inputs that are read even when `settingSources` is `[]`.
##
--- a/migration-guide.md
+++ b/migration-guide.md
@@ -1,3 +1,9 @@
+> ## Documentation Index
+>
+> Fetch the complete documentation index at: <https://code.claude.com/docs/llms.txt>
+>
+> Use this file to discover all available pages before exploring further.
+
##
--- a/migration-guide.md
+++ b/migration-guide.md
@@ -93,12 +93,12 @@
# Before
from claude_code_sdk import query, ClaudeCodeOptions
- options = ClaudeCodeOptions(model="claude-opus-4-6")
+ options = ClaudeCodeOptions(model="claude-opus-4-7")
# After
from claude_agent_sdk import query, ClaudeAgentOptions
- options = ClaudeAgentOptions(model="claude-opus-4-6")
+ options = ClaudeAgentOptions(model="claude-opus-4-7")
**5\. Reviewbreaking changes** Make any code changes needed to complete the migration.
@@ -121,12 +121,12 @@
# BEFORE (claude-code-sdk)
from claude_code_sdk import query, ClaudeCodeOptions
- options = ClaudeCodeOptions(model="claude-opus-4-6", permission_mode="acceptEdits")
+ options = ClaudeCodeOptions(model="claude-opus-4-7", permission_mode="acceptEdits")
# AFTER (claude-agent-sdk)
from claude_agent_sdk import query, ClaudeAgentOptions
- options = ClaudeAgentOptions(model="claude-opus-4-6", permission_mode="acceptEdits")
+ options = ClaudeAgentOptions(model="claude-opus-4-7", permission_mode="acceptEdits")
**Why this changed:** The type name now matches the “Claude Agent SDK” branding and provides consistency across the SDK’s naming conventions.
@@ -209,7 +209,7 @@
* **Testing** \- Isolated test environments
* **Multi-tenant systems** \- Prevent settings leakage between users
-**Backward compatibility:** If your application relied on filesystem settings (custom slash commands, CLAUDE.md instructions, etc.), add `settingSources: ['user', 'project', 'local']` to your options.
+Current SDK releases have reverted this default for `query()`: omitting the option once again loads user, project, and local settings, matching the CLI. Pass `settingSources: []` in TypeScript or `setting_sources=[]` in Python if your application depends on the isolated behavior described above. Python SDK 0.1.59 and earlier treated an empty list the same as omitting the option, so upgrade before relying on `setting_sources=[]`. See [What settingSources does not control](</docs/en/agent-sdk/claude-code-features#what-settingsources-does-not-control>) for inputs that are read even when `settingSources` is `[]`.
##
Show diff (256 lines)
--- a/migration-guide.md
+++ b/migration-guide.md
@@ -0,0 +1,253 @@
+##
+
+
+
+Overview
+
+The Claude Code SDK has been renamed to the **Claude Agent SDK** and its documentation has been reorganized. This change reflects the SDK’s broader capabilities for building AI agents beyond just coding tasks.
+
+##
+
+
+
+What’s Changed
+
+Aspect| Old| New
+---|---|---
+**Package Name (TS/JS)**| `@anthropic-ai/claude-code`| `@anthropic-ai/claude-agent-sdk`
+**Python Package**| `claude-code-sdk`| `claude-agent-sdk`
+**Documentation Location**| Claude Code docs| API Guide → Agent SDK section
+
+**Documentation Changes:** The Agent SDK documentation has moved from the Claude Code docs to the API Guide under a dedicated [Agent SDK](</docs/en/agent-sdk/overview>) section. The Claude Code docs now focus on the CLI tool and automation features.
+
+##
+
+
+
+Migration Steps
+
+###
+
+
+
+For TypeScript/JavaScript Projects
+
+**1\. Uninstall the old package:**
+
+ npm uninstall @anthropic-ai/claude-code
+
+**2\. Install the new package:**
+
+ npm install @anthropic-ai/claude-agent-sdk
+
+**3\. Update your imports:** Change all imports from `@anthropic-ai/claude-code` to `@anthropic-ai/claude-agent-sdk`:
+
+ // Before
+ import { query, tool, createSdkMcpServer } from "@anthropic-ai/claude-code";
+
+ // After
+ import { query, tool, createSdkMcpServer } from "@anthropic-ai/claude-agent-sdk";
+
+**4\. Update package.json dependencies:** If you have the package listed in your `package.json`, update it: Before:
+
+ {
+ "dependencies": {
+ "@anthropic-ai/claude-code": "^0.0.42"
+ }
+ }
+
+After:
+
+ {
+ "dependencies": {
+ "@anthropic-ai/claude-agent-sdk": "^0.2.0"
+ }
+ }
+
+That’s it! No other code changes are required.
+
+###
+
+
+
+For Python Projects
+
+**1\. Uninstall the old package:**
+
+ pip uninstall claude-code-sdk
+
+**2\. Install the new package:**
+
+ pip install claude-agent-sdk
+
+**3\. Update your imports:** Change all imports from `claude_code_sdk` to `claude_agent_sdk`:
+
+ # Before
+ from claude_code_sdk import query, ClaudeCodeOptions
+
+ # After
+ from claude_agent_sdk import query, ClaudeAgentOptions
+
+**4\. Update type names:** Change `ClaudeCodeOptions` to `ClaudeAgentOptions`:
+
+ # Before
+ from claude_code_sdk import query, ClaudeCodeOptions
+
+ options = ClaudeCodeOptions(model="claude-opus-4-6")
+
+ # After
+ from claude_agent_sdk import query, ClaudeAgentOptions
+
+ options = ClaudeAgentOptions(model="claude-opus-4-6")
+
+**5\. Reviewbreaking changes** Make any code changes needed to complete the migration.
+
+##
+
+
+
+Breaking changes
+
+To improve isolation and explicit configuration, Claude Agent SDK v0.1.0 introduces breaking changes for users migrating from Claude Code SDK. Review this section carefully before migrating.
+
+###
+
+
+
+Python: ClaudeCodeOptions renamed to ClaudeAgentOptions
+
+**What changed:** The Python SDK type `ClaudeCodeOptions` has been renamed to `ClaudeAgentOptions`. **Migration:**
+
+ # BEFORE (claude-code-sdk)
+ from claude_code_sdk import query, ClaudeCodeOptions
+
+ options = ClaudeCodeOptions(model="claude-opus-4-6", permission_mode="acceptEdits")
+
+ # AFTER (claude-agent-sdk)
+ from claude_agent_sdk import query, ClaudeAgentOptions
+
+ options = ClaudeAgentOptions(model="claude-opus-4-6", permission_mode="acceptEdits")
+
+**Why this changed:** The type name now matches the “Claude Agent SDK” branding and provides consistency across the SDK’s naming conventions.
+
+###
+
+
+
+System prompt no longer default
+
+**What changed:** The SDK no longer uses Claude Code’s system prompt by default. **Migration:**
+
+TypeScript
+
+Python
+
+ // BEFORE (v0.0.x) - Used Claude Code's system prompt by default
+ const result = query({ prompt: "Hello" });
+
+ // AFTER (v0.1.0) - Uses minimal system prompt by default
+ // To get the old behavior, explicitly request Claude Code's preset:
+ const result = query({
+ prompt: "Hello",
+ options: {
+ systemPrompt: { type: "preset", preset: "claude_code" }
+ }
+ });
+
+ // Or use a custom system prompt:
+ const result = query({
+ prompt: "Hello",
+ options: {
+ systemPrompt: "You are a helpful coding assistant"
+ }
+ });
+
+**Why this changed:** Provides better control and isolation for SDK applications. You can now build agents with custom behavior without inheriting Claude Code’s CLI-focused instructions.
+
+###
+
+
+
+Settings Sources No Longer Loaded by Default
+
+**What changed:** The SDK no longer reads from filesystem settings (CLAUDE.md, settings.json, slash commands, etc.) by default. **Migration:**
+
+TypeScript
+
+Python
+
+ // BEFORE (v0.0.x) - Loaded all settings automatically
+ const result = query({ prompt: "Hello" });
+ // Would read from:
+ // - ~/.claude/settings.json (user)
+ // - .claude/settings.json (project)
+ // - .claude/settings.local.json (local)
+ // - CLAUDE.md files
+ // - Custom slash commands
+
+ // AFTER (v0.1.0) - No settings loaded by default
+ // To get the old behavior:
+ const result = query({
+ prompt: "Hello",
+ options: {
+ settingSources: ["user", "project", "local"]
+ }
+ });
+
+ // Or load only specific sources:
+ const result = query({
+ prompt: "Hello",
+ options: {
+ settingSources: ["project"] // Only project settings
+ }
+ });
+
+**Why this changed:** Ensures SDK applications have predictable behavior independent of local filesystem configurations. This is especially important for:
+
+ * **CI/CD environments** \- Consistent behavior without local customizations
+ * **Deployed applications** \- No dependency on filesystem settings
+ * **Testing** \- Isolated test environments
+ * **Multi-tenant systems** \- Prevent settings leakage between users
+
+**Backward compatibility:** If your application relied on filesystem settings (custom slash commands, CLAUDE.md instructions, etc.), add `settingSources: ['user', 'project', 'local']` to your options.
+
+##
+
+
+
+Why the Rename?
+
+The Claude Code SDK was originally designed for coding tasks, but it has evolved into a powerful framework for building all types of AI agents. The new name “Claude Agent SDK” better reflects its capabilities:
+
+ * Building business agents (legal assistants, finance advisors, customer support)
+ * Creating specialized coding agents (SRE bots, security reviewers, code review agents)
+ * Developing custom agents for any domain with tool use, MCP integration, and more
+
+##
+
+
+
+Getting Help
+
+If you encounter any issues during migration: **For TypeScript/JavaScript:**
+
+ 1. Check that all imports are updated to use `@anthropic-ai/claude-agent-sdk`
+ 2. Verify your package.json has the new package name
+ 3. Run `npm install` to ensure dependencies are updated
+
+**For Python:**
+
+ 1. Check that all imports are updated to use `claude_agent_sdk`
+ 2. Verify your requirements.txt or pyproject.toml has the new package name
+ 3. Run `pip install claude-agent-sdk` to ensure the package is installed
+
+##
+
+
+
+Next Steps
+
+ * Explore the [Agent SDK Overview](</docs/en/agent-sdk/overview>) to learn about available features
+ * Check out the [TypeScript SDK Reference](</docs/en/agent-sdk/typescript>) for detailed API documentation
+ * Review the [Python SDK Reference](</docs/en/agent-sdk/python>) for Python-specific documentation
+ * Learn about [Custom Tools](</docs/en/agent-sdk/custom-tools>) and [MCP Integration](</docs/en/agent-sdk/mcp>)