💬 hippo: This post is part of the Claude Code Official Docs Breakdown series.


1. What Is the Settings System?

Claude Code’s settings system is a layered configuration mechanism that controls everything from UI themes to permission sandboxes. Its core concept is scope: enterprise-managed settings take the highest precedence, followed by command-line arguments, local settings, project settings, and user settings. More specific scopes always override broader ones—meaning personal settings can never bypass enterprise security policies, while teams and individuals still retain full flexibility to customize their workflows.

The system spans two separate configuration files: settings.json governs runtime behavior such as permissions, sandboxing, and Hooks, while ~/.claude.json is an independent global preferences file storing personal settings like editor mode and IDE integration. Understanding the division of responsibilities between these two files is the first step to mastering Claude Code configuration.


2. Official Docs Deep Dive

2.1 Configuration Scopes and File Locations

Claude Code uses four scopes to determine where a setting applies and whether it is shared:

Scope Location Affected Scope Shared with Team?
Managed Server-managed, MDM/registry, or system-level managed-settings.json All users on the machine Yes (deployed by IT)
User ~/.claude/ directory You, across all projects No
Project .claude/ in the repository All collaborators in this repository Yes (committed to Git)
Local .claude/settings.local.json You, in this repository only No (auto-gitignored)

Precedence from highest to lowest: Managed > CLI arguments > Local > Project > User. Managed settings cannot be overridden by anything.

💡 Tip: .claude/settings.local.json is automatically added to .gitignore upon creation, making it ideal for personal experimental tweaks.

Typical use cases for each scope:

  • Managed: Enterprise security policies, compliance requirements, and IT-deployed configurations
  • User: Personal preferences (themes, editor settings) and tools or plugins shared across all projects
  • Project: Team-wide configurations (permission rules, Hooks, MCP servers) and standardized team tooling
  • Local: Personal overrides for a specific project, configurations under test, and machine-specific settings

Features by scope:

Feature User Location Project Location Local Location
Settings ~/.claude/settings.json .claude/settings.json .claude/settings.local.json
Subagents ~/.claude/agents/ .claude/agents/ None
MCP Servers ~/.claude.json .mcp.json ~/.claude.json (per project)
Plugins ~/.claude/settings.json .claude/settings.json .claude/settings.local.json
CLAUDE.md ~/.claude/CLAUDE.md CLAUDE.md or .claude/CLAUDE.md CLAUDE.local.md

Keep in mind that settings.json and ~/.claude.json are completely separate files. The former controls runtime behavior (permissions, sandbox, Hooks, etc.), whereas the latter holds global preferences:

~/.claude.json Key Description
autoConnectIde Automatically connect to detected IDEs
autoInstallIdeExtension Automatically install the IDE extension
editorMode Preferred editor mode
showTurnDuration Display elapsed time per conversation turn
terminalProgressBarEnabled Enable the terminal progress bar
teammateMode Display mode for Agent team members: auto (tmux/iTerm2 split panes or in-process), in-process, tmux

2.2 Core settings.json Options

Here is a complete project-level settings.json example:

1
2
3
4
5
6
7
8
9
10
11
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"permissions": {
"allow": ["Bash(npm run lint)", "Bash(npm run test *)"],
"deny": ["Bash(curl *)", "Read(./.env)", "Read(./.env.*)", "Read(./secrets/**)"]
},
"env": {
"CLAUDE_CODE_ENABLE_TELEMETRY": "1"
},
"companyAnnouncements": ["Welcome to Acme Corp!"]
}

The $schema field deserves special mention: once added, editors like VS Code and Cursor automatically provide field autocompletion, type validation, and example values—drastically cutting down on configuration typos.

Available settings.json keys:

