Claude Code Settings Quick Reference
cleanupPeriodDays
The cleanupPeriodDays setting tells claude code how many days to retain a local copy of session transcripts. Default is 30 days.
env
The env setting is a JSON object with environment variable name / value pairs. Here are some of the most useful environment variables:
| Environment Variable |
Purpose |
ANTHROPIC_MODEL |
Name of custom model to use |
ANTHROPIC_SMALL_FAST_MODEL |
Name of Haiku-class model for background tasks |
BASH_DEFAULT_TIMEOUT_MS |
Default timeout for long-running bash commands |
BASH_MAX_TIMEOUT_MS |
Maximum timeout the model can set for long-running bash commands |
BASH_MAX_OUTPUT_LENGTH |
Maximum number of characters in bash outputs before they are middle-truncated |
CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR |
Return to the original working directory after each Bash command |
CLAUDE_CODE_API_KEY_HELPER_TTL_MS |
Interval in milliseconds at which credentials should be refreshed (when using apiKeyHelper) |
CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL |
Skip auto-installation of IDE extensions |
CLAUDE_CODE_MAX_OUTPUT_TOKENS |
Set the maximum number of output tokens for most requests |
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC |
Equivalent of setting DISABLE_AUTOUPDATER, DISABLE_BUG_COMMAND,
DISABLE_ERROR_REPORTING, and DISABLE_TELEMETRY |
CLAUDE_CODE_DISABLE_TERMINAL_TITLE |
Set to 1 to disable automatic terminal title updates based on conversation context |
DISABLE_AUTOUPDATER |
Set to 1 to disable automatic updates. This takes precedence over the autoUpdates
configuration setting. |
DISABLE_BUG_COMMAND |
Set to 1 to disable the /bug command |
DISABLE_COST_WARNINGS |
Set to 1 to disable cost warning messages |
DISABLE_ERROR_REPORTING |
Set to 1 to opt out of Sentry error reporting |
DISABLE_NON_ESSENTIAL_MODEL_CALLS |
Set to 1 to disable model calls for non-critical paths like flavor text. Flavor text may include generating transitional text like "Great, now lets...". Ideally this setting would reduce the total number of tokens used to accomplish the task. |
DISABLE_TELEMETRY |
Set to 1 to opt out of Statsig telemetry (note that Statsig events do not include user data like
code, file paths, or bash commands) |
HTTP_PROXY |
Specify HTTP proxy server for network connections |
HTTPS_PROXY |
Specify HTTPS proxy server for network connections |
MAX_THINKING_TOKENS |
Force a thinking for the model budget |
MCP_TIMEOUT |
Timeout in milliseconds for MCP server startup |
MCP_TOOL_TIMEOUT |
Timeout in milliseconds for MCP tool execution |
MAX_MCP_OUTPUT_TOKENS |
Maximum number of tokens allowed in MCP tool responses (default: 25000) |
USE_BUILTIN_RIPGREP |
Set to 0 to use system-installed rg instead of the version included with Claude
Code |
See the full list of supported environment variables
permissions
The permissions JSON object is primarily used for the deny, allow, and ask arrays. These three arrays hold the name of a Tool, some tools support additional syntax Tool(pattern). See the claude code tools reference below for details.
Beyond the deny, allow, and ask permission arrays the permissions object also holds additional settings such as: additionalDirectories, defaultMode, and disableBypassPermissionsMode
permissions.additionalDirectories
The additionalDirectories array inside the permissions object can be used as an allow-list for additional directories which claude code my use as part of its context.
Be sure that you are ok with the content any of these directories being added to the session context before configuring this.
permissions.defaultMode
The defaultMode string inside the permissions object it supports four possible values:
default - prompts for permission on first use of each tool (the default, as you might guess :-)
acceptEdits - Automatically accepts file edit for the session, does not prompt you first.
plan - Plan mode - Claude Code can analyze files, but cannot modify files or execute commands
bypassPermissions - automatically accepts all permission prompts. This can be very dangerous and can lead to data loss.
permissions.disableBypassPermissionsMode
The disableBypassPermissionsMode string inside the permissions object when set to "disable" prevents the dangerous bypassPermissions mode (see above) from being used.
These tool names can go into the deny, allow, and ask permission arrays the permissions object of the settings.json or managed-settings.json file.
WebFetch
The WebFetch tool can make HTTPS requests to external servers. This tool supports specifying a domain, such as WebFetch(domain:example.com)
WebSearch
This tool performs web searches, it does not accept any arguments, so you can only add WebSearch to the ask, allow or deny arrays.
Read
The Read permission supports file path patterns using gitignore syntax. This can be useful to add to deny or ask permissions to avoid accidentally adding sensitive content to the session context.
Read(**/.env) - matches .env files in any directory.
Read(**/*.key) - matches files with the .key extension in any directory.
Read(**/node_modules/**) - matches any node_modules directory.
Edit
The Edit permission supports file path patterns using gitignore syntax. See above for example patterns.
Bash
The Bash tool permission also supports patterns.
Bash - match all bash calls
Bash(rm:*) - match all rm calls, and all subsequent arguments
Bash(git diff:*) - match all git diff calls, and all subsequent arguments
mcp__tool_name
You can add names as defined in the mcp configuration (for example the .mcp.json file). These do not support wild cards so you have to list each one.