Build This Now
Build This Now
What Is Claude Code?Claude Code InstallationClaude Code Native InstallerYour First Claude Code Project
Claude Code ConfigurationClaude Code Terminal Setup GuideClaude Code SandboxingClaude Code Settings Reference
Get Build This Now
speedy_devvkoen_salo
Blog/Handbook/Setup/Claude Code Settings Reference

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)

PriorityScopeLocationWho It AffectsShared?
1ManagedSystem directoriesAll users on machineYes (IT-deployed)
2Command lineCLI flagsCurrent session onlyNo
3Local.claude/settings.local.jsonYou, this projectNo (gitignored)
4Project.claude/settings.jsonAll collaboratorsYes (in git)
5User~/.claude/settings.jsonYou, all projectsNo

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 --debug flag

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 SystemPath
macOS/Library/Application Support/ClaudeCode/
Linux / WSL/etc/claude-code/
WindowsC:\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:

FeatureUserProject (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.mdCLAUDE.md or .claude/CLAUDE.mdCLAUDE.local.md

Settings Reference

General Settings

KeyDescriptionDefaultExample
modelOverride the default model(system default)"claude-sonnet-4-5-20250929"
languageClaude's preferred response languageEnglish"japanese"
outputStyleAdjust system prompt style(none)"Explanatory"
cleanupPeriodDaysDays before inactive sessions are deleted3020
autoUpdatesChannelRelease channel: "stable" or "latest""latest""stable"
showTurnDurationShow response timing ("Cooked for 1m 6s")truefalse
spinnerVerbsCustomize spinner text(defaults){"mode": "append", "verbs": ["Pondering"]}
spinnerTipsEnabledShow tips while Claude workstruefalse
terminalProgressBarEnabledTerminal progress bar (iTerm2, Windows Terminal)truefalse
alwaysThinkingEnabledEnable extended thinking by defaultfalsetrue
plansDirectoryWhere plan files are stored~/.claude/plans"./plans"
respectGitignore@ file picker respects .gitignoretruefalse
companyAnnouncementsMessages shown at startup (random cycle)(none)["Review guidelines at docs.acme.com"]

Permission Settings

The keys below all nest inside the "permissions" object.

KeyDescriptionExample
allowRules to auto-allow tool use["Bash(npm run lint)", "Read(~/.zshrc)"]
askRules that require confirmation["Bash(git push *)"]
denyRules to block tool use entirely["WebFetch", "Bash(curl *)", "Read(./.env)"]
additionalDirectoriesExtra directories Claude can access["../docs/", "../shared/"]
defaultModeDefault permission mode at launch"acceptEdits"
disableBypassPermissionsModeBlock --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:

RuleWhat It Matches
BashAll 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.

KeyDescriptionDefaultExample
enabledEnable bash sandboxingfalsetrue
autoAllowBashIfSandboxedAuto-approve commands when sandboxedtruetrue
excludedCommandsCommands that run outside sandbox(none)["git", "docker"]
allowUnsandboxedCommandsAllow dangerouslyDisableSandbox escapetruefalse
enableWeakerNestedSandboxWeaker sandbox for Docker (Linux/WSL2)falsetrue
network.allowedDomainsOutbound domains whitelist(none)["github.com", "*.npmjs.org"]
network.allowUnixSocketsUnix socket paths accessible in sandbox(none)["~/.ssh/agent-socket"]
network.allowAllUnixSocketsAllow all Unix socket connectionsfalsetrue
network.allowLocalBindingAllow binding to localhost (macOS only)falsetrue
network.httpProxyPortCustom HTTP proxy port(auto)8080
network.socksProxyPortCustom SOCKS5 proxy port(auto)8081

Attribution Settings

The keys below nest inside the "attribution" object and decide how git attributes Claude's work.

KeyDescriptionDefault
commitText appended to git commit messages"Generated with Claude Code..." + Co-Authored-By trailer
prText 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

KeyDescriptionExample
enabledPluginsToggle plugins on/off{"formatter@acme-tools": true}
extraKnownMarketplacesAdditional plugin sourcesSee 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

KeyDescriptionExample
enableAllProjectMcpServersAuto-approve all project MCP serverstrue
enabledMcpjsonServersSpecific MCP servers to approve["memory", "github"]
disabledMcpjsonServersSpecific 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

KeyDescriptionExample
apiKeyHelperScript to generate auth value"/bin/generate_temp_api_key.sh"
forceLoginMethodRestrict to claudeai or console"claudeai"
forceLoginOrgUUIDAuto-select organization during login"xxxxxxxx-xxxx-..."
awsAuthRefreshScript to refresh AWS credentials"aws sso login --profile myprofile"
awsCredentialExportScript outputting AWS credential JSON"/bin/generate_aws_grant.sh"
otelHeadersHelperScript generating OpenTelemetry headers"/bin/generate_otel_headers.sh"

Hook and Advanced Settings

KeyDescriptionExample
hooksLifecycle event hook configurationSee hooks guide
disableAllHooksDisable all hookstrue
allowManagedHooksOnly(Managed only) Block user/project hookstrue
allowManagedPermissionRulesOnly(Managed only) Block user/project permission rulestrue
fileSuggestionCustom @ file autocomplete script{"type": "command", "command": "~/.claude/file-suggestion.sh"}
statusLineCustom status line display{"type": "command", "command": "~/.claude/statusline.sh"}
envEnvironment 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

VariablePurpose
ANTHROPIC_API_KEYAPI key for direct API access
ANTHROPIC_MODELOverride the default model
ANTHROPIC_DEFAULT_SONNET_MODELModel name for Sonnet alias
CLAUDE_CODE_SUBAGENT_MODELModel for subagents (separate from main model)
CLAUDE_CODE_USE_BEDROCKRoute through AWS Bedrock
CLAUDE_CODE_USE_VERTEXRoute 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

VariablePurpose
CLAUDE_CODE_MAX_OUTPUT_TOKENSMax output tokens (default: 32K, max: 64K)
MAX_THINKING_TOKENSExtended thinking budget (default: 31,999, set 0 to disable)
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE% of context capacity (1-100) triggering auto-compaction
BASH_DEFAULT_TIMEOUT_MSDefault bash command timeout
BASH_MAX_TIMEOUT_MSMaximum bash timeout Claude can set
BASH_MAX_OUTPUT_LENGTHMax bash output chars before truncation

Privacy and Telemetry

VariablePurpose
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICDisable updates, telemetry, error reporting all at once
DISABLE_TELEMETRYOpt out of Statsig telemetry
DISABLE_ERROR_REPORTINGOpt out of Sentry error reporting
CLAUDE_CODE_HIDE_ACCOUNT_INFOHide email and org name from UI
DISABLE_AUTOUPDATERDisable automatic version updates

Session Control

VariablePurpose
CLAUDE_CODE_TASK_LIST_IDShare a task list across multiple sessions
CLAUDE_CODE_ENABLE_TASKSSet false to revert to old TODO list
CLAUDE_CODE_SHELLOverride automatic shell detection
CLAUDE_CONFIG_DIRCustom config/data directory location
MCP_TIMEOUTTimeout in ms for MCP server startup
MCP_TOOL_TIMEOUTTimeout 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.

  1. Permission rules at the project level. Block any read on .env and other secret files. Allow the build or test commands you reach for every day
  2. A PostToolUse hook that auto-formats on save. This one entry destroys approval fatigue faster than anything else
  3. Attribution settings if the Co-Authored-By line needs tweaking or hiding
  4. User defaults for the preferences you want active across every repo you touch
  5. A CLAUDE.md file carrying project context and your code conventions

More in this guide

  • Agent Fundamentals
    Five ways to build specialized agents in Claude Code, from sub-agents to .claude/agents/ definitions to perspective prompts.
  • Agent Patterns
    Orchestrator, fan-out, validation chain, specialist routing, progressive refinement, and watchdog. Six ways to wire sub-agents in Claude Code.
  • Agent Teams Best Practices
    Battle-tested patterns for Claude Code agent teams. Troubleshooting, limitations, plan mode quirks, and fixes shipped from v2.1.33 through v2.1.45.
  • Agent Teams Controls
    Stop your agent team lead from grabbing implementation work. Configure delegate mode, plan approval, hooks, and CLAUDE.md for teams.
  • Agent Teams Prompt Templates
    Ten tested Agent Teams prompts for Claude Code. Code review, debugging, feature builds, architecture calls, and campaign research. Paste and go.

Stop configuring. Start building.

SaaS builder templates with AI orchestration.

Get Build This Now

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.

On this page

The Five-Scope Precedence Chain
Scope Precedence (Highest to Lowest)
Picking the Right Scope
Managed Settings Paths by OS
Settings Reference
General Settings
Permission Settings
Sandbox Settings
Attribution Settings
Plugin Settings
MCP Server Settings
Authentication and Provider Settings
Hook and Advanced Settings
Environment Variables
Model and Provider
Performance Tuning
Privacy and Telemetry
Session Control
Working Out Config Conflicts
How Settings Plug Into the Rest of the System
Backups and Recovery
Getting Started

Stop configuring. Start building.

SaaS builder templates with AI orchestration.

Get Build This Now