Why use settingSources
Disable filesystem settings:
typescript
import { query } from "@anthropic-ai/claude-agent-sdk";
// Do not load user, project, or local settings from disk
const result = query({
prompt: "Analyze this code",
options: { settingSources: [] }
});Load only specific setting sources:
typescript
import { query } from "@anthropic-ai/claude-agent-sdk";
// Load only project settings, ignore user and local
const result = query({
prompt: "Run CI checks",
options: {
settingSources: ["project"] // Only .claude/settings.json
}
});To load CLAUDE.md project instructions, include "project" in settingSources. See Modify system prompts for how CLAUDE.md loading interacts with the system prompt options.