Key Description Example
permissions Permission controls (allow / ask / deny) See Section 2.3
env Environment variables injected into every session {"FOO": "bar"}
sandbox Sandbox configuration for isolating Bash commands See Section 2.3
attribution Attribution text for Git commits and PRs {"commit": "", "pr": ""}
hooks Custom commands executed before or after tool calls See Hooks docs
model Override the default model "claude-sonnet-4-6"
availableModels Restrict the list of models users can select ["sonnet", "haiku"]
modelOverrides Map model IDs to provider-specific IDs {"sonnet": "bedrock-id"}
effortLevel Persist the reasoning effort level "low" / "medium" / "high"
language Preferred response language "japanese"
cleanupPeriodDays Session retention period in days (default 30, minimum 1; 0 triggers a validation error) 30
autoUpdatesChannel Release channel for automatic updates "stable" or "latest"
disableAllHooks Disable all Hooks false
companyAnnouncements Organization announcements shown on startup ["Welcome!"]
enabledPlugins Enable or disable individual plugins See Section 2.4
worktree.symlinkDirectories Directories to symlink inside worktrees ["node_modules"]
worktree.sparsePaths Directories to check out via sparse-checkout ["src/core"]
autoMode Custom classifier rules for Auto Mode —
fileSuggestion Custom command for @ file path autocompletion —
statusLine Custom status line configuration —
agent Run the main thread as a specified subagent "code-reviewer"
apiKeyHelper Custom auth script whose output serves as the API key /bin/generate_temp_api_key.sh
autoMemoryDirectory Custom directory for auto-memory storage (policy/local/user only) "~/my-memory-dir"
alwaysThinkingEnabled Enable extended thinking by default true
channelsEnabled (Managed) Allow Team/Enterprise users to use channels true
defaultShell Default shell: "bash" or "powershell" "powershell"
disableAutoMode Set to "disable" to block Auto Mode "disable"
disableDeepLinkRegistration Prevent registering the claude-cli:// protocol handler "disable"
disableSkillShellExecution Disable shell command execution inside Skills true
enableAllProjectMcpServers Automatically approve all MCP servers defined in the project true
fastModePerSessionOptIn Prevent Fast Mode from persisting across sessions true
feedbackSurveyRate Probability of showing quality surveys (0–1) 0.05
forceLoginMethod Restrict login method (claudeai or console) "claudeai"
forceRemoteSettingsRefresh (Managed) Force fetching remote settings on startup true
includeGitInstructions Include Git workflow instructions in the system prompt false
outputStyle Configure the response output style "Explanatory"
plansDirectory Custom directory for storing plan files "./plans"
showThinkingSummaries Display summaries of extended thinking true
voiceEnabled Enable voice dictation true

2.3 Permission Rules and Sandbox Configuration

Permissions are the core of settings.json. Rules follow the Tool or Tool(specifier) format and are evaluated in deny > ask > allow order—the first matching rule wins.

1
2
3
4
5
6
7
8
9
{
"permissions": {
"allow": ["Bash(git status *)", "Bash(git diff *)", "Bash(git log *)"],
"ask": ["Bash(git push *)", "Bash(rm *)"],
"deny": ["WebFetch", "Bash(curl *)", "Read(./.env)", "Read(./secrets/**)"],
"additionalDirectories": ["../docs/"],
"defaultMode": "acceptEdits"
}
}
Rule Effect
Bash Matches all Bash commands
Bash(npm run *) Matches commands starting with npm run
Read(./.env) Matches reading the .env file
WebFetch(domain:example.com) Matches requests to example.com

⚠️ Bash permission rules use prefix matching, not regular expressions. File paths (Read/Write) support glob patterns.

Additional permission settings:

Key Description Example
disableBypassPermissionsMode Set to "disable" to block --dangerously-skip-permissions (well suited for Managed settings) "disable"
skipDangerousModePermissionPrompt Skip the confirmation prompt when entering bypass mode (ignored in project-level settings) true

