Expand description
Settings document accessors - read the three Claude Code
configuration files. Reads return raw serde_json::Value
documents; consumers own the merge / precedence semantics.
Resolution rules match the claude CLI as of 2.1.117:
- User settings at
<config_dir>/settings.json.<config_dir>is the path the caller passes - typically the per-spawn account binding stored on theForgeSdkBridge. - Project-local settings at
<cwd>/.claude/settings.local.json. Tied to the project’s working directory;<config_dir>does not affect this path. - User preferences at
$HOME/.claude.json(note the leading dot - this is a file at the home root, not a directory under it). Per-user preferences (notification channel, gitignore respect, terminal-progress-bar, etc.);<config_dir>does not affect this either.
Structs§
- Settings
Documents - Three raw settings documents, each
Nonewhen the underlying file is absent or unreadable. Malformed JSON also yieldsNone- consumers that care about distinguishing missing vs. corrupt should re-read directly.
Functions§
- save_
document - Write one settings document, leaving the file it replaces whole.
- settings_
documents - Read the three Claude Code settings documents from disk.
- user_
preferences - The per-user preferences document alone, for a reader that wants
nothing else out of it.
Nonewhen the file is absent or unreadable.