update claude-settings report for v2.1.121 — alwaysLoad, sshConfigs, status line fields, file scope migration
- new MCP Per-Server Tool Loading subsection (alwaysLoad + per-tool _meta variant)
- new Workspace & Teams subsection covering sshConfigs
- Display Settings table: 5 keys migrated from ~/.claude.json to settings.json (autoScrollEnabled, editorMode, showTurnDuration, teammateMode, terminalProgressBarEnabled) with v2.1.119 historical note
- Status Line Input Fields table: add effort.level and thinking.enabled (v2.1.121)
- bypassPermissions row notes new .claude/* write exemption (v2.1.121)
- language description now mentions terminal tab title (v2.1.121)
- /effort row updated to list xhigh and max
- Effort Level Note adds \${CLAUDE_EFFORT} skill template variable (v2.1.120)
- env vars: AI_AGENT (v2.1.120) and OTEL_LOG_USER_PROMPTS (v2.1.121)
- fix two relative auto-mode anchor links to absolute URLs
- Quick Reference example showcases mcpServers.alwaysLoad and sshConfigs
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
# Settings Best Practice
|
||||
|
||||
 <br>
|
||||
 <br>
|
||||
[](../.claude/settings.json)
|
||||
|
||||
A comprehensive guide to all available configuration options in Claude Code's `settings.json` files. As of v2.1.119, Claude Code exposes **60+ settings** and **175+ environment variables** (use the `"env"` field in `settings.json` to avoid wrapper scripts).
|
||||
A comprehensive guide to all available configuration options in Claude Code's `settings.json` files. As of v2.1.121, Claude Code exposes **60+ settings** and **175+ environment variables** (use the `"env"` field in `settings.json` to avoid wrapper scripts).
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
@@ -68,7 +68,7 @@ Within the managed tier, precedence is: server-managed > MDM/OS-level policies >
|
||||
| `$schema` | string | - | JSON Schema URL for IDE validation and autocompletion (e.g., `"https://json.schemastore.org/claude-code-settings.json"`) |
|
||||
| `model` | string | `"default"` | Override default model. Accepts aliases (`sonnet`, `opus`, `haiku`) or full model IDs |
|
||||
| `agent` | string | - | Set the default agent for the main conversation. Value is the agent name from `.claude/agents/`. Also available via `--agent` CLI flag |
|
||||
| `language` | string | `"english"` | Claude's preferred response language. Also sets the voice dictation language |
|
||||
| `language` | string | `"english"` | Claude's preferred response language. Also sets the voice dictation language and the terminal tab title (v2.1.121) |
|
||||
| `cleanupPeriodDays` | number | `30` | Age cutoff for the startup cleanup sweep (minimum 1). Inactive session transcripts and orphaned subagent worktrees are deleted; as of v2.1.117 the sweep also covers `~/.claude/tasks/`, `~/.claude/shell-snapshots/`, and `~/.claude/backups/`. 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 |
|
||||
| `autoUpdatesChannel` | string | `"latest"` | Release channel: `"stable"` or `"latest"` |
|
||||
| `minimumVersion` | string | - | Prevent the auto-updater from downgrading below a specific version. Automatically set when switching to the stable channel and choosing to stay on the current version until stable catches up. Used with `autoUpdatesChannel` |
|
||||
@@ -234,8 +234,8 @@ Control what tools and operations Claude can perform.
|
||||
| `permissions.disableBypassPermissionsMode` | string | Prevent bypass mode activation |
|
||||
| `permissions.skipDangerousModePermissionPrompt` | boolean | Skip 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 |
|
||||
| `allowManagedPermissionRulesOnly` | boolean | **(Managed only)** Only managed permission rules apply; user/project `allow`, `ask`, `deny` rules are ignored |
|
||||
| `autoMode` | object | Customize what the [auto mode](/en/permission-modes#eliminate-prompts-with-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 unless you include the literal string `"$defaults"` in the array — the sentinel inherits the built-in rules at that position so custom entries are added alongside them (v2.1.118). Run `claude auto-mode defaults` to see built-in rules before customizing |
|
||||
| `disableAutoMode` | string | Set to `"disable"` to prevent [auto mode](/en/permission-modes#eliminate-prompts-with-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 |
|
||||
| `autoMode` | object | Customize what the [auto mode](https://code.claude.com/docs/en/permission-modes#eliminate-prompts-with-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 unless you include the literal string `"$defaults"` in the array — the sentinel inherits the built-in rules at that position so custom entries are added alongside them (v2.1.118). Run `claude auto-mode defaults` to see built-in rules before customizing |
|
||||
| `disableAutoMode` | string | Set to `"disable"` to prevent [auto mode](https://code.claude.com/docs/en/permission-modes#eliminate-prompts-with-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 |
|
||||
| `useAutoModeDuringPlan` | boolean | Whether 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
|
||||
@@ -245,7 +245,7 @@ Control what tools and operations Claude can perform.
|
||||
| `"default"` | Standard permission checking with prompts |
|
||||
| `"acceptEdits"` | Auto-accept file edits without asking |
|
||||
| `"dontAsk"` | Auto-denies tools unless pre-approved via `/permissions` or `permissions.allow` rules |
|
||||
| `"bypassPermissions"` | Skip all permission checks (dangerous) |
|
||||
| `"bypassPermissions"` | Skip all permission checks (dangerous). Writes to protected paths (`.git`, `.claude`, `.vscode`, `.idea`, `.husky`) still prompt. As of v2.1.121, writes to `.claude/commands/`, `.claude/agents/`, `.claude/skills/`, and `.claude/worktrees/` are explicitly exempt from the protected-paths prompt because Claude routinely writes there when creating skills, subagents, and commands |
|
||||
| `"auto"` | Auto-approves tool calls with background safety checks that verify actions align with your request. Research preview. 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. In the default `Shift+Tab` permission-mode cycle since v2.1.111 (the `--enable-auto-mode` flag was removed in v2.1.111 — start in this mode with `--permission-mode auto`). Configure with the `autoMode` setting |
|
||||
| `"plan"` | Read-only exploration mode |
|
||||
|
||||
@@ -357,6 +357,24 @@ Configure Model Context Protocol servers for extended capabilities.
|
||||
}
|
||||
```
|
||||
|
||||
### Per-Server Tool Loading (`alwaysLoad`, v2.1.121)
|
||||
|
||||
By default, MCP tool definitions are deferred (loaded into context on demand via tool search). Set `alwaysLoad: true` on an individual MCP server entry in `.mcp.json` (or inline `mcpServers`) to exempt that server from deferral — every tool from that server then loads upfront at session start regardless of `ENABLE_TOOL_SEARCH`. Available on all server types; requires Claude Code v2.1.121+. Use this only for a small set of tools needed every turn — each upfront tool consumes context that would otherwise be available for conversation.
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"always-on-server": {
|
||||
"type": "http",
|
||||
"url": "https://mcp.example.com",
|
||||
"alwaysLoad": true
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
An MCP server can also mark individual tools as always-loaded by including `"anthropic/alwaysLoad": true` in the tool's `_meta` object — useful when only a subset of a server's tools should bypass deferral.
|
||||
|
||||
**Example:**
|
||||
```json
|
||||
{
|
||||
@@ -528,6 +546,8 @@ The `/model` command exposes an **effort level** control that adjusts how much r
|
||||
|
||||
**Note:** Effort level is available for Opus 4.6, Sonnet 4.6, and Opus 4.7 on Max and Team plans. The default was changed from High to Medium in v2.1.68, then changed back to **High** for API-key, Bedrock/Vertex/Foundry, Team, and Enterprise users in v2.1.94. In v2.1.117, the default was also raised from `medium` to `high` for Pro/Max subscribers on Opus 4.6 and Sonnet 4.6, bringing all tiers into alignment on `high`. v2.1.111 introduced **`xhigh`** (Opus 4.7 only) and made it the default effort level on Opus 4.7 across all plans. As of v2.1.75, 1M context window for Opus 4.6 is available by default on Max, Team, and Enterprise plans.
|
||||
|
||||
**Skill template variable (v2.1.120):** Inside skill files, use `${CLAUDE_EFFORT}` to reference the current effort level. Useful for skill instructions that should adapt their depth or detail based on the active effort tier.
|
||||
|
||||
### Model Environment Variables
|
||||
|
||||
Configure via `env` key:
|
||||
@@ -561,21 +581,56 @@ Configure via `env` key:
|
||||
| `respectGitignore` | boolean | `true` | Respect .gitignore in file picker |
|
||||
| `prefersReducedMotion` | boolean | `false` | Reduce animations and motion effects in the UI |
|
||||
| `fileSuggestion` | object | - | Custom file suggestion command (see File Suggestion Configuration below) |
|
||||
| `autoScrollEnabled` | boolean | `true` | Auto-scroll the conversation in fullscreen mode. Set to `false` to disable automatic scrolling (v2.1.110). Versions before v2.1.119 stored this in `~/.claude.json` |
|
||||
| `editorMode` | string | `"normal"` | Key binding mode for the input prompt: `"normal"` or `"vim"`. Appears in `/config` as **Editor mode**. Versions before v2.1.119 stored this in `~/.claude.json` |
|
||||
| `showTurnDuration` | boolean | `true` | Show turn duration messages after responses (e.g., "Cooked for 1m 6s"). Versions before v2.1.119 stored this in `~/.claude.json` |
|
||||
| `teammateMode` | string | `"auto"` | How [agent team](https://code.claude.com/docs/en/agent-teams) teammates display: `"auto"` (picks split panes in tmux or iTerm2, in-process otherwise), `"in-process"`, or `"tmux"`. See [choose a display mode](https://code.claude.com/docs/en/agent-teams#choose-a-display-mode). Versions before v2.1.119 stored this in `~/.claude.json` |
|
||||
| `terminalProgressBarEnabled` | boolean | `true` | Show the terminal progress bar in supported terminals (ConEmu, Ghostty 1.2.0+, and iTerm2 3.6.6+). Appears in `/config` as **Terminal progress bar**. Versions before v2.1.119 stored this in `~/.claude.json` |
|
||||
|
||||
### 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.
|
||||
These IDE-related preferences are stored in `~/.claude.json`, **not** `settings.json`.
|
||||
|
||||
> **v2.1.119 migration note:** As of v2.1.119, `autoScrollEnabled`, `editorMode`, `showTurnDuration`, `teammateMode`, and `terminalProgressBarEnabled` moved into `settings.json` and are documented in the Display Settings table above. Earlier versions stored them here.
|
||||
|
||||
| Key | Type | Default | Description |
|
||||
|-----|------|---------|-------------|
|
||||
| `autoConnectIde` | boolean | `false` | Automatically 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 |
|
||||
| `autoInstallIdeExtension` | boolean | `true` | Automatically 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 |
|
||||
| `autoScrollEnabled` | boolean | `true` | Auto-scroll the conversation in fullscreen mode. Set to `false` to disable automatic scrolling (v2.1.110) |
|
||||
| `editorMode` | string | `"normal"` | Key binding mode for the input prompt: `"normal"` or `"vim"`. Appears in `/config` as **Editor mode** |
|
||||
| `externalEditorContext` | boolean | `true` | Include additional context about the external editor when available. Set to `false` to disable |
|
||||
| `showTurnDuration` | boolean | `true` | Show turn duration messages after responses (e.g., "Cooked for 1m 6s"). Edit `~/.claude.json` directly to change |
|
||||
| `terminalProgressBarEnabled` | boolean | `true` | Show the terminal progress bar in supported terminals (ConEmu, Ghostty 1.2.0+, and iTerm2 3.6.6+). Appears in `/config` as **Terminal progress bar** |
|
||||
| `teammateMode` | string | `"auto"` | How [agent team](https://code.claude.com/docs/en/agent-teams) teammates display: `"auto"` (picks split panes in tmux or iTerm2, in-process otherwise), `"in-process"`, or `"tmux"`. See [choose a display mode](https://code.claude.com/docs/en/agent-teams#choose-a-display-mode) |
|
||||
|
||||
### Workspace & Teams
|
||||
|
||||
| Key | Type | Description |
|
||||
|-----|------|-------------|
|
||||
| `sshConfigs` | object[] | SSH connection definitions surfaced as a dropdown in Desktop. Each entry must include `id`, `name`, and `sshHost`; optionally `sshPort`, `sshIdentityFile`, and `startDirectory` |
|
||||
|
||||
**Field reference:**
|
||||
|
||||
| Field | Required | Description |
|
||||
|-------|----------|-------------|
|
||||
| `id` | yes | Unique identifier for the SSH connection entry |
|
||||
| `name` | yes | Display name shown in the Desktop dropdown |
|
||||
| `sshHost` | yes | SSH host (e.g., `user@dev.example.com` or `dev.example.com`) |
|
||||
| `sshPort` | no | SSH port number |
|
||||
| `sshIdentityFile` | no | Path to the SSH identity file (private key) |
|
||||
| `startDirectory` | no | Initial working directory after connecting |
|
||||
|
||||
**Example:**
|
||||
```json
|
||||
{
|
||||
"sshConfigs": [
|
||||
{
|
||||
"id": "dev-vm",
|
||||
"name": "Dev VM",
|
||||
"sshHost": "user@dev.example.com",
|
||||
"sshPort": 22,
|
||||
"sshIdentityFile": "~/.ssh/id_ed25519",
|
||||
"startDirectory": "/home/user/project"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Status Line Configuration
|
||||
|
||||
@@ -629,6 +684,8 @@ The status line command receives a JSON object on stdin. For the full JSON schem
|
||||
| `output_style.name` | Name of the current output style |
|
||||
| `vim.mode` | Current vim mode (`NORMAL` or `INSERT`) when vim mode is enabled |
|
||||
| `agent.name` | Agent name when running with `--agent` flag or agent settings |
|
||||
| `effort.level` | Current reasoning effort (`low`, `medium`, `high`, `xhigh`, or `max`). Reflects the live session value, including mid-session `/effort` changes. Absent when the current model does not support the effort parameter (v2.1.121) |
|
||||
| `thinking.enabled` | Whether extended thinking is enabled for the session (v2.1.121) |
|
||||
| `worktree.name` | Name of the active worktree (present only during `--worktree` sessions) |
|
||||
| `worktree.path` | Absolute path to the worktree directory |
|
||||
| `worktree.branch` | Git branch name for the worktree. Absent for hook-based worktrees |
|
||||
@@ -741,6 +798,7 @@ Set environment variables for all Claude Code sessions.
|
||||
| `ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION` | Customize the Haiku entry description in the `/model` picker. Defaults to `Custom model (<model-id>)` |
|
||||
| `ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES` | Override 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 |
|
||||
| `CLAUDECODE` | Set 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 |
|
||||
| `AI_AGENT` | Set automatically by Claude Code in subprocess environments (Bash tool, hooks, MCP stdio servers). Generic flag identifying the parent process as an AI agent — useful for tools that adapt behavior when invoked from any AI agent rather than checking each agent-specific variable like `CLAUDECODE` *(in v2.1.120 changelog, not yet on official env-vars page)* |
|
||||
| `CLAUDE_CODE_SKIP_FAST_MODE_NETWORK_ERRORS` | Set 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_BEDROCK` | Use AWS Bedrock (`1` to enable) |
|
||||
| `CLAUDE_CODE_USE_VERTEX` | Use Google Vertex AI (`1` to enable) |
|
||||
@@ -888,6 +946,7 @@ Set environment variables for all Claude Code sessions.
|
||||
| `CLAUDE_STREAM_IDLE_TIMEOUT_MS` | Timeout in ms for the streaming idle watchdog. Two watchdogs apply: **byte-level** (default and minimum `300000` / 5 minutes, aborts when no bytes arrive on the wire) and **event-level** (default `90000` / 90 seconds, no minimum, aborts when no SSE events arrive). The byte watchdog is enabled by default for Anthropic API connections; control it via `CLAUDE_ENABLE_BYTE_WATCHDOG`. Increase the event timeout if long-running tools or slow networks cause premature timeout errors |
|
||||
| `OTEL_LOG_TOOL_DETAILS` | Set 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)* |
|
||||
| `OTEL_LOG_RAW_API_BODIES` | Set to `1` to emit full API request and response bodies as OpenTelemetry log events. Omitted by default for privacy and payload size. Useful for debugging at a gateway or proxy *(in v2.1.111 changelog, not yet on official env-vars page)* |
|
||||
| `OTEL_LOG_USER_PROMPTS` | Set to `1` to include the `user_system_prompt` field in OpenTelemetry LLM request spans. Omitted by default for privacy — user prompts can contain sensitive data, so opt in only when you control the OTel collector and have policies in place *(in v2.1.121 changelog, not yet on official env-vars page)* |
|
||||
| `CLAUDE_CODE_FORK_SUBAGENT` | Set to `1` to enable forked subagents on external builds (non-Anthropic-signed distributions). Forked subagents run in an isolated child process instead of sharing the main agent's context *(in v2.1.117 changelog, not yet on official env-vars page)* |
|
||||
| `CLAUDE_CODE_MCP_SERVER_NAME` | Name 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_URL` | URL 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)* |
|
||||
@@ -930,7 +989,7 @@ Set environment variables for all Claude Code sessions.
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `/model` | Switch models and adjust Opus 4.6 effort level |
|
||||
| `/effort` | Set effort level directly: `low`, `medium`, `high` (v2.1.76+) |
|
||||
| `/effort` | Set effort level directly: `low`, `medium`, `high`, `xhigh` (Opus 4.7 only, v2.1.111), or `max` (Opus 4.6 only) (v2.1.76+) |
|
||||
| `/config` | Interactive configuration UI |
|
||||
| `/memory` | View/edit all memory files |
|
||||
| `/agents` | Manage subagents |
|
||||
@@ -1003,6 +1062,22 @@ Set environment variables for all Claude Code sessions.
|
||||
|
||||
"enableAllProjectMcpServers": true,
|
||||
|
||||
"mcpServers": {
|
||||
"always-on-server": {
|
||||
"type": "http",
|
||||
"url": "https://mcp.example.com",
|
||||
"alwaysLoad": true
|
||||
}
|
||||
},
|
||||
|
||||
"sshConfigs": [
|
||||
{
|
||||
"id": "dev-vm",
|
||||
"name": "Dev VM",
|
||||
"sshHost": "user@dev.example.com"
|
||||
}
|
||||
],
|
||||
|
||||
"sandbox": {
|
||||
"enabled": true,
|
||||
"excludedCommands": ["git", "docker"],
|
||||
|
||||
Reference in New Issue
Block a user