The Sandbox isolates Bash commands from the filesystem and network, adding a defense-in-depth layer:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"sandbox": {
"enabled": true,
"autoAllowBashIfSandboxed": true,
"excludedCommands": ["docker"],
"filesystem": {
"allowWrite": ["/tmp/build", "~/.kube"],
"denyRead": ["~/.aws/credentials"]
},
"network": {
"allowedDomains": ["github.com", "*.npmjs.org"],
"allowUnixSockets": ["/var/run/docker.sock"],
"allowLocalBinding": true
}
}
}
Key Description Default
enabled Enable the Bash sandbox false
autoAllowBashIfSandboxed Auto-approve Bash commands running inside the sandbox true
excludedCommands Commands allowed to run outside the sandbox []
filesystem.allowWrite Additional paths writable inside the sandbox []
filesystem.denyRead Paths blocked from reading []
filesystem.denyWrite Paths blocked from writing (e.g., ["/etc"]) []
filesystem.allowRead Re-allow reading specific paths inside a denyRead region (e.g., ["."]) []
filesystem.allowManagedReadPathsOnly (Managed) Only honor allowRead paths from Managed settings false
network.allowedDomains Domains allowed for outbound traffic (supports wildcards) []
network.allowLocalBinding Allow binding to localhost ports (macOS only) false
network.allowAllUnixSockets Allow all Unix socket connections false
network.httpProxyPort Custom HTTP proxy port (e.g., 8080) Unset
network.socksProxyPort Custom SOCKS5 proxy port (e.g., 8081) Unset
network.allowManagedDomainsOnly (Managed) Only honor allowedDomains from Managed settings false
failIfUnavailable Fail immediately if sandboxing is unavailable instead of falling back to unsandboxed execution false
allowUnsandboxedCommands Allow commands to fall back outside the sandbox (set to false to block sandbox escapes completely) true
enableWeakerNestedSandbox Use a weaker sandbox inside unprivileged Docker containers (⚠️ lowers security—enable explicitly only when needed) false
enableWeakerNetworkIsolation (macOS) Allow access to system TLS services (⚠️ lowers security—enable explicitly only when needed) false

Path rules support three prefixes: / for absolute paths, ~/ for the home directory, and ./ (or no prefix) for the project root. Filesystem restrictions and permission rules merge and apply together.

2.4 Managed Enterprise Settings and the Plugin System

Managed settings support three delivery channels:

Channel Description
Server-managed Delivered directly from Anthropic’s servers via the Claude.ai Admin Console
MDM / OS policies macOS plist (Jamf/Kandji) or Windows Registry (HKLM\SOFTWARE\Policies\ClaudeCode, user-level HKCU\SOFTWARE\Policies\ClaudeCode)
File-based System-level managed-settings.json, with support for merging drop-in fragments from managed-settings.d/

When merging drop-in fragments, managed-settings.json acts as the base and every *.json file in managed-settings.d/ is layered on top in alphabetical order: scalars overwrite, arrays concatenate with deduplication, and objects deep-merge. Hidden files starting with . are ignored. Use numeric prefixes to enforce ordering—for instance, 10-telemetry.json before 20-security.json. Alongside managed-settings.json, Claude Code also supports managed-mcp.json for centrally managed MCP server configurations.

The plugin system toggles plugins via enabledPlugins and registers custom registries via extraKnownMarketplaces:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"enabledPlugins": {
"formatter@acme-tools": true,
"deployer@acme-tools": true,
"analyzer@security-plugins": false
},
"extraKnownMarketplaces": {
"acme-tools": {
"source": "github",
"repo": "acme-corp/claude-plugins"
},
"security-plugins": {
"source": "git",
"url": "https://git.example.com/security/plugins.git"
}
}
}

⚠️ Note: extraKnownMarketplaces has changed from an array to an object map. Each key is a marketplace name, and its value includes a source field. Supported source types: github (uses repo), git (uses url), directory (local development), hostPattern (regex matching), and settings (inline declaration).

Managed settings can also lock users to approved registries with strictKnownMarketplaces (supporting seven source types: github, git, url, npm, file, directory, and hostPattern), and enforce Hook security boundaries using allowManagedHooksOnly, allowedHttpHookUrls, and httpHookAllowedEnvVars.

2.5 File Suggestions and Subagent Configuration

File Suggestion lets you customize @ file-path autocompletion—especially useful in large monorepos backed by prebuilt indexes:

1
2
3
4
5
6
{
"fileSuggestion": {
"type": "command",
"command": "~/.claude/file-suggestion.sh"
}
}

The script receives JSON on stdin (including a query field) and prints newline-delimited file paths to stdout (up to 15 results).

Subagent configurations are stored as Markdown files in agents/ directories at either user or project scope:

  • User level: ~/.claude/agents/ — available across all projects
  • Project level: .claude/agents/ — scoped to the repository and shareable with the team

Each subagent file uses YAML frontmatter to customize its system prompt and tool permissions. See the Subagents documentation for full details.

2.6 Interactive Configuration Commands and Attribution Settings

For inspecting and adjusting settings day to day, the official docs currently recommend two approaches:

  • Interactive slash commands: Run /config inside a session to open the interactive settings UI, /permissions to manage permission rules, and /status to inspect every active configuration source and any conflicts.
  • Direct edits to settings.json: Pair it with $schema autocompletion, or pass claude --settings ./custom.json for a one-off session override.

💡 Version change note: Older releases provided claude config list/set/add subcommands, which have been deprecated in newer Claude Code CLI versions and are no longer the primary workflow. If you are still on an older CLI release, here is the legacy reference:

1
2
3
4
5
# Legacy CLI reference (in newer versions, use /config, /status, or edit settings.json directly)
claude config list
claude config set permissions.allow '["Bash(git *)"]'
claude config set -g theme dark
claude config add permissions.allow "Bash(npm *)"

Attribution controls how Claude is credited in Git commits and pull requests. Commits default to Git trailer format (such as Co-Authored-By), while PR descriptions use plain text:

1
2
3
4
5
6
{
"attribution": {
"commit": "Generated with AI\n\nCo-Authored-By: AI <noreply@anthropic.com>",
"pr": ""
}
}
Key Description
commit Git commit attribution text (supports Git trailers); set to an empty string to omit
pr Pull request description attribution text (plain text); set to an empty string to omit

💡 includeCoAuthoredBy is deprecated—use attribution instead.


3. Hippo’s Hands-On Experience

💬 hippo: Here are a few pitfalls I ran into in daily use:

3.1 Configuration Layering Pitfalls

When I first started using Claude Code, I dumped everything into ~/.claude/settings.json. Predictably, my config disappeared whenever I switched machines, and permission rules drifted across teammates. I eventually settled on a cleaner split:

  • Project-level .claude/settings.json: Team-shared permission rules and Hooks, committed to Git
  • User-level ~/.claude/settings.json: Personal preferences like cleanupPeriodDays and autoUpdatesChannel
  • Use ask instead of deny for sensitive operations: Take git push—prompting for confirmation is much more practical than a hard ban, since you genuinely need to push in plenty of workflows

3.2 The Practical Payoff of $schema

Adding a single line—"$schema": "https://json.schemastore.org/claude-code-settings.json"—unlocks full editor autocompletion for every valid key. It looks trivial, yet in practice it took my config typo rate from “frequent” to “practically zero.” With 50+ configuration keys in Claude Code, typing them from memory is asking for mistakes.

3.3 My Recommendations

  1. Put permissions at the project level first: Everyone on the team should run under the same rules to avoid “works on my machine, fails in CI” surprises.
  2. Pair /config with $schema to avoid hand-editing mistakes: After editing settings.json, verify changes immediately inside your session rather than relying on the deprecated claude config subcommands.
  3. Debug config issues with /status: Whenever a permission rule does not behave as expected, /status shows every active settings source and flags conflicts immediately.

4. FAQ

Q: What is the difference between settings.json and settings.local.json?

A: settings.json is committed to Git and shared with your team; settings.local.json is ignored by Git and meant for personal experiments. When merged, keys in settings.local.json override matching keys in settings.json.

Q: Do permission rules use regular expressions?

A: No. Bash permission rules use prefix matching—Bash(git *) matches any command starting with git. File paths (Read/Write) support glob patterns such as Read(./secrets/**).

Q: How can I inspect the full effective configuration?

A: Run /status inside Claude Code to see every active settings source, which file each setting came from, and any conflicts or errors.

Q: How do I disable Claude attribution in Git commits?

A: Set attribution.commit to an empty string:

1
2
3
4
5
6
{
"attribution": {
"commit": "",
"pr": ""
}
}

5. Summary

Claude Code’s settings system strikes a clean balance between enterprise governance, team collaboration, and personal customization through five tiers of precedence. Keep three takeaways in mind:

  1. Scope precedence: Managed > CLI > Local > Project > User—more specific always wins.
  2. Always add $schema: One line gives you full editor autocompletion and catches typos before they bite.
  3. Permission evaluation order: deny beats ask, which beats allow—first matching rule wins.

Series Navigation


Based on the official Claude Code Settings - Claude Code Docs documentation.

Last updated: 2026-04-09