Claude Code Settings Reference
Every key inside settings.json, the full env var list, and the 5-layer precedence chain that decides which value actually wins.
Problem: Most Claude Code pain has one root cause. Your config does not line up with how you work. You rubber-stamp bash commands all day, team defaults never load, or a key you edited yesterday does nothing.
The cure is knowing the settings system. Not only the keys, but the precedence rules that pick a winner when two scopes disagree.
Quick Win: Drop a $schema line into settings.json and every editor that understands JSON schema lights up with autocomplete and inline checks. VS Code, Cursor, and anything else with schema support all benefit.
The Five-Scope Precedence Chain
Settings follow a fixed pecking order. Knowing it is the gap between "why did my change not land" and "oh, wrong file."
Scope Precedence (Highest to Lowest)
| Priority | Scope | Location | Who It Affects | Shared? |
|---|---|---|---|---|
| 1 | Managed | System directories | All users on machine | Yes (IT-deployed) |
| 2 | Command line | CLI flags | Current session only | No |
| 3 | Local | .claude/settings.local.json | You, this project | No (gitignored) |
| 4 | Project | .claude/settings.json | All collaborators | Yes (in git) |
| 5 | User | ~/.claude/settings.json | You, all projects | No |
Higher scopes always beat lower ones. Full stop. A managed rule from IT that blocks Bash(curl *) is unreachable by any personal or project file.
Picking the Right Scope
Managed fits organizations that need rules with no escape hatch:
- Security policies (block credential access, forbid destructive commands)
- Compliance that must apply to every engineer and every repo
- Standard hooks or MCP configs rolled out by IT
Command line flags handle one-shot overrides within a single session:
- Trying a different model:
claude --model claude-sonnet-4-5-20250929 - Granting extra permission headroom for one specific job
- Running with the
--debugflag
Local is your private sandbox for a given repo:
- Quietly override a project rule that does not fit your machine
- Try out a hook before you pitch it to the team
- Paths unique to this machine (where your SSH key lives, which port the local proxy runs on)
Project is the place where the team lines up:
- Permission rules everyone follows
- Shared hooks for auto-format and lint
- MCP server configs every teammate needs
- CLAUDE.md instructions that describe the project
User is your own defaults:
- Language, theme, and the output style you prefer
- Plugins you want on in every repo
- Global permission rules (like a blanket deny on
~/.ssh)
Managed Settings Paths by OS
Managed files need admin rights and sit outside any user home directory:
| Operating System | Path |
|---|---|
| macOS | /Library/Application Support/ClaudeCode/ |
| Linux / WSL | /etc/claude-code/ |
| Windows | C:\Program Files\ClaudeCode\ |
Two files live in those folders. managed-settings.json holds the settings, managed-mcp.json holds MCP servers.
Every knob in Claude Code lives at a known file path in each scope:
| Feature | User | Project (shared) | Local (personal) |
|---|---|---|---|
| Settings | ~/.claude/settings.json | .claude/settings.json | .claude/settings.local.json |
| Subagents | ~/.claude/agents/ | .claude/agents/ | N/A |
| MCP servers | ~/.claude.json | .mcp.json | ~/.claude.json (per-project) |
| Plugins | ~/.claude/settings.json | .claude/settings.json | .claude/settings.local.json |
| CLAUDE.md | ~/.claude/CLAUDE.md | CLAUDE.md or .claude/CLAUDE.md | CLAUDE.local.md |
Settings Reference
General Settings
| Key | Description | Default | Example |
|---|---|---|---|
model | Override the default model | (system default) | "claude-sonnet-4-5-20250929" |
language | Claude's preferred response language | English | "japanese" |
outputStyle | Adjust system prompt style | (none) | "Explanatory" |
cleanupPeriodDays | Days before inactive sessions are deleted | 30 | 20 |
autoUpdatesChannel | Release channel: "stable" or "latest" | "latest" | "stable" |
showTurnDuration | Show response timing ("Cooked for 1m 6s") | true | false |
spinnerVerbs | Customize spinner text | (defaults) | {"mode": "append", "verbs": ["Pondering"]} |
spinnerTipsEnabled | Show tips while Claude works | true | false |
terminalProgressBarEnabled | Terminal progress bar (iTerm2, Windows Terminal) | true | false |
alwaysThinkingEnabled | Enable extended thinking by default | false | true |
plansDirectory | Where plan files are stored | ~/.claude/plans | "./plans" |
respectGitignore | @ file picker respects .gitignore | true | false |
companyAnnouncements | Messages shown at startup (random cycle) | (none) | ["Review guidelines at docs.acme.com"] |
Permission Settings
The keys below all nest inside the "permissions" object.
| Key | Description | Example |
|---|---|---|
allow | Rules to auto-allow tool use | ["Bash(npm run lint)", "Read(~/.zshrc)"] |
ask | Rules that require confirmation | ["Bash(git push *)"] |
deny | Rules to block tool use entirely | ["WebFetch", "Bash(curl *)", "Read(./.env)"] |
additionalDirectories | Extra directories Claude can access | ["../docs/", "../shared/"] |
defaultMode | Default permission mode at launch | "acceptEdits" |
disableBypassPermissionsMode | Block --dangerously-skip-permissions | "disable" |
Evaluation order: Deny gets the first pass. Ask is next. Allow goes last. The first rule that matches is the one that lands.
Rule syntax examples:
| Rule | What It Matches |
|---|---|
Bash | All Bash commands |
Bash(npm run *) | Commands starting with npm run |
Read(./.env) | Reading the .env file |
Read(./secrets/**) | Reading anything in secrets/ |
WebFetch(domain:example.com) | Fetch requests to example.com |
Sandbox Settings
The keys below nest inside the "sandbox" object and govern how bash commands are isolated.
| Key | Description | Default | Example |
|---|---|---|---|
enabled | Enable bash sandboxing | false | true |
autoAllowBashIfSandboxed | Auto-approve commands when sandboxed | true | true |
excludedCommands | Commands that run outside sandbox | (none) | ["git", "docker"] |
allowUnsandboxedCommands | Allow dangerouslyDisableSandbox escape | true | false |
enableWeakerNestedSandbox | Weaker sandbox for Docker (Linux/WSL2) | false | true |
network.allowedDomains | Outbound domains whitelist | (none) | ["github.com", "*.npmjs.org"] |
network.allowUnixSockets | Unix socket paths accessible in sandbox | (none) | ["~/.ssh/agent-socket"] |
network.allowAllUnixSockets | Allow all Unix socket connections | false | true |
network.allowLocalBinding | Allow binding to localhost (macOS only) | false | true |
network.httpProxyPort | Custom HTTP proxy port | (auto) | 8080 |
network.socksProxyPort | Custom SOCKS5 proxy port | (auto) | 8081 |
Attribution Settings
The keys below nest inside the "attribution" object and decide how git attributes Claude's work.
| Key | Description | Default |
|---|---|---|
commit | Text appended to git commit messages | "Generated with Claude Code..." + Co-Authored-By trailer |
pr | Text appended to pull request descriptions | "Generated with Claude Code..." |
Blank out either key with "" and the matching line disappears from git. The legacy includeCoAuthoredBy key still works, though it is now deprecated.
Plugin Settings
| Key | Description | Example |
|---|---|---|
enabledPlugins | Toggle plugins on/off | {"formatter@acme-tools": true} |
extraKnownMarketplaces | Additional plugin sources | See example below |
strictKnownMarketplaces | (Managed only) Restrict marketplace sources | [{"source": "github", "repo": "acme/plugins"}] |
Four source types exist. github points at a repo. git accepts any URL. directory uses a local path while you are developing. hostPattern does regex matching on hostnames.
MCP Server Settings
| Key | Description | Example |
|---|---|---|
enableAllProjectMcpServers | Auto-approve all project MCP servers | true |
enabledMcpjsonServers | Specific MCP servers to approve | ["memory", "github"] |
disabledMcpjsonServers | Specific MCP servers to reject | ["filesystem"] |
allowedMcpServers | (Managed only) MCP server allowlist | [{"serverName": "github"}] |
deniedMcpServers | (Managed only) MCP server denylist | [{"serverName": "filesystem"}] |
Authentication and Provider Settings
| Key | Description | Example |
|---|---|---|
apiKeyHelper | Script to generate auth value | "/bin/generate_temp_api_key.sh" |
forceLoginMethod | Restrict to claudeai or console | "claudeai" |
forceLoginOrgUUID | Auto-select organization during login | "xxxxxxxx-xxxx-..." |
awsAuthRefresh | Script to refresh AWS credentials | "aws sso login --profile myprofile" |
awsCredentialExport | Script outputting AWS credential JSON | "/bin/generate_aws_grant.sh" |
otelHeadersHelper | Script generating OpenTelemetry headers | "/bin/generate_otel_headers.sh" |
Hook and Advanced Settings
| Key | Description | Example |
|---|---|---|
hooks | Lifecycle event hook configuration | See hooks guide |
disableAllHooks | Disable all hooks | true |
allowManagedHooksOnly | (Managed only) Block user/project hooks | true |
allowManagedPermissionRulesOnly | (Managed only) Block user/project permission rules | true |
fileSuggestion | Custom @ file autocomplete script | {"type": "command", "command": "~/.claude/file-suggestion.sh"} |
statusLine | Custom status line display | {"type": "command", "command": "~/.claude/statusline.sh"} |
env | Environment variables for every session | {"FOO": "bar"} |
Environment Variables
Claude Code reads about 70 env vars. Most are edge cases. A working set of roughly 20 is all you see in day-to-day use.
Model and Provider
| Variable | Purpose |
|---|---|
ANTHROPIC_API_KEY | API key for direct API access |
ANTHROPIC_MODEL | Override the default model |
ANTHROPIC_DEFAULT_SONNET_MODEL | Model name for Sonnet alias |
CLAUDE_CODE_SUBAGENT_MODEL | Model for subagents (separate from main model) |
CLAUDE_CODE_USE_BEDROCK | Route through AWS Bedrock |
CLAUDE_CODE_USE_VERTEX | Route through Google Vertex |
The alias vars (ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL) come in handy whenever your org points a fine-tuned model at the stock alias names.
Performance Tuning
| Variable | Purpose |
|---|---|
CLAUDE_CODE_MAX_OUTPUT_TOKENS | Max output tokens (default: 32K, max: 64K) |
MAX_THINKING_TOKENS | Extended thinking budget (default: 31,999, set 0 to disable) |
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE | % of context capacity (1-100) triggering auto-compaction |
BASH_DEFAULT_TIMEOUT_MS | Default bash command timeout |
BASH_MAX_TIMEOUT_MS | Maximum bash timeout Claude can set |
BASH_MAX_OUTPUT_LENGTH | Max bash output chars before truncation |
Privacy and Telemetry
| Variable | Purpose |
|---|---|
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC | Disable updates, telemetry, error reporting all at once |
DISABLE_TELEMETRY | Opt out of Statsig telemetry |
DISABLE_ERROR_REPORTING | Opt out of Sentry error reporting |
CLAUDE_CODE_HIDE_ACCOUNT_INFO | Hide email and org name from UI |
DISABLE_AUTOUPDATER | Disable automatic version updates |
Session Control
| Variable | Purpose |
|---|---|
CLAUDE_CODE_TASK_LIST_ID | Share a task list across multiple sessions |
CLAUDE_CODE_ENABLE_TASKS | Set false to revert to old TODO list |
CLAUDE_CODE_SHELL | Override automatic shell detection |
CLAUDE_CONFIG_DIR | Custom config/data directory location |
MCP_TIMEOUT | Timeout in ms for MCP server startup |
MCP_TOOL_TIMEOUT | Timeout in ms for MCP tool execution |
Two ways exist. Export them from your shell profile, or drop them into the "env" object of settings.json so they survive sessions without any shell rc edits.
Working Out Config Conflicts
Most of the classic config headaches go away once you know which scope trumps which.
Case 1: A permission rule disagrees between scopes
Your user config allows Bash(curl *). The project config denies it. Who comes out on top? Project sits at priority 4 and user sits at priority 5, so the block holds. If curl is genuinely needed on your own machine, put the allow rule into .claude/settings.local.json instead. Local at priority 3 outranks project at priority 4, and the local allow then overrides the blocked rule.
Case 2: A managed file shoots down a project rule
Your team's settings.json in the project allows Bash(rm -rf *). IT then ships a managed file that blocks that same command. Managed is the winner. Always. Nothing in a user, local, or project file can reach above managed rules. The design is on purpose, and compliance is the reason.
Case 3: Trying something out locally
You want to pilot a new hook before offering it to the team. Put it in .claude/settings.local.json. It outranks the shared .claude/settings.json and stays on your machine only.
Case 4: Two scopes merging
Scopes do not wipe each other out wholesale. They stack. User config allowing Bash(git status) and project config allowing Bash(npm run lint) give you both rules active at once. The merge stitches permission arrays together. If the same key carries a different value at two scopes, the higher scope is the one that sticks for that single key.
Case 5: An env var exported from the shell and listed in settings.json
Export ANTHROPIC_MODEL from your shell and also list it in the env object of settings.json, and the shell export is the value Claude Code uses.
How Settings Plug Into the Rest of the System
CLAUDE.md files hold the instructions Claude loads at startup, plus the background it needs. A clean mental model: settings say what Claude is allowed to do, CLAUDE.md says what Claude should know.
MCP servers plug new tools into Claude. Their config lives in its own files (.mcp.json at project level, ~/.claude.json at user level). settings.json is the place that decides which of those servers are approved and which are blocked.
Hooks live inside settings.json under the hooks key. Each one runs a shell command, or sends an LLM prompt, when a lifecycle event fires.
Plugins also run through settings.json, via enabledPlugins and your marketplace list.
Subagents are plain Markdown files. User ones go in ~/.claude/agents/, project ones in .claude/agents/.
Backups and Recovery
Every time a config file changes, Claude Code writes a timestamped backup. The last five copies per file stick around. A bad update no longer means digging through git reflog. The previous working version sits next to the broken one.
Getting Started
New to Claude Code settings? Run through this short list in order.
- Permission rules at the project level. Block any read on
.envand other secret files. Allow the build or test commands you reach for every day - A PostToolUse hook that auto-formats on save. This one entry destroys approval fatigue faster than anything else
- Attribution settings if the Co-Authored-By line needs tweaking or hiding
- User defaults for the preferences you want active across every repo you touch
- A CLAUDE.md file carrying project context and your code conventions
Stop configuring. Start building.
Claude Code Sandboxing
Turn on OS-enforced boundaries around Claude's bash tool. Covers Seatbelt on macOS, bubblewrap on Linux and WSL2, plus network proxy config.
1M Context Window in Claude Code
Anthropic shipped the 1M token window on Opus 4.6 and Sonnet 4.6. Flat pricing, no beta header, fewer compactions.