src/schemas/) to validate all configuration. The schemas import from zod/v4 (the v4-compatible API included in zod@^3.24.0). Settings are layered across three scopes, with more specific scopes overriding broader ones.
Configuration levels
User settings
Stored in
~/.claude/. Applies to all projects for the current user. Includes preferences like theme, model selection, keybindings, effort level, and privacy settings.Managed via the /config command or by editing the settings file directly.Project-level settings
Stored in a
CLAUDE.md file at the project root and a project config file. Applies only within the current project directory.CLAUDE.md acts as the project’s memory — it can contain conventions, architecture notes, and any context Claude should always have available. Initialize it with /init.Organization / enterprise policies
Managed via MDM (Mobile Device Management). These are read-only settings pushed by an IT administrator and cannot be overridden by user or project config.Loaded at startup from remote managed settings (
src/services/remoteManagedSettings/). Enforced via policy limits (src/services/policyLimits/).Viewing and modifying config
Use the/config command to interactively view and modify settings:
updateConfig skill:
ConfigTool is also available to the agent for reading or writing configuration during tool-call loops.
Permission rules
Permission rules control which tool invocations are automatically approved without prompting the user. Rules are stored in your settings and evaluated against each tool call before execution. Rules use a wildcard pattern syntax:/permissions command.
Config schemas
All configuration shapes are defined as Zod schemas insrc/schemas/. This includes:
| Schema | Purpose |
|---|---|
| User settings | Personal preferences, model, theme, keybindings |
| Project-level settings | Per-project context and overrides |
| Organization policies | MDM-enforced enterprise settings |
| Permission rules | Tool invocation allow-lists |
| Hook schemas | Pre/post tool execution hook definitions |
src/schemas/hooks.ts) define four hook types:
command hook
command hook
Runs a shell command before or after a tool invocation.
prompt hook
prompt hook
Evaluates an LLM prompt as a hook, passing tool input via
$ARGUMENTS.agent hook
agent hook
Spawns a sub-agent to verify a condition. The agent exits with code 2 to block execution.
http hook
http hook
POSTs the hook input JSON to an HTTP endpoint.
Config migrations
Thesrc/migrations/ directory handles config format changes between Claude Code versions. When you upgrade, migrations automatically read your old config and transform it to the current schema — no manual intervention required.
CLAUDE.md is part of the memory system. For more detail on how project memory, user memory, and auto-extracted memories work together, see the Memory subsystem documentation.