settings.json files. As of February 2026, Claude Code exposes 38 settings and 84 environment variables (use the "env" field in settings.json to avoid wrapper scripts).
Settings Hierarchy
Claude Code settings use a 5-level user-writable override chain plus an enforced policy layer:Policy layer:
managed-settings.json is organization-enforced and cannot be overridden by local settings.Core Configuration
General Settings
string
default:"default"
Override default model. Accepts aliases (
sonnet, opus, haiku) or full model IDsstring
Set the default agent for the main conversation. Value is the agent name from
.claude/agents/. Also available via --agent CLI flagstring
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"boolean
default:false
Enable extended thinking by default for all sessions
boolean
default:false
Skip WebFetch blocklist check before fetching URLs
Plans Directory
Store plan files in a custom location relative to project root.string
default:".claude/plans/"
Directory where
/plan outputs are storedAttribution Settings
Customize attribution messages for git commits and pull requests.string
default:"Co-authored-by"
Git commit attribution (supports trailers)
string
Pull request description attribution
boolean
default:true
DEPRECATED - Use
attribution insteadSet to empty string (
"") to hide attribution entirely.Permissions
Control what tools and operations Claude can perform.Permission Structure
Permission Modes
Tool Permission Syntax
- Bash
- File Operations
- MCP
- Other Tools
Hooks
Execute custom shell commands at various points in Claude Code’s lifecycle.Hook Events (16 total)
SessionStart
SessionStart
When: New or resumed sessionMatcher Support: NoUse Cases: Load context, set environment
SessionEnd
SessionEnd
When: Session terminatesMatcher Support: NoUse Cases: Cleanup, logging
PreToolUse
PreToolUse
When: Before tool executionMatcher Support: YesUse Cases: Validate commands, modify inputs
PostToolUse
PostToolUse
When: After tool succeedsMatcher Support: YesUse Cases: Run linters, verify output
Stop
Stop
When: Claude finishes respondingMatcher Support: NoUse Cases: Block/continue decisions
SubagentStart
SubagentStart
When: Subagent spawnedMatcher Support: YesUse Cases: Per-agent setup
SubagentStop
SubagentStop
When: Subagent completesMatcher Support: YesUse Cases: Cleanup, validation
Hook Configuration Structure
Hook Exit Codes
MCP Servers
Configure Model Context Protocol servers for extended capabilities.boolean
Auto-approve all
.mcp.json serversarray
Allowlist specific server names
array
Blocklist specific server names
Sandbox
Configure bash command sandboxing for security.boolean
default:false
Enable bash sandboxing
boolean
default:true
Auto-approve bash when sandboxed
array
default:[]
Commands to run outside sandbox
array
default:[]
Specific Unix socket paths accessible in sandbox
boolean
default:false
Allow binding to localhost ports (macOS)
Model Configuration
Model Aliases
Effort Level (Opus 4.6)
When Opus 4.6 is selected, the/model command exposes an effort level control that adjusts how much reasoning the model applies per response.
Display & UX
Display Settings
object
Custom status line configuration
string
default:"default"
Output style (e.g.,
"Explanatory")boolean
default:true
Show tips while waiting
boolean
default:true
Show progress bar in terminal
boolean
default:true
Show turn duration messages
boolean
default:true
Respect .gitignore in file picker
Environment Variables (via env)
Set environment variables for all Claude Code sessions.
Common Environment Variables
Authentication
Authentication
ANTHROPIC_API_KEY— API key for authenticationANTHROPIC_AUTH_TOKEN— OAuth tokenANTHROPIC_BASE_URL— Custom API endpoint
Cloud Providers
Cloud Providers
CLAUDE_CODE_USE_BEDROCK— Use AWS Bedrock (1to enable)CLAUDE_CODE_USE_VERTEX— Use Google Vertex AI (1to enable)CLAUDE_CODE_USE_FOUNDRY— Use Microsoft Foundry (1to enable)
Context & Compaction
Context & Compaction
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE— Auto-compact threshold percentage (1-100). Default is ~95%. Set lower (e.g.,50) to trigger compaction earlierMAX_THINKING_TOKENS— Limit thinking token budget (set to0to disable)
MCP
MCP
MCP_TIMEOUT— MCP startup timeout in ms (default: 10000)MAX_MCP_OUTPUT_TOKENS— Max MCP output tokens (default: 50000)ENABLE_TOOL_SEARCH— MCP tool search threshold (e.g.,auto:5)
Useful Commands
/model
Switch models and adjust Opus 4.6 effort level
/config
Interactive configuration UI
/memory
View/edit all memory files
/agents
Manage subagents
/mcp
Manage MCP servers
/hooks
View configured hooks
/plugin
Manage plugins
/permissions
View and manage permission rules
--doctor
Diagnose configuration issues
Sources
Settings Documentation
Official Claude Code settings reference
Settings JSON Schema
Complete schema definition
Configuration Guide
ClaudeLog configuration guide
GitHub Examples
Community settings examples
