Settings hierarchy
Settings are loaded from five sources, in order of increasing precedence:
Later sources override earlier ones.
policySettings and flagSettings are always included regardless of the --setting-sources flag.
policySettings (managed settings) always take precedence and cannot be overridden by users. Enterprise administrators use this to enforce organization-wide policy.Settings file format
Settings files are JSON. You can add the JSON Schema reference for editor autocompletion:settings.json
The claude config command
Run /config inside a Claude Code session to open the interactive settings UI. This opens the Config tab of the settings panel where you can view and edit all settings interactively.
Key settings
model
model
Override the default model used by Claude Code.
permissions
permissions
Configure tool permission rules. See the Permissions page for full details.Sub-fields:
allow— permission rules for automatically allowed operationsdeny— permission rules for automatically denied operationsask— permission rules that always prompt for confirmationdefaultMode— default permission mode (default,acceptEdits,bypassPermissions,dontAsk,plan)disableBypassPermissionsMode— set to"disable"to prevent bypass modeadditionalDirectories— additional directories to include in the permission scope
env
env
Environment variables to inject into every Claude Code session.
hooks
hooks
Custom shell commands to run before or after tool executions. See the hooks documentation for the full schema.
cleanupPeriodDays
cleanupPeriodDays
Number of days to retain chat transcripts. Defaults to 30. Setting to
0 disables session persistence entirely — no transcripts are written and existing ones are deleted at startup.attribution
attribution
Customize attribution text for commits and PRs.Set either field to an empty string to hide attribution for that context.
includeGitInstructions
includeGitInstructions
Include built-in commit and PR workflow instructions in Claude’s system prompt. Defaults to
true.language
language
Preferred language for Claude responses and voice dictation, e.g.
"japanese" or "spanish".outputStyle
outputStyle
Controls the output style for assistant responses.
defaultShell
defaultShell
Default shell for input-box
! commands. Accepts "bash" or "powershell". Defaults to "bash" on all platforms.syntaxHighlightingDisabled
syntaxHighlightingDisabled
Set to
true to disable syntax highlighting in diffs.alwaysThinkingEnabled
alwaysThinkingEnabled
When
false, extended thinking is disabled. When absent or true, thinking is enabled automatically for supported models.effortLevel
effortLevel
Persisted effort level for supported models. Accepts
"low", "medium", or "high".respectGitignore
respectGitignore
Whether the file picker respects
.gitignore files. Defaults to true. Note that .ignore files are always respected regardless of this setting.apiKeyHelper
apiKeyHelper
Path to a script that outputs authentication values for the Claude API.
disableAllHooks
disableAllHooks
When
true, disables all hooks and statusLine execution.sandbox
sandbox
Sandbox runtime configuration. See Permissions — Sandbox mode for details.
worktree
worktree
Git worktree configuration for the
--worktree flag.symlinkDirectories— directories to symlink from the main repository into worktrees to avoid disk bloat.sparsePaths— directories to include when creating worktrees viagit sparse-checkout(cone mode).
The --settings flag
Pass settings at launch time without editing a file. You can provide either a path to a JSON file or an inline JSON string.
--settings are loaded as flagSettings and override user, project, and local settings, but are overridden by policy settings.
The --setting-sources flag
By default, Claude Code loads user, project, and local settings. Use --setting-sources to restrict which file-based sources are loaded. policySettings and flagSettings are always included.
user, project, local.
Environment variable overrides
Some behaviors can be controlled through environment variables. Variables relevant to settings:MDM / managed settings
Enterprise administrators can deploy settings through two mechanisms:1
Base file
Place a
managed-settings.json file in the platform-specific managed path. This file provides organization-wide defaults.2
Drop-in directory
Place additional
.json files in the managed-settings.d/ drop-in directory. Files are merged in alphabetical order. Later files take precedence, following the systemd/sudoers convention — separate teams can ship independent policy fragments (e.g. 10-otel.json, 20-security.json) without coordinating edits to a single file.policySettings. Managed settings always take final precedence over all user-editable sources.