Skip to content

docs(readme): document filesystem settings defaults and CLAUDE.md loading#1115

Open
TejasAmle wants to merge 1 commit into
anthropics:mainfrom
TejasAmle:claude/docs-filesystem-settings
Open

docs(readme): document filesystem settings defaults and CLAUDE.md loading#1115
TejasAmle wants to merge 1 commit into
anthropics:mainfrom
TejasAmle:claude/docs-filesystem-settings

Conversation

@TejasAmle

Copy link
Copy Markdown

The user problem

New SDK users hit the same surprise in two opposite directions, and file issues both ways:

  1. "Why isn't my memory / CLAUDE.md loaded?"Memory is not loaded automatically #1066, [QUESTION] CLAUDE.md in Claude Code SDK #118, When preset = "claude_code" is used? #494
  2. "Why does my agent behave differently in Docker/K8s than on my laptop?"skills="all" does not add "Skill" to tools #977 ("probably something in my global settings that gets read locally but is not available in the cloud"), SDK v0.1.8+ silently fails in Docker when loading filesystem agents via setting_sources=["project"] #406, [BUG] Global Claude Code settings override SDK client configuration #45

Both trace to one fact the README never states: the SDK loads user/project/local filesystem settings by default, exactly like the CLI — including CLAUDE.md, custom slash commands, and subagents. Making it harder to discover, the 0.1.0 CHANGELOG migration notes say the opposite ("No filesystem settings by default"), and older blog posts and LLM answers echo that. The one accurate description today is the setting_sources docstring in types.py, which users evidently don't find before filing issues (~43 issues in this tracker mention setting_sources).

What changed

A short "Filesystem Settings and CLAUDE.md" subsection in the README, placed after "Working Directory". It states the default in one sentence, names the production implication (host-dependent behavior), and gives two copy-pasteable setting_sources examples (hermetic, and project-only). Docs-only; no code touched.

How verified

Ran claude-agent-sdk 0.2.116 from PyPI (bundled CLI 2.1.207, Linux, Python 3.12) with a scrubbed environment (all CLAUDE_* session vars removed). The working directory contained a CLAUDE.md with a marker codename; tools=[] and max_turns=1 so the model could not read the file with tools — it can only know the codename if CLAUDE.md was injected as context. Then asked the model for the codename:

ClaudeAgentOptions Codename visible to model
defaults ✅ yes
system_prompt={"type": "preset", "preset": "claude_code"} ✅ yes
preset + setting_sources=[] ❌ no
preset + setting_sources=["project"] ✅ yes
setting_sources=["project"] only (no preset) ✅ yes

So CLAUDE.md loading is governed by setting_sources alone (the system-prompt preset is not required), which is what the new section documents.

Happy to reword, shorten, or move this into the docstring / platform docs instead if the README isn't the surface you want this on.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BtNuvm15JHJv7c6QV28gsh

…ding

The README never states that the SDK loads user/project/local filesystem
settings (including CLAUDE.md, slash commands, and subagents) by default,
matching CLI behavior. Users hit this in both directions: expecting
memory to load when it does not appear to, and being surprised that
deployed agents inherit host-machine settings. Add a short subsection
stating the default, the production implication, and two copy-pasteable
setting_sources examples.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BtNuvm15JHJv7c6QV28gsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant