Skip to main content
Claude Code reads configuration from settings.json files at two levels: a global user file and a project-local file. Settings cascade from global → project → local, with CLI flags taking highest precedence.

File locations

ScopePathPurpose
Global (user)~/.claude/settings.jsonApplies to all projects
Project.claude/settings.jsonCommitted to the repo; shared with team
Local.claude/settings.local.jsonMachine-local overrides; gitignore this
Managed (enterprise)Injected by MDM/policyHighest-trust; set by admins
Project settings (.claude/settings.json) are committed to source control and shared with your team. Use .claude/settings.local.json for personal or machine-specific overrides that should not be committed.

Precedence order

CLI flags > Local settings > Project settings > User settings > Managed/policy settings
When a field appears in multiple files, the higher-precedence value wins. Arrays (such as permission rules) merge across sources rather than override.

Settings schema

The full schema is defined in src/utils/settings/types.ts. All fields are optional.

Permissions

"permissions": {
  "allow": ["Bash(git *)", "Read(*.ts)"],
  "deny": ["Bash(rm -rf *)"],
  "ask": ["Write(*)"],
  "defaultMode": "default",
  "disableBypassPermissionsMode": "disable",
  "additionalDirectories": ["/mnt/shared"]
}
FieldTypeDescription
permissions.allowstring[]Permission rules auto-approved without prompting
permissions.denystring[]Permission rules always rejected
permissions.askstring[]Permission rules that always prompt for confirmation
permissions.defaultModestringDefault permission mode when access is needed
permissions.disableBypassPermissionsMode"disable"Prevent bypassing permission prompts
permissions.additionalDirectoriesstring[]Extra directories included in the permission scope

Model

FieldTypeDescription
modelstringOverride the default model (e.g. "claude-sonnet-4-6")
availableModelsstring[]Enterprise allowlist of selectable models
modelOverridesRecord<string, string>Map Anthropic model IDs to provider-specific IDs (Bedrock ARNs, etc.)
advisorModelstringModel used for the server-side advisor tool

Hooks

"hooks": {
  "PreToolUse": [
    {
      "matcher": "Bash",
      "hooks": [{ "type": "command", "command": "echo 'about to run bash'" }]
    }
  ]
}
See Hooks for the full hooks reference.

MCP servers

FieldTypeDescription
enableAllProjectMcpServersbooleanAuto-approve all MCP servers from .mcp.json
enabledMcpjsonServersstring[]Approved server names from .mcp.json
disabledMcpjsonServersstring[]Rejected server names from .mcp.json
allowedMcpServersobject[]Enterprise allowlist — entries match by serverName, serverCommand, or serverUrl
deniedMcpServersobject[]Enterprise denylist — takes precedence over the allowlist

Memory

FieldTypeDescription
autoMemoryEnabledbooleanEnable or disable auto-memory for this project
autoMemoryDirectorystringCustom path for auto-memory storage; supports ~/ prefix
autoDreamEnabledbooleanEnable background memory consolidation
claudeMdExcludesstring[]Glob patterns for CLAUDE.md files to skip loading

Session and display

FieldTypeDescription
cleanupPeriodDaysnumberDays to retain chat transcripts (default: 30; 0 disables persistence)
languagestringPreferred language for responses and voice dictation
outputStylestringControls output style for assistant responses
defaultShell"bash" | "powershell"Shell used for ! input-box commands
syntaxHighlightingDisabledbooleanDisable syntax highlighting in diffs
prefersReducedMotionbooleanReduce animations for accessibility
spinnerTipsEnabledbooleanShow tips in the spinner

Authentication helpers

FieldTypeDescription
apiKeyHelperstringPath to script that outputs authentication values
awsCredentialExportstringPath to script that exports AWS credentials
awsAuthRefreshstringPath to script that refreshes AWS authentication
gcpAuthRefreshstringCommand to refresh GCP authentication
otelHeadersHelperstringPath to script that outputs OpenTelemetry headers

Worktrees

"worktree": {
  "symlinkDirectories": ["node_modules", ".cache"],
  "sparsePaths": ["src/", "packages/core/"]
}
FieldTypeDescription
worktree.symlinkDirectoriesstring[]Directories to symlink from the main repo into worktrees
worktree.sparsePathsstring[]Directories for git sparse-checkout when creating worktrees

Attribution

"attribution": {
  "commit": "Co-authored-by: Claude <noreply@anthropic.com>",
  "pr": ""
}
FieldTypeDescription
attribution.commitstringAttribution trailer for git commits; empty string hides it
attribution.prstringAttribution text for pull request descriptions; empty string hides it
includeGitInstructionsbooleanInclude built-in commit/PR workflow instructions in the system prompt (default: true)

Enterprise controls

FieldTypeDescription
allowManagedHooksOnlybooleanOnly hooks from managed settings run; user/project/local hooks are ignored
allowManagedPermissionRulesOnlybooleanOnly permission rules from managed settings are respected
allowManagedMcpServersOnlybooleanOnly the admin-defined MCP allowlist applies
strictPluginOnlyCustomizationboolean | string[]Restrict customization surfaces to plugins only
forceLoginMethod"claudeai" | "console"Force a specific login method
forceLoginOrgUUIDstringOrganization UUID for OAuth login
allowedHttpHookUrlsstring[]Allowlist of URL patterns HTTP hooks may target
disableAllHooksbooleanDisable all hooks and status line execution

Example settings.json

{
  "$schema": "https://claude.ai/schema/settings.json",
  "model": "claude-sonnet-4-6",
  "permissions": {
    "allow": [
      "Bash(git *)",
      "Bash(npm run *)",
      "Read(**/*.ts)"
    ],
    "deny": [
      "Bash(rm -rf *)"
    ],
    "additionalDirectories": ["/mnt/shared/data"]
  },
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "logger -t claude \"PreToolUse: Bash\""
          }
        ]
      }
    ]
  },
  "cleanupPeriodDays": 14,
  "language": "english",
  "attribution": {
    "commit": "Co-authored-by: Claude <noreply@anthropic.com>"
  },
  "worktree": {
    "symlinkDirectories": ["node_modules"]
  }
}

/config slash command

Run /config inside Claude Code to open the interactive settings editor. It provides a UI for viewing and modifying your current settings without editing JSON directly. The editor shows which settings file each value comes from (User, Project, or Local) and lets you add permission rules and toggle options interactively.

Build docs developers (and LLMs) love