What Are Settings?
Claude Code’s settings system controls:- Permissions (allow/ask/deny rules for tools)
- Hooks (lifecycle event handlers)
- MCP servers (external integrations)
- Models (default model selection)
- Display (status line, spinner, output style)
- Sandbox (bash command isolation)
- Environment variables (via
envkey)
Settings are configured in
settings.json files with a hierarchical override system.Why Settings Matter
Settings enable:- Team collaboration: Share project settings via git
- Personal customization: Override team settings locally
- Security: Control tool access with granular permissions
- Automation: Configure hooks for notifications and validation
- Consistency: Standardize model, permissions, and behavior across projects
Settings Hierarchy
Claude Code uses a 5-level user-writable override chain:1
Command line arguments (highest)
Scope: Single sessionExample:
2
Project local settings
Location:
.claude/settings.local.jsonScope: Project-specific personal overridesVersion control: Git-ignored3
Project settings
Location:
.claude/settings.jsonScope: Team-shared project settingsVersion control: Committed to git4
User local settings
Location:
~/.claude/settings.local.jsonScope: Personal overrides for all projects5
User settings (lowest)
Location:
~/.claude/settings.jsonScope: Global personal defaults- Location:
managed-settings.json(organization-controlled) - Purpose: Security policies, compliance requirements
- Precedence: Highest — overrides all user settings
Core Settings
General Configuration
string
default:"default"
Default model for sessions.Accepted values:
sonnet, opus, haiku, default, or full model IDsstring
Default agent for the main conversation. Value is the agent name from
.claude/agents/.string
default:"english"
Claude’s preferred response language.
number
default:"30"
Sessions inactive longer than this are deleted at startup.
string
default:"latest"
Release channel:
"stable" or "latest".string
default:".claude/plans/"
Directory where
/plan outputs are stored.Permissions
Control what tools Claude can use:default— Standard permission checkingacceptEdits— Auto-accept file editsaskEdits— Ask before every operationviewOnly— Read-only modebypassPermissions— Skip all checks (dangerous)plan— Read-only exploration
Hooks
Execute scripts at lifecycle events:Hooks Concept
Complete guide to hooks with examples
MCP Servers
enableAllProjectMcpServers: Auto-approve all.mcp.jsonserversenabledMcpjsonServers: Allowlist specific serversdisabledMcpjsonServers: Blocklist specific servers
MCP Servers Concept
Learn about MCP server configuration and best servers to use
Display & UX
default, Explanatory (verbose), Concise
Sandbox
Bash command isolation:Attribution
Customize git commit and PR attribution:"" to hide attribution.
Environment Variables
Set viaenv key to avoid wrapper scripts:
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE: Auto-compact threshold (1-100, default ~95)CLAUDE_CODE_ENABLE_TELEMETRY: Enable/disable telemetryMCP_TIMEOUT: MCP startup timeout (ms)BASH_MAX_TIMEOUT_MS: Bash command timeout
Real Example from Repository
From.claude/settings.json:
Best Practices
Use .local.json for personal overrides
Use .local.json for personal overrides
Never commit personal preferences to
.claude/settings.json:Set granular permissions
Set granular permissions
Don’t use
"allow": ["Bash"] — be specific:Use deny for sensitive files
Use deny for sensitive files
Prevent accidental leaks:
Disable hooks during development
Disable hooks during development
Speed up testing:
Use environment variables for secrets
Use environment variables for secrets
Never commit API keys:
Configuration Commands
- Interactive Config
- Permissions
- Hooks
- MCP
- Status Line
Complete Example
Cross-Links
Hooks
Configure lifecycle event handlers
MCP Servers
Enable external integrations
Settings Best Practice
Complete settings reference with all 38 settings
Global vs Project Settings
Which features are global-only vs dual-scope
