The whole hunk
from line 42, old and new numbered
/
lines
from line 42
4242import { query, tool, createSdkMcpServer } from "@anthropic-ai/claude-agent-sdk";
4343```
4444
45**4. Update package.json dependencies:**
45**4. Update package.json:**
4646
47If you have the package listed in your `package.json`, update it:
47If `@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"`.
4848
49Before:
50
51```json theme={null}
52{
53 "dependencies": {
54 "@anthropic-ai/claude-code": "^0.0.42"
55 }
56}
57```
58
59After:
60
61```json theme={null}
62{
63 "dependencies": {
64 "@anthropic-ai/claude-agent-sdk": "^0.3.0"
65 }
66}
67```
68
6949**5. Review [breaking changes](#breaking-changes)**
7050
7151Make any code changes needed to complete the migration.
from line 171
191171 ```
192172</CodeGroup>
193173
194**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.
195
196174### Settings sources default
197175
198176This default was briefly changed in v0.1.0 to load no filesystem settings and then reverted, so no migration action is needed.
from line 177
199177
200178**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.
201179
202To run isolated from filesystem settings, pass an empty array:
203
204<CodeGroup>
205 ```typescript TypeScript theme={null}
206 import { query } from "@anthropic-ai/claude-agent-sdk";
207
208 const isolatedResult = query({
209 prompt: "Hello",
210 options: {
211 settingSources: [] // Skip user, project, and local settings
212 }
213 });
214
215 // Or load only specific sources:
216 const projectOnlyResult = query({
217 prompt: "Hello",
218 options: {
219 settingSources: ["project"] // Only project settings
220 }
221 });
222 ```
223
224 ```python Python theme={null}
225 from claude_agent_sdk import query, ClaudeAgentOptions
226 import asyncio
227
228
229 async def main():
230 async for message in query(
231 prompt="Hello",
232 options=ClaudeAgentOptions(setting_sources=[]), # Skip user, project, and local settings
233 ):
234 print(message)
235
236 # Or load only specific sources:
237 async for message in query(
238 prompt="Hello",
239 options=ClaudeAgentOptions(
240 setting_sources=["project"] # Only project settings
241 ),
242 ):
243 print(message)
244
245
246 asyncio.run(main())
247 ```
248</CodeGroup>
180To 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.
249181
250182Isolation is especially important for CI/CD pipelines, deployed applications, test environments, and multi-tenant systems where local customizations should not leak in.
251183