Skip to content

Settings Best Practice

Last Updated: Apr 05, 2026 | Claude Code v2.1.92

A comprehensive guide to all available configuration options in Claude Code's settings.json files. As of v2.1.92, Claude Code exposes 60+ settings and 170+ environment variables (use the "env" field in settings.json to avoid wrapper scripts).

Settings Hierarchy

Settings apply in order of precedence (highest to lowest):

PriorityLocationScopeShared?Purpose
1Managed settingsOrganizationYes (deployed by IT)Security policies that cannot be overridden
2Command line argumentsSessionN/ATemporary single-session overrides
3.claude/settings.local.jsonProjectNo (git-ignored)Personal project-specific
4.claude/settings.jsonProjectYes (committed)Team-shared settings
5~/.claude/settings.jsonUserN/AGlobal personal defaults

Managed settings are organization-enforced and cannot be overridden by any other level, including command line arguments. Delivery methods:

  • Server-managed settings (remote delivery)
  • MDM profiles -- macOS plist at com.anthropic.claudecode
  • Registry policies -- Windows HKLM\SOFTWARE\Policies\ClaudeCode (admin) and HKCU\SOFTWARE\Policies\ClaudeCode (user-level, lowest policy priority)
  • File -- managed-settings.json and managed-mcp.json (macOS: /Library/Application Support/ClaudeCode/, Linux/WSL: /etc/claude-code/, Windows: C:\Program Files\ClaudeCode\)
  • Drop-in directory -- managed-settings.d/ alongside managed-settings.json for independent policy fragments (v2.1.83). Following the systemd convention, managed-settings.json is merged first as the base, then all *.json files in the drop-in directory are sorted alphabetically and merged on top. Later files override earlier ones for scalar values; arrays are concatenated and de-duplicated; objects are deep-merged. Hidden files starting with . are ignored. Use numeric prefixes to control merge order (e.g., 10-telemetry.json, 20-security.json)

Within the managed tier, precedence is: server-managed > MDM/OS-level policies > file-based (managed-settings.d/*.json + managed-settings.json) > HKCU registry (Windows only). Only one managed source is used; sources do not merge across tiers. Within the file-based tier, drop-in files and the base file are merged together.

WARNING

As of v2.1.75, the deprecated Windows fallback path C:\ProgramData\ClaudeCode\managed-settings.json has been removed. Use C:\Program Files\ClaudeCode\managed-settings.json instead.

Important

  • deny rules have highest safety precedence and cannot be overridden by lower-priority allow/ask rules.
  • Managed settings may lock or override local behavior even if local files specify different values.
  • Array settings (e.g., permissions.allow) are concatenated and deduplicated across scopes -- entries from all levels are combined, not replaced.

Core Configuration

General Settings

KeyTypeDefaultDescription
$schemastring-JSON Schema URL for IDE validation and autocompletion (e.g., "https://json.schemastore.org/claude-code-settings.json")
modelstring"default"Override default model. Accepts aliases (sonnet, opus, haiku) or full model IDs
agentstring-Set the default agent for the main conversation. Value is the agent name from .claude/agents/. Also available via --agent CLI flag
languagestring"english"Claude's preferred response language. Also sets the voice dictation language
cleanupPeriodDaysnumber30Sessions inactive for longer than this period are deleted at startup (minimum 1). Also controls the age cutoff for automatic removal of orphaned subagent worktrees at startup. Setting to 0 is rejected with a validation error. To disable transcript writes in non-interactive mode (-p), use --no-session-persistence or persistSession: false SDK option
autoUpdatesChannelstring"latest"Release channel: "stable" or "latest"
alwaysThinkingEnabledbooleanfalseEnable extended thinking by default for all sessions
skipWebFetchPreflightbooleanfalseSkip WebFetch blocklist check before fetching URLs (in JSON schema, not on official settings page)
availableModelsarray-Restrict which models users can select via /model, --model, Config tool, or ANTHROPIC_MODEL. Does not affect the Default option. Example: ["sonnet", "haiku"]
fastModePerSessionOptInbooleanfalseRequire users to opt in to fast mode each session
defaultShellstring"bash"Default shell for input-box ! commands. Accepts "bash" (default) or "powershell". Setting "powershell" routes interactive ! commands through PowerShell on Windows. Requires CLAUDE_CODE_USE_POWERSHELL_TOOL=1 (v2.1.84)
includeGitInstructionsbooleantrueInclude built-in commit and PR workflow instructions and the git status snapshot in Claude's system prompt. The CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS environment variable takes precedence over this setting when set
voiceEnabledboolean-Enable push-to-talk voice dictation. Written automatically when you run /voice. Requires a Claude.ai account
showClearContextOnPlanAcceptbooleanfalseShow the "clear context" option on the plan accept screen. Set to true to restore the option (hidden by default since v2.1.81)
disableDeepLinkRegistrationstring-Set to "disable" to prevent Claude Code from registering the claude-cli:// protocol handler with the operating system on startup. Deep links let external tools open a Claude Code session with a pre-filled prompt via claude-cli://open?q=.... The q parameter supports multi-line prompts using URL-encoded newlines (%0A). Useful in environments where protocol handler registration is restricted or managed separately
showThinkingSummariesbooleanfalseShow extended thinking summaries in interactive sessions. When unset or false (default in interactive mode), thinking blocks are redacted by the API and shown as a collapsed stub. Redaction only changes what you see, not what the model generates -- to reduce thinking spend, lower the budget or disable thinking instead. Non-interactive mode (-p) and SDK callers always receive summaries regardless of this setting
disableSkillShellExecutionbooleanfalseDisable inline shell execution for !`...` blocks in skills and custom commands. Commands are replaced with [shell command execution disabled by policy]. Bundled and managed skills are not affected (v2.1.91)
forceRemoteSettingsRefreshbooleanfalse(Managed only) Block CLI startup until remote managed settings are freshly fetched. If the fetch fails, the CLI exits (fail-closed). Use in enterprise environments where policy enforcement must be up-to-date before any session begins (v2.1.92)
feedbackSurveyRatenumber-Probability (0--1) that the session quality survey appears when eligible. Enterprise admins can control how often the survey is shown. Example: 0.05 = 5% of eligible sessions

Example:

json
{
  "model": "opus",
  "agent": "code-reviewer",
  "language": "japanese",
  "cleanupPeriodDays": 60,
  "autoUpdatesChannel": "stable",
  "alwaysThinkingEnabled": true
}

Plans & Memory Directories

Store plan and auto-memory files in custom locations.

KeyTypeDefaultDescription
plansDirectorystring~/.claude/plansDirectory where /plan outputs are stored
autoMemoryDirectorystring-Custom directory for auto-memory storage. Accepts ~/-expanded paths. Not accepted in project settings (.claude/settings.json) to prevent redirecting memory writes to sensitive locations; accepted from policy, local, and user settings

Example:

json
{
  "plansDirectory": "./my-plans"
}

Use Case

Useful for organizing planning artifacts separately from Claude's internal files, or for keeping plans in a shared team location.

Worktree Settings

Configure how --worktree creates and manages git worktrees. Useful for reducing disk usage and startup time in large monorepos.

KeyTypeDefaultDescription
worktree.symlinkDirectoriesarray[]Directories to symlink from the main repository into each worktree to avoid duplicating large directories on disk
worktree.sparsePathsarray[]Directories to check out in each worktree via git sparse-checkout (cone mode). Only the listed paths are written to disk

Example:

json
{
  "worktree": {
    "symlinkDirectories": ["node_modules", ".cache"],
    "sparsePaths": ["packages/my-app", "shared/utils"]
  }
}

Attribution Settings

Customize attribution messages for git commits and pull requests.

KeyTypeDefaultDescription
attribution.commitstringCo-authored-byGit commit attribution (supports trailers)
attribution.prstringGenerated messagePull request description attribution
includeCoAuthoredBybooleantrueDEPRECATED - Use attribution instead

Example:

json
{
  "attribution": {
    "commit": "Generated with AI\n\nCo-Authored-By: Claude <noreply@anthropic.com>",
    "pr": "Generated with Claude Code"
  }
}

INFO

Set to empty string ("") to hide attribution entirely.

Authentication Helpers

Scripts for dynamic authentication token generation.

KeyTypeDescription
apiKeyHelperstringShell script path that outputs auth token (sent as X-Api-Key header)
forceLoginMethodstringRestrict login to "claudeai" or "console" accounts
forceLoginOrgUUIDstring | arrayRequire login to belong to a specific organization. Accepts a single UUID string (which also pre-selects that organization during login) or an array of UUIDs where any listed organization is accepted without pre-selection. When set in managed settings, login fails if the authenticated account does not belong to a listed organization; an empty array fails closed and blocks login with a misconfiguration message

Example:

json
{
  "apiKeyHelper": "/bin/generate_temp_api_key.sh",
  "forceLoginMethod": "console",
  "forceLoginOrgUUID": [
    "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy"
  ]
}

Company Announcements

Display custom announcements to users at startup (cycled randomly).

KeyTypeDescription
companyAnnouncementsarrayArray of strings displayed at startup

Example:

json
{
  "companyAnnouncements": [
    "Welcome to Acme Corp!",
    "Remember to run tests before committing!",
    "Check the wiki for coding standards"
  ]
}

Permissions

Control what tools and operations Claude can perform.

Permission Structure

json
{
  "permissions": {
    "allow": [],
    "ask": [],
    "deny": [],
    "additionalDirectories": [],
    "defaultMode": "acceptEdits",
    "disableBypassPermissionsMode": "disable"
  }
}

Permission Keys

KeyTypeDescription
permissions.allowarrayRules allowing tool use without prompting
permissions.askarrayRules requiring user confirmation
permissions.denyarrayRules blocking tool use (highest precedence)
permissions.additionalDirectoriesarrayExtra directories Claude can access
permissions.defaultModestringDefault permission mode. In Remote environments, only acceptEdits and plan are honored (v2.1.70+)
permissions.disableBypassPermissionsModestringPrevent bypass mode activation
permissions.skipDangerousModePermissionPromptbooleanSkip the confirmation prompt shown before entering bypass permissions mode via --dangerously-skip-permissions or defaultMode: "bypassPermissions". Ignored when set in project settings (.claude/settings.json) to prevent untrusted repositories from auto-bypassing the prompt
allowManagedPermissionRulesOnlyboolean(Managed only) Only managed permission rules apply; user/project allow, ask, deny rules are ignored
allow_remote_sessionsboolean(Managed only) Allow users to start Remote Control and web sessions. Defaults to true. Set to false to prevent remote session access (not in official docs -- official permissions page states "Access to Remote Control and web sessions is not controlled by a managed settings key." On Team and Enterprise plans, admins enable/disable via Claude Code admin settings)
autoModeobjectCustomize what the auto mode classifier blocks and allows. Contains environment (trusted infrastructure descriptions), allow (exceptions to block rules), and soft_deny (block rules) -- all arrays of prose strings. Not read from shared project settings (.claude/settings.json) to prevent repo injection. Available in user, local, and managed settings. Setting allow or soft_deny replaces the entire default list for that section. Run claude auto-mode defaults to see built-in rules before customizing
disableAutoModestringSet to "disable" to prevent auto mode from being activated. Removes auto from the Shift+Tab cycle and rejects --permission-mode auto at startup. Can be set at any settings level; most useful in managed settings where users cannot override it
useAutoModeDuringPlanbooleanWhether plan mode uses auto mode semantics when auto mode is available. Default: true. Not read from shared project settings (.claude/settings.json). Appears in /config as "Use auto mode during plan"

Permission Modes

ModeBehavior
"default"Standard permission checking with prompts
"acceptEdits"Auto-accept file edits without asking
"askEdits"Ask before every operation (not in official docs -- unverified)
"dontAsk"Auto-denies tools unless pre-approved via /permissions or permissions.allow rules
"viewOnly"Read-only mode, no modifications (not in official docs -- unverified)
"bypassPermissions"Skip all permission checks (dangerous)
"auto"Background classifier replaces manual prompts (--enable-auto-mode). Research preview -- requires Team plan + Sonnet/Opus 4.6. Classifier auto-approves read-only and file edits; sends everything else through a safety check. Falls back to prompting after 3 consecutive or 20 total blocks. Configure with autoMode setting
"plan"Read-only exploration mode

Tool Permission Syntax

ToolSyntaxExamples
BashBash(command pattern)Bash(npm run *), Bash(* install), Bash(git * main)
ReadRead(path pattern)Read(.env), Read(./secrets/**)
EditEdit(path pattern)Edit(src/**), Edit(*.ts)
WriteWrite(path pattern)Write(*.md), Write(./docs/**)
NotebookEditNotebookEdit(pattern)NotebookEdit(*)
WebFetchWebFetch(domain:pattern)WebFetch(domain:example.com)
WebSearchWebSearchGlobal web search
TaskTask(agent-name)Task(Explore), Task(my-agent)
AgentAgent(name)Agent(researcher), Agent(*) -- permission scoped to subagent spawning
SkillSkill(skill-name)Skill(weather-fetcher)
MCPmcp__server__tool or MCP(server:tool)mcp__memory__*, MCP(github:*)

Evaluation order: Rules are evaluated in order: deny rules first, then ask, then allow. The first matching rule wins.

Read/Edit path patterns: Permission rules for Read, Edit, and Write support gitignore-style patterns with four prefix types:

PrefixMeaningExample
//Absolute path from filesystem rootRead(//Users/alice/file)
~/Relative to home directoryRead(~/.zshrc)
/Relative to project rootEdit(/src/**)
./ or noneRelative path (current directory)Read(.env), Read(*.ts)
Bash wildcard notes
  • * can appear at any position: prefix (Bash(* install)), suffix (Bash(npm *)), or middle (Bash(git * main))
  • Word boundary: Bash(ls *) (space before *) matches ls -la but NOT lsof; Bash(ls*) (no space) matches both
  • Bash(*) is treated as equivalent to Bash (matches all bash commands)
  • Permission rules support output redirections: Bash(python:*) matches python script.py > output.txt
  • The legacy :* suffix syntax (e.g., Bash(npm:*)) is equivalent to * but is deprecated

Example:

json
{
  "permissions": {
    "allow": [
      "Edit(*)",
      "Write(*)",
      "Bash(npm run *)",
      "Bash(git *)",
      "WebFetch(domain:*)",
      "mcp__*"
    ],
    "ask": [
      "Bash(rm *)",
      "Bash(git push *)"
    ],
    "deny": [
      "Read(.env)",
      "Read(./secrets/**)",
      "Bash(curl *)"
    ],
    "additionalDirectories": ["../shared-libs/"]
  }
}

Hooks

Hook configuration (events, properties, matchers, exit codes, environment variables, and HTTP hooks) is maintained in a dedicated repository:

Hook Reference

claude-code-hooks -- Complete hook reference with sound notification system, all 25 hook events, HTTP hooks, matcher patterns, exit codes, and environment variables.

Hook-related settings keys (hooks, disableAllHooks, allowManagedHooksOnly, allowedHttpHookUrls, httpHookAllowedEnvVars) are documented there.

For the official hooks reference, see the Claude Code Hooks Documentation.

MCP Servers

Configure Model Context Protocol servers for extended capabilities.

MCP Settings

KeyTypeScopeDescription
enableAllProjectMcpServersbooleanAnyAuto-approve all .mcp.json servers
enabledMcpjsonServersarrayAnyAllowlist specific server names
disabledMcpjsonServersarrayAnyBlocklist specific server names
allowedMcpServersarrayManaged onlyAllowlist with name/command/URL matching
deniedMcpServersarrayManaged onlyBlocklist with matching
allowManagedMcpServersOnlybooleanManaged onlyOnly allow MCP servers explicitly listed in managed allowlist
channelsEnabledbooleanManaged onlyAllow channels for Team and Enterprise users. When unset or false, channel message delivery is blocked regardless of --channels flag
allowedChannelPluginsarrayManaged onlyAllowlist of channel plugins that may push messages. Replaces the default Anthropic allowlist when set. Undefined = fall back to the default, empty array = block all channel plugins. Requires channelsEnabled: true. Each entry is an object with marketplace and plugin fields (v2.1.84)

MCP Server Matching (Managed Settings)

json
{
  "allowedMcpServers": [
    { "serverName": "github" },
    { "serverCommand": "npx @modelcontextprotocol/*" },
    { "serverUrl": "https://mcp.company.com/*" }
  ],
  "deniedMcpServers": [
    { "serverName": "dangerous-server" }
  ]
}

Example:

json
{
  "enableAllProjectMcpServers": true,
  "enabledMcpjsonServers": ["memory", "github", "filesystem"],
  "disabledMcpjsonServers": ["experimental-server"]
}

Sandbox

Configure bash command sandboxing for security.

Sandbox Settings

KeyTypeDefaultDescription
sandbox.enabledbooleanfalseEnable bash sandboxing
sandbox.failIfUnavailablebooleanfalseExit with error when sandbox is enabled but cannot start, instead of running unsandboxed. Useful for enterprise policies that require strict sandboxing (v2.1.83)
sandbox.autoAllowBashIfSandboxedbooleantrueAuto-approve bash when sandboxed
sandbox.excludedCommandsarray[]Commands to run outside sandbox
sandbox.allowUnsandboxedCommandsbooleantrueAllow dangerouslyDisableSandbox. When set to false, the escape hatch is completely disabled and all commands must run sandboxed (or be in excludedCommands). Useful for enterprise policies that require strict sandboxing
sandbox.ignoreViolationsobject{}Map of command patterns to path arrays -- suppress violation warnings (in JSON schema, not on official settings page)
sandbox.enableWeakerNestedSandboxbooleanfalseWeaker sandbox for Docker (reduces security)
sandbox.network.allowUnixSocketsarray[]Specific Unix socket paths accessible in sandbox
sandbox.network.allowAllUnixSocketsbooleanfalseAllow all Unix sockets (overrides allowUnixSockets)
sandbox.network.allowLocalBindingbooleanfalseAllow binding to localhost ports (macOS)
sandbox.network.allowedDomainsarray[]Network domain allowlist for sandbox
sandbox.network.deniedDomainsarray[]Network domain denylist for sandbox (not in official docs -- unverified)
sandbox.network.httpProxyPortnumber-HTTP proxy port 1-65535 (custom proxy)
sandbox.network.socksProxyPortnumber-SOCKS5 proxy port 1-65535 (custom proxy)
sandbox.network.allowManagedDomainsOnlybooleanfalseOnly allow domains in managed allowlist (managed settings)
sandbox.filesystem.allowWritearray[]Additional paths where sandboxed commands can write. Arrays are merged across all settings scopes. Also merged with paths from Edit(...) allow permission rules. Prefix: / (absolute), ~/ (home), ./ or none (project-relative in project settings, ~/.claude-relative in user settings). The older // prefix for absolute paths still works. Note: This differs from Read/Edit permission rules, which use // for absolute and / for project-relative
sandbox.filesystem.denyWritearray[]Paths where sandboxed commands cannot write. Arrays are merged across all settings scopes. Also merged with paths from Edit(...) deny permission rules. Same path prefix conventions as allowWrite
sandbox.filesystem.denyReadarray[]Paths where sandboxed commands cannot read. Arrays are merged across all settings scopes. Also merged with paths from Read(...) deny permission rules. Same path prefix conventions as allowWrite
sandbox.filesystem.allowReadarray[]Paths to re-allow read access within denyRead regions. Takes precedence over denyRead. Arrays are merged across all settings scopes. Same path prefix conventions as allowWrite
sandbox.filesystem.allowManagedReadPathsOnlybooleanfalse(Managed only) Only allowRead paths from managed settings are respected. allowRead entries from user, project, and local settings are ignored
sandbox.enableWeakerNetworkIsolationbooleanfalse(macOS only) Allow access to system TLS trust (com.apple.trustd.agent); reduces security

Example:

json
{
  "sandbox": {
    "enabled": true,
    "autoAllowBashIfSandboxed": true,
    "excludedCommands": ["git", "docker", "gh"],
    "allowUnsandboxedCommands": false,
    "network": {
      "allowUnixSockets": ["/var/run/docker.sock"],
      "allowLocalBinding": true
    }
  }
}

Plugins

Configure Claude Code plugins and marketplaces.

Plugin Settings

KeyTypeScopeDescription
enabledPluginsobjectAnyEnable/disable specific plugins
extraKnownMarketplacesobjectProjectAdd custom plugin marketplaces (team sharing via .claude/settings.json)
strictKnownMarketplacesarrayManaged onlyAllowlist of permitted marketplaces
skippedMarketplacesarrayAnyMarketplaces user declined to install (in JSON schema, not on official settings page)
skippedPluginsarrayAnyPlugins user declined to install (in JSON schema, not on official settings page)
pluginConfigsobjectAnyPer-plugin MCP server configs (keyed by plugin@marketplace) (in JSON schema, not on official settings page)
blockedMarketplacesarrayManaged onlyBlock specific plugin marketplaces
pluginTrustMessagestringManaged onlyCustom message displayed when prompting users to trust plugins

Marketplace source types

github, git, directory, hostPattern, settings, url, npm, file. Use source: 'settings' to declare a small set of plugins inline without setting up a hosted marketplace repository.

Example:

json
{
  "enabledPlugins": {
    "formatter@acme-tools": true,
    "deployer@acme-tools": true,
    "experimental@acme-tools": false
  },
  "extraKnownMarketplaces": {
    "acme-tools": {
      "source": {
        "source": "github",
        "repo": "acme-corp/claude-plugins"
      }
    },
    "inline-tools": {
      "source": {
        "source": "settings",
        "name": "inline-tools",
        "plugins": [
          {
            "name": "code-formatter",
            "source": { "source": "github", "repo": "acme-corp/code-formatter" }
          }
        ]
      }
    }
  }
}

Model Configuration

Model Aliases

AliasDescription
"default"Recommended for your account type
"sonnet"Latest Sonnet model (Claude Sonnet 4.6)
"opus"Latest Opus model (Claude Opus 4.6)
"haiku"Fast Haiku model
"sonnet[1m]"Sonnet with 1M token context
"opus[1m]"Opus with 1M token context (default on Max, Team, and Enterprise since v2.1.75)
"opusplan"Opus for planning, Sonnet for execution

Example:

json
{
  "model": "opus"
}

Model Overrides

Map Anthropic model IDs to provider-specific model IDs for Bedrock, Vertex, or Foundry deployments.

KeyTypeDefaultDescription
effortLevelstring-Persist the effort level across sessions. Accepts "low", "medium", or "high". Written automatically when you run /effort low, /effort medium, or /effort high. Supported on Opus 4.6 and Sonnet 4.6
modelOverridesobject-Map model picker entries to provider-specific IDs (e.g., Bedrock inference profile ARNs). Each key is a model picker entry name, each value is the provider model ID

Example:

json
{
  "modelOverrides": {
    "claude-opus-4-6": "arn:aws:bedrock:us-east-1:123456789:inference-profile/anthropic.claude-opus-4-6-v1:0",
    "claude-sonnet-4-6": "arn:aws:bedrock:us-east-1:123456789:inference-profile/anthropic.claude-sonnet-4-6-v1:0"
  }
}

Effort Level

The /model command exposes an effort level control that adjusts how much reasoning the model applies per response. Use the left/right arrow keys in the /model UI to cycle through effort levels.

Effort LevelDescription
HighFull reasoning depth, best for complex tasks
Medium (default)Balanced reasoning, good for everyday tasks
LowMinimal reasoning, fastest responses

How to use:

  1. Run /effort low, /effort medium, or /effort high to set directly (v2.1.76+)
  2. Or run /model then select a model and use left/right arrow keys to adjust
  3. The setting persists via the effortLevel key in settings.json

INFO

Effort level is available for Opus 4.6 and Sonnet 4.6 on Max and Team plans. The default was changed from High to Medium in v2.1.68. As of v2.1.75, 1M context window for Opus 4.6 is available by default on Max, Team, and Enterprise plans.

Model Environment Variables

Configure via the env key:

json
{
  "env": {
    "ANTHROPIC_MODEL": "sonnet",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "custom-haiku-model",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "custom-sonnet-model",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "custom-opus-model",
    "CLAUDE_CODE_SUBAGENT_MODEL": "haiku",
    "MAX_THINKING_TOKENS": "10000"
  }
}

Display & UX

Display Settings

KeyTypeDefaultDescription
statusLineobject-Custom status line configuration
outputStylestring"default"Output style (e.g., "Explanatory")
spinnerTipsEnabledbooleantrueShow tips while waiting
spinnerVerbsobject-Custom spinner verbs with mode ("append" or "replace") and verbs array
spinnerTipsOverrideobject-Custom spinner tips with tips (string array) and optional excludeDefault (boolean)
respectGitignorebooleantrueRespect .gitignore in file picker
prefersReducedMotionbooleanfalseReduce animations and motion effects in the UI
fileSuggestionobject-Custom file suggestion command (see File Suggestion Configuration below)

Global Config Settings (~/.claude.json)

These display preferences are stored in ~/.claude.json, not settings.json. Adding them to settings.json will trigger a schema validation error.

KeyTypeDefaultDescription
autoConnectIdebooleanfalseAutomatically connect to a running IDE when Claude Code starts from an external terminal. Appears in /config as Auto-connect to IDE (external terminal) when running outside a VS Code or JetBrains terminal
autoInstallIdeExtensionbooleantrueAutomatically install the Claude Code IDE extension when running from a VS Code terminal. Appears in /config as Auto-install IDE extension. Can also be disabled via CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL env var
editorModestring"normal"Key binding mode for the input prompt: "normal" or "vim". Written automatically when you run /vim. Appears in /config as Key binding mode
showTurnDurationbooleantrueShow turn duration messages after responses (e.g., "Cooked for 1m 6s"). Edit ~/.claude.json directly to change
terminalProgressBarEnabledbooleantrueShow the terminal progress bar in supported terminals (ConEmu, Ghostty 1.2.0+, and iTerm2 3.6.6+). Appears in /config as Terminal progress bar
teammateModestring"in-process"How agent team teammates display: "auto" (picks split panes in tmux or iTerm2, in-process otherwise), "in-process", or "tmux". See choose a display mode

Status Line Configuration

json
{
  "statusLine": {
    "type": "command",
    "command": "~/.claude/statusline.sh",
    "padding": 0
  }
}

Status Line Input Fields:

The status line command receives a JSON object on stdin with these notable fields:

FieldDescription
workspace.added_dirsDirectories added via /add-dir
context_window.used_percentageContext window usage percentage
context_window.remaining_percentageContext window remaining percentage
current_usageCurrent context window token count
exceeds_200k_tokensWhether context exceeds 200k tokens
rate_limits.five_hour.used_percentageFive-hour rate limit usage percentage (v2.1.80+)
rate_limits.five_hour.resets_atFive-hour rate limit reset timestamp
rate_limits.seven_day.used_percentageSeven-day rate limit usage percentage
rate_limits.seven_day.resets_atSeven-day rate limit reset timestamp

File Suggestion Configuration

The file suggestion script receives a JSON object on stdin (e.g., {"query": "src/comp"}) and must output up to 15 file paths (one per line).

json
{
  "fileSuggestion": {
    "type": "command",
    "command": "~/.claude/file-suggestion.sh"
  },
  "respectGitignore": true
}

Example:

json
{
  "statusLine": {
    "type": "command",
    "command": "git branch --show-current 2>/dev/null || echo 'no-branch'"
  },
  "spinnerTipsEnabled": true,
  "spinnerVerbs": {
    "mode": "replace",
    "verbs": ["Cooking", "Brewing", "Crafting", "Conjuring"]
  },
  "spinnerTipsOverride": {
    "tips": [
      "Use /compact at ~50% context",
      "Start with plan mode for complex tasks"
    ],
    "excludeDefault": true
  }
}

AWS & Cloud Credentials

AWS Settings

KeyTypeDescription
awsAuthRefreshstringScript to refresh AWS auth (modifies .aws dir)
awsCredentialExportstringScript outputting JSON with AWS credentials

Example:

json
{
  "awsAuthRefresh": "aws sso login --profile myprofile",
  "awsCredentialExport": "/bin/generate_aws_grant.sh"
}

OpenTelemetry

KeyTypeDescription
otelHeadersHelperstringScript to generate dynamic OpenTelemetry headers

Example:

json
{
  "otelHeadersHelper": "/bin/generate_otel_headers.sh"
}

Environment Variables (via env)

Set environment variables for all Claude Code sessions.

json
{
  "env": {
    "ANTHROPIC_API_KEY": "...",
    "NODE_ENV": "development",
    "DEBUG": "true"
  }
}

Common Environment Variables

VariableDescription
ANTHROPIC_API_KEYAPI key for authentication
ANTHROPIC_AUTH_TOKENOAuth token
CLAUDE_CODE_OAUTH_TOKENOAuth access token for Claude.ai authentication. Alternative to /login for SDK and automated environments. Takes precedence over keychain-stored credentials
CLAUDE_CODE_OAUTH_REFRESH_TOKENOAuth refresh token for Claude.ai authentication. When set, claude auth login exchanges this token directly instead of opening a browser. Requires CLAUDE_CODE_OAUTH_SCOPES
CLAUDE_CODE_OAUTH_SCOPESSpace-separated OAuth scopes the refresh token was issued with (e.g., "user:profile user:inference user:sessions:claude_code"). Required when CLAUDE_CODE_OAUTH_REFRESH_TOKEN is set
ANTHROPIC_BASE_URLCustom API endpoint
ANTHROPIC_BEDROCK_BASE_URLOverride Bedrock endpoint URL
ANTHROPIC_VERTEX_BASE_URLOverride Vertex AI endpoint URL
ANTHROPIC_BETASComma-separated Anthropic beta header values
ANTHROPIC_VERTEX_PROJECT_IDGCP project ID for Vertex AI
ANTHROPIC_CUSTOM_MODEL_OPTIONModel ID to add as a custom entry in the /model picker. Use to make a non-standard or gateway-specific model selectable without replacing built-in aliases
ANTHROPIC_CUSTOM_MODEL_OPTION_NAMEDisplay name for the custom model entry in the /model picker. Defaults to the model ID when not set
ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTIONDisplay description for the custom model entry in the /model picker. Defaults to Custom model (<model-id>) when not set
ANTHROPIC_MODELName of the model to use. Accepts aliases (sonnet, opus, haiku) or full model IDs. Overrides the model setting
ANTHROPIC_DEFAULT_HAIKU_MODELOverride the Haiku model alias with a custom model ID (e.g., for third-party deployments)
ANTHROPIC_DEFAULT_HAIKU_MODEL_NAMECustomize the Haiku entry label in the /model picker when using a pinned model on Bedrock/Vertex/Foundry. Defaults to the model ID
ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTIONCustomize the Haiku entry description in the /model picker. Defaults to Custom model (<model-id>)
ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIESOverride capability detection for a pinned Haiku model. Comma-separated values (e.g., effort,thinking). Required when the pinned model supports features the auto-detection cannot confirm
CLAUDECODESet to 1 in shell environments Claude Code spawns (Bash tool, tmux sessions). Not set in hooks or status line commands. Use to detect when a script is running inside a Claude Code shell
CLAUDE_CODE_SKIP_FAST_MODE_NETWORK_ERRORSSet to 1 to allow fast mode when the organization status check fails due to a network error. Useful when a corporate proxy blocks the status endpoint
CLAUDE_CODE_USE_BEDROCKUse AWS Bedrock (1 to enable)
CLAUDE_CODE_USE_VERTEXUse Google Vertex AI (1 to enable)
CLAUDE_CODE_USE_FOUNDRYUse Microsoft Foundry (1 to enable)
CLAUDE_CODE_USE_POWERSHELL_TOOLSet to 1 to enable the PowerShell tool on Windows (opt-in preview). When enabled, Claude can run PowerShell commands natively instead of routing through Git Bash. Only supported on native Windows, not WSL (v2.1.84)
CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIXPrefix for auto-generated Remote Control session names. Defaults to the machine hostname
CLAUDE_CODE_ENABLE_TELEMETRYEnable/disable telemetry (0 or 1)
DISABLE_ERROR_REPORTINGDisable error reporting (1 to disable)
DISABLE_TELEMETRYDisable telemetry (1 to disable)
MCP_TIMEOUTMCP startup timeout in ms
MAX_MCP_OUTPUT_TOKENSMax MCP output tokens (default: 25000). Warning displayed when output exceeds 10,000 tokens
API_TIMEOUT_MSTimeout in ms for API requests (default: 600000)
BASH_MAX_TIMEOUT_MSBash command timeout
BASH_MAX_OUTPUT_LENGTHMax bash output length
CLAUDE_AUTOCOMPACT_PCT_OVERRIDEAuto-compact threshold percentage (1-100). Default is ~95%. Set lower (e.g., 50) to trigger compaction earlier. Values above 95% have no effect. Use /context to monitor current usage. Example: CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=50 claude
CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIRKeep cwd between bash calls (1 to enable)
CLAUDE_CODE_DISABLE_BACKGROUND_TASKSDisable background tasks (1 to disable)
ENABLE_TOOL_SEARCHMCP tool search threshold (e.g., auto:5)
DISABLE_PROMPT_CACHINGDisable all prompt caching (1 to disable)
DISABLE_PROMPT_CACHING_HAIKUDisable Haiku prompt caching
DISABLE_PROMPT_CACHING_SONNETDisable Sonnet prompt caching
DISABLE_PROMPT_CACHING_OPUSDisable Opus prompt caching
ENABLE_PROMPT_CACHING_1H_BEDROCKRequest 1-hour cache TTL on Bedrock (1 to enable)
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETASDisable experimental beta features (1 to disable)
CLAUDE_CODE_SHELLOverride automatic shell detection
CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENSOverride default file read token limit
CLAUDE_CODE_GLOB_HIDDENInclude dotfiles in Glob results (1 to enable)
CLAUDE_CODE_GLOB_NO_IGNOREMake Glob ignore .gitignore patterns (1 to enable)
CLAUDE_CODE_GLOB_TIMEOUT_SECONDSTimeout in seconds for Glob file discovery
CLAUDE_CODE_ENABLE_TASKSSet to true to enable task tracking in non-interactive mode (-p flag). Tasks are on by default in interactive mode
CLAUDE_CODE_SIMPLESet to 1 to run with a minimal system prompt and only the Bash, file read, and file edit tools
CLAUDE_CODE_EXIT_AFTER_STOP_DELAYAuto-exit SDK mode after idle duration (ms)
CLAUDE_CODE_DISABLE_ADAPTIVE_THINKINGDisable adaptive thinking (1 to disable)
CLAUDE_CODE_DISABLE_THINKINGForce-disable extended thinking (1 to disable)
DISABLE_INTERLEAVED_THINKINGPrevent interleaved-thinking beta header from being sent (1 to disable)
CLAUDE_CODE_DISABLE_1M_CONTEXTDisable 1M token context window (1 to disable)
CLAUDE_CODE_ACCOUNT_UUIDOverride account UUID for authentication
CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONSDisable git-related system prompt instructions
CLAUDE_CODE_NEW_INITSet to true to make /init run an interactive setup flow. Asks which files to generate (CLAUDE.md, skills, hooks) before exploring the codebase. Without this, /init generates a CLAUDE.md automatically
CLAUDE_CODE_PLUGIN_SEED_DIRPath to one or more read-only plugin seed directories, separated by : on Unix or ; on Windows. Bundle pre-populated plugins into a container image. Claude Code registers marketplaces from these directories at startup and uses pre-cached plugins without re-cloning
ENABLE_CLAUDEAI_MCP_SERVERSEnable Claude.ai MCP servers
CLAUDE_CODE_EFFORT_LEVELSet effort level: low, medium, high, max (Opus 4.6 only), or auto (use model default). Takes precedence over /effort and the effortLevel setting
CLAUDE_CODE_MAX_TURNSMaximum agentic turns before stopping (not in official docs -- unverified)
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICEquivalent of setting DISABLE_AUTOUPDATER, DISABLE_FEEDBACK_COMMAND, DISABLE_ERROR_REPORTING, and DISABLE_TELEMETRY
CLAUDE_CODE_SKIP_SETTINGS_SETUPSkip first-run settings setup flow (not in official docs -- unverified)
CLAUDE_CODE_PROMPT_CACHING_ENABLEDOverride prompt caching behavior (not in official docs -- unverified)
CLAUDE_CODE_DISABLE_TOOLSComma-separated list of tools to disable (not in official docs -- unverified)
CLAUDE_CODE_DISABLE_MCPDisable all MCP servers (1 to disable) (not in official docs -- unverified)
CLAUDE_CODE_MAX_OUTPUT_TOKENSMax output tokens per response. Default: 32,000 (64,000 for Opus 4.6 as of v2.1.77). Upper bound: 64,000 (128,000 for Opus 4.6 and Sonnet 4.6 as of v2.1.77)
CLAUDE_CODE_DISABLE_FAST_MODEDisable fast mode entirely (1 to disable)
CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACKSet to 1 to disable the non-streaming fallback when a streaming request fails mid-stream. Streaming errors propagate to the retry layer instead. Useful when a proxy or gateway causes the fallback to produce duplicate tool execution (v2.1.83)
CLAUDE_ENABLE_STREAM_WATCHDOGAbort stalled streams (1 to enable)
CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMINGEnable fine-grained tool streaming (1 to enable)
CLAUDE_CODE_DISABLE_AUTO_MEMORYDisable auto memory (1 to disable)
CLAUDE_CODE_DISABLE_FILE_CHECKPOINTINGDisable file checkpointing for /rewind (1 to disable)
CLAUDE_CODE_DISABLE_ATTACHMENTSDisable attachment processing (1 to disable)
CLAUDE_CODE_DISABLE_CLAUDE_MDSPrevent loading CLAUDE.md files (1 to disable)
CLAUDE_CODE_RESUME_INTERRUPTED_TURNAuto-resume if previous session ended mid-turn (1 to enable)
CLAUDE_CODE_USER_EMAILProvide user email synchronously for authentication
CLAUDE_CODE_ORGANIZATION_UUIDProvide organization UUID synchronously for authentication
CLAUDE_CONFIG_DIRCustom config directory (overrides default ~/.claude)
CLAUDE_CODE_TMPDIROverride the temp directory used for internal temp files. Claude Code appends /claude/ to this path. Default: /tmp on Unix/macOS, os.tmpdir() on Windows
ANTHROPIC_CUSTOM_HEADERSCustom headers for API requests (Name: Value format, newline-separated for multiple headers)
ANTHROPIC_FOUNDRY_API_KEYAPI key for Microsoft Foundry authentication
ANTHROPIC_FOUNDRY_BASE_URLBase URL for Foundry resource
ANTHROPIC_FOUNDRY_RESOURCEFoundry resource name
AWS_BEARER_TOKEN_BEDROCKBedrock API key for authentication
ANTHROPIC_SMALL_FAST_MODELDEPRECATED -- Use ANTHROPIC_DEFAULT_HAIKU_MODEL instead
ANTHROPIC_SMALL_FAST_MODEL_AWS_REGIONAWS region for deprecated Haiku-class model override
CLAUDE_CODE_SHELL_PREFIXCommand prefix prepended to bash commands
BASH_DEFAULT_TIMEOUT_MSDefault bash command timeout in ms
CLAUDE_CODE_SKIP_BEDROCK_AUTHSkip AWS auth for Bedrock (1 to skip)
CLAUDE_CODE_SKIP_FOUNDRY_AUTHSkip Azure auth for Foundry (1 to skip)
CLAUDE_CODE_SKIP_VERTEX_AUTHSkip Google auth for Vertex (1 to skip)
CLAUDE_CODE_PROXY_RESOLVES_HOSTSAllow proxy to perform DNS resolution
CLAUDE_CODE_API_KEY_HELPER_TTL_MSCredential refresh interval in ms for apiKeyHelper
CLAUDE_CODE_CLIENT_CERTClient certificate path for mTLS
CLAUDE_CODE_CLIENT_KEYClient private key path for mTLS
CLAUDE_CODE_CLIENT_KEY_PASSPHRASEPassphrase for encrypted mTLS key
CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MSPlugin marketplace git clone timeout in ms (default: 120000)
CLAUDE_CODE_PLUGIN_CACHE_DIROverride the plugins root directory
CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALLSkip auto-adding the official marketplace (1 to disable)
CLAUDE_CODE_SYNC_PLUGIN_INSTALLWait for plugin install to complete before first query (1 to enable)
CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MSTimeout in ms for synchronous plugin install
CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURESet to 1 to keep the marketplace cache on disk when a git pull update fails, instead of deleting and re-cloning (in v2.1.90 changelog, not yet on official env-vars page)
CLAUDE_CODE_HIDE_ACCOUNT_INFOHide email/org info from UI (not in official docs -- unverified)
CLAUDE_CODE_DISABLE_CRONDisable scheduled/cron tasks (1 to disable)
DISABLE_INSTALLATION_CHECKSDisable installation warnings
DISABLE_FEEDBACK_COMMANDDisable the /feedback command. The older name DISABLE_BUG_COMMAND is also accepted
DISABLE_DOCTOR_COMMANDHide the /doctor command (1 to disable)
DISABLE_LOGIN_COMMANDHide the /login command (1 to disable)
DISABLE_LOGOUT_COMMANDHide the /logout command (1 to disable)
DISABLE_UPGRADE_COMMANDHide the /upgrade command (1 to disable)
DISABLE_EXTRA_USAGE_COMMANDHide the /extra-usage command (1 to disable)
DISABLE_INSTALL_GITHUB_APP_COMMANDHide the /install-github-app command (1 to disable)
DISABLE_NON_ESSENTIAL_MODEL_CALLSDisable flavor text and non-essential model calls (not in official docs -- unverified)
CLAUDE_CODE_DEBUG_LOGS_DIROverride debug log file directory path
CLAUDE_CODE_DEBUG_LOG_LEVELMinimum debug log level
CLAUDE_AUTO_BACKGROUND_TASKSForce auto-backgrounding of long tasks (1 to enable)
CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAPPrevent remapping Opus 4.0/4.1 to newer models (1 to disable)
FALLBACK_FOR_ALL_PRIMARY_MODELSTrigger fallback model for all primary models, not just default (1 to enable)
CLAUDE_CODE_GIT_BASH_PATHWindows Git Bash executable path (startup-only)
DISABLE_COST_WARNINGSDisable cost warning messages
CLAUDE_CODE_SUBAGENT_MODELOverride model for subagents (e.g., haiku, sonnet)
CLAUDE_CODE_SUBPROCESS_ENV_SCRUBSet to 1 to strip Anthropic and cloud provider credentials from subprocess environments (Bash tool, hooks, MCP stdio servers). Use for defense-in-depth when subprocesses should not inherit API keys (v2.1.83)
CLAUDE_CODE_MAX_RETRIESOverride API request retry count (default: 10)
CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCYMax parallel read-only tools (default: 10)
CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTSDisable built-in subagent types in SDK mode (1 to disable)
CLAUDE_AGENT_SDK_MCP_NO_PREFIXSkip mcp__<server>__ prefix for MCP tools in SDK mode (1 to enable)
MCP_CONNECTION_NONBLOCKINGSet to true in -p mode to skip the MCP connection wait entirely. Bounds --mcp-config server connections at 5s instead of blocking on the slowest server (in v2.1.89 changelog, not yet on official env-vars page)
CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MSSessionEnd hook timeout in ms (replaces hard 1.5s limit)
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEYDisable feedback survey prompts (1 to disable)
CLAUDE_CODE_DISABLE_TERMINAL_TITLEDisable terminal title updates (1 to disable)
CLAUDE_CODE_NO_FLICKERSet to 1 to enable flicker-free alt-screen rendering. Eliminates visual flicker during fullscreen redraws (v2.1.88)
CLAUDE_CODE_SCROLL_SPEEDMouse wheel scroll multiplier for fullscreen rendering. Increase for faster scrolling, decrease for finer control
CLAUDE_CODE_DISABLE_MOUSESet to 1 to disable mouse tracking in fullscreen rendering. Useful when mouse events interfere with terminal multiplexers or accessibility tools
CLAUDE_CODE_ACCESSIBILITYSet to 1 to keep native terminal cursor visible for screen readers and accessibility tools
CLAUDE_CODE_SYNTAX_HIGHLIGHTSet to 0 to disable syntax highlighting in diff output
CLAUDE_CODE_IDE_SKIP_AUTO_INSTALLSkip automatic IDE extension installation (1 to skip)
CLAUDE_CODE_AUTO_CONNECT_IDEOverride auto IDE connection behavior
CLAUDE_CODE_IDE_HOST_OVERRIDEOverride IDE host address for connection
CLAUDE_CODE_IDE_SKIP_VALID_CHECKSkip IDE lockfile validation (1 to skip)
CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MSDebounce interval in ms for OTel headers helper script
CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MSTimeout in ms for OpenTelemetry flush
CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MSTimeout in ms for OpenTelemetry shutdown
CLAUDE_STREAM_IDLE_TIMEOUT_MSTimeout in ms before the streaming idle watchdog closes a stalled connection. Default: 90000 (90 seconds). Increase if long-running tools or slow networks cause premature timeout errors
OTEL_LOG_TOOL_DETAILSSet to 1 to include tool_parameters in OpenTelemetry events. Omitted by default for privacy (in v2.1.85 changelog, not yet on official env-vars page)
CLAUDE_CODE_MCP_SERVER_NAMEName of the MCP server, passed as an environment variable to headersHelper scripts so they can generate server-specific authentication headers (in v2.1.85 changelog, not yet on official env-vars page)
CLAUDE_CODE_MCP_SERVER_URLURL of the MCP server, passed as an environment variable to headersHelper scripts alongside CLAUDE_CODE_MCP_SERVER_NAME (in v2.1.85 changelog, not yet on official env-vars page)
ANTHROPIC_DEFAULT_OPUS_MODELOverride Opus model alias (e.g., claude-opus-4-6[1m])
ANTHROPIC_DEFAULT_OPUS_MODEL_NAMECustomize the Opus entry label in the /model picker when using a pinned model on Bedrock/Vertex/Foundry. Defaults to the model ID
ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTIONCustomize the Opus entry description in the /model picker. Defaults to Custom model (<model-id>)
ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIESOverride capability detection for a pinned Opus model. Comma-separated values (e.g., effort,thinking). Required when the pinned model supports features the auto-detection cannot confirm
ANTHROPIC_DEFAULT_SONNET_MODELOverride Sonnet model alias (e.g., claude-sonnet-4-6)
ANTHROPIC_DEFAULT_SONNET_MODEL_NAMECustomize the Sonnet entry label in the /model picker when using a pinned model on Bedrock/Vertex/Foundry. Defaults to the model ID
ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTIONCustomize the Sonnet entry description in the /model picker. Defaults to Custom model (<model-id>)
ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIESOverride capability detection for a pinned Sonnet model. Comma-separated values (e.g., effort,thinking). Required when the pinned model supports features the auto-detection cannot confirm
MAX_THINKING_TOKENSMaximum extended thinking tokens per response
CLAUDE_CODE_AUTO_COMPACT_WINDOWSet the context capacity in tokens used for auto-compaction calculations. Defaults to the model's context window (200K standard, 1M for extended context models). Use a lower value (e.g., 500000) on a 1M model to treat it as 500K for compaction. Capped at actual context window. CLAUDE_AUTOCOMPACT_PCT_OVERRIDE is applied as a percentage of this value. Setting this decouples the compaction threshold from the status line's used_percentage
DISABLE_AUTO_COMPACTDisable automatic context compaction (1 to disable). Manual /compact still works
DISABLE_COMPACTDisable all compaction -- both automatic and manual (1 to disable)
CLAUDE_CODE_ENABLE_PROMPT_SUGGESTIONEnable prompt suggestions
CLAUDE_CODE_PLAN_MODE_REQUIREDRequire plan mode for sessions
CLAUDE_CODE_TEAM_NAMETeam name for agent teams
CLAUDE_CODE_TASK_LIST_IDTask list ID for task integration
CLAUDE_ENV_FILECustom environment file path
FORCE_AUTOUPDATE_PLUGINSForce plugin auto-updates (1 to enable)
HTTP_PROXYHTTP proxy URL for network requests
HTTPS_PROXYHTTPS proxy URL for network requests
NO_PROXYComma-separated list of hosts that bypass proxy
MCP_TOOL_TIMEOUTMCP tool execution timeout in ms
MCP_CLIENT_SECRETMCP OAuth client secret
MCP_OAUTH_CALLBACK_PORTMCP OAuth callback port
IS_DEMOEnable demo mode
SLASH_COMMAND_TOOL_CHAR_BUDGETCharacter budget for slash command tool output
VERTEX_REGION_CLAUDE_3_5_HAIKUVertex AI region override for Claude 3.5 Haiku
VERTEX_REGION_CLAUDE_3_7_SONNETVertex AI region override for Claude 3.7 Sonnet
VERTEX_REGION_CLAUDE_4_0_OPUSVertex AI region override for Claude 4.0 Opus
VERTEX_REGION_CLAUDE_4_0_SONNETVertex AI region override for Claude 4.0 Sonnet
VERTEX_REGION_CLAUDE_4_1_OPUSVertex AI region override for Claude 4.1 Opus

Useful Commands

CommandDescription
/modelSwitch models and adjust Opus 4.6 effort level
/effortSet effort level directly: low, medium, high (v2.1.76+)
/configInteractive configuration UI
/memoryView/edit all memory files
/agentsManage subagents
/mcpManage MCP servers
/hooksView configured hooks
/pluginManage plugins
/keybindingsConfigure custom keyboard shortcuts
/skillsView and manage skills
/permissionsView and manage permission rules
--doctorDiagnose configuration issues
--debugDebug mode with hook execution details

Quick Reference: Complete Example

json
{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "model": "sonnet",
  "agent": "code-reviewer",
  "language": "english",
  "cleanupPeriodDays": 30,
  "autoUpdatesChannel": "stable",
  "alwaysThinkingEnabled": true,
  "showThinkingSummaries": true,
  "includeGitInstructions": true,
  "defaultShell": "bash",
  "plansDirectory": "./plans",
  "effortLevel": "medium",

  "worktree": {
    "symlinkDirectories": ["node_modules"],
    "sparsePaths": ["packages/my-app", "shared/utils"]
  },

  "modelOverrides": {
    "claude-opus-4-6": "arn:aws:bedrock:us-east-1:123456789:inference-profile/anthropic.claude-opus-4-6-v1:0"
  },

  "autoMode": {
    "environment": [
      "Source control: github.example.com/acme-corp and all repos under it",
      "Trusted internal domains: *.internal.example.com"
    ]
  },

  "permissions": {
    "allow": [
      "Edit(*)",
      "Write(*)",
      "Bash(npm run *)",
      "Bash(git *)",
      "WebFetch(domain:*)",
      "mcp__*",
      "Agent(*)"
    ],
    "deny": [
      "Read(.env)",
      "Read(./secrets/**)"
    ],
    "additionalDirectories": ["../shared/"],
    "defaultMode": "acceptEdits"
  },

  "enableAllProjectMcpServers": true,

  "sandbox": {
    "enabled": true,
    "excludedCommands": ["git", "docker"],
    "filesystem": {
      "denyRead": ["./secrets/"],
      "denyWrite": ["./.env"]
    }
  },

  "attribution": {
    "commit": "Generated with Claude Code",
    "pr": ""
  },

  "statusLine": {
    "type": "command",
    "command": "git branch --show-current"
  },

  "spinnerTipsEnabled": true,
  "spinnerTipsOverride": {
    "tips": ["Custom tip 1", "Custom tip 2"],
    "excludeDefault": false
  },
  "prefersReducedMotion": false,

  "env": {
    "NODE_ENV": "development",
    "CLAUDE_CODE_EFFORT_LEVEL": "medium"
  }
}

Sources