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:Project local settings
Location:
.claude/settings.local.jsonScope: Project-specific personal overridesVersion control: Git-ignoredProject settings
Location:
.claude/settings.jsonScope: Team-shared project settingsVersion control: Committed to gitUser local settings
Location:
~/.claude/settings.local.jsonScope: Personal overrides for all projects- Location:
managed-settings.json(organization-controlled) - Purpose: Security policies, compliance requirements
- Precedence: Highest — overrides all user settings
Core Settings
General Configuration
Default model for sessions.Accepted values:
sonnet, opus, haiku, default, or full model IDsDefault agent for the main conversation. Value is the agent name from
.claude/agents/.Claude’s preferred response language.
Sessions inactive longer than this are deleted at startup.
Release channel:
"stable" or "latest".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
| Tool | Syntax | Example |
|---|---|---|
| Bash | Bash(pattern) | Bash(npm run *), Bash(* install) |
| Read | Read(path) | Read(.env), Read(./secrets/**) |
| Edit | Edit(path) | Edit(src/**), Edit(*.ts) |
| Write | Write(path) | Write(*.md) |
| WebFetch | WebFetch(domain:pattern) | WebFetch(domain:example.com) |
| Task | Task(agent) | Task(Explore), Task(my-agent) |
| MCP | mcp__server__tool | mcp__memory__* |
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
