Skip to main content

Module settings

Module settings 

Source
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 the ForgeSdkBridge.
  • 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§

SettingsDocuments
Three raw settings documents, each None when the underlying file is absent or unreadable. Malformed JSON also yields None - 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. None when the file is absent or unreadable.