Skip to main content

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 env key)
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-ignored
3

Project settings

Location: .claude/settings.jsonScope: Team-shared project settingsVersion control: Committed to git
4

User local settings

Location: ~/.claude/settings.local.jsonScope: Personal overrides for all projects
5

User settings (lowest)

Location: ~/.claude/settings.jsonScope: Global personal defaults
Policy layer (enforced, cannot be overridden):
  • Location: managed-settings.json (organization-controlled)
  • Purpose: Security policies, compliance requirements
  • Precedence: Highest — overrides all user settings
Permission precedence: deny rules always win, regardless of lower-priority allow rules.

Core Settings

General Configuration

string
default:"default"
Default model for sessions.Accepted values: sonnet, opus, haiku, default, or full model IDs
string
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:
Permission modes:
  • default — Standard permission checking
  • acceptEdits — Auto-accept file edits
  • askEdits — Ask before every operation
  • viewOnly — Read-only mode
  • bypassPermissions — Skip all checks (dangerous)
  • plan — Read-only exploration
Tool syntax:
Bash wildcards can appear at any position: Bash(* install), Bash(npm *), Bash(git * main)

Hooks

Execute scripts at lifecycle events:
18 hook events: PreToolUse, PostToolUse, PostToolUseFailure, PermissionRequest, UserPromptSubmit, Notification, Stop, SubagentStart, SubagentStop, PreCompact, SessionStart, SessionEnd, Setup, TeammateIdle, TaskCompleted, ConfigChange, WorktreeCreate, WorktreeRemove

Hooks Concept

Complete guide to hooks with examples

MCP Servers

  • enableAllProjectMcpServers: Auto-approve all .mcp.json servers
  • enabledMcpjsonServers: Allowlist specific servers
  • disabledMcpjsonServers: Blocklist specific servers

MCP Servers Concept

Learn about MCP server configuration and best servers to use

Display & UX

Status line: Custom status bar showing context usage, model, cost, session info Output styles: default, Explanatory (verbose), Concise

Sandbox

Bash command isolation:

Attribution

Customize git commit and PR attribution:
Set to "" to hide attribution.

Environment Variables

Set via env key to avoid wrapper scripts:
Common variables:
  • CLAUDE_AUTOCOMPACT_PCT_OVERRIDE: Auto-compact threshold (1-100, default ~95)
  • CLAUDE_CODE_ENABLE_TELEMETRY: Enable/disable telemetry
  • MCP_TIMEOUT: MCP startup timeout (ms)
  • BASH_MAX_TIMEOUT_MS: Bash command timeout

Real Example from Repository

From .claude/settings.json:

Best Practices

Never commit personal preferences to .claude/settings.json:
Don’t use "allow": ["Bash"] — be specific:
Prevent accidental leaks:
Speed up testing:
Never commit API keys:

Configuration Commands

Opens interactive settings UI with search functionality.

Complete Example

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

Further Reading