Skip to content
Mastering Claude

Home / Extending: skills, MCP, subagents, hooks, plugins

Extending: skills, MCP, subagents, hooks, plugins9 minApplication

settings.json in depth

Five levels of settings.json follow one another from strongest to weakest, a scalar key common to two files is decided by the highest-priority level, but most lists, including permissions.allow and permissions.deny, merge across levels instead of overwriting each other.

A project settings.json overrides the user's on a scalar key that both files define, and five levels follow one another before reaching this result (source code.claude.com/docs/en/settings, accessed on 2026-09-02).

Five levels, only one wins by default

From strongest to weakest: managed settings, set by an MDM or by the claude.ai console; the --settings option passed on the command line, valid for a single session; .claude/settings.local.json, private to the machine, never shared via git; .claude/settings.json, shared via git with the rest of the team on this project; and finally ~/.claude/settings.json, set once for every project opened on this machine. On a simple key present at two levels at once, the higher-ranking one wins entirely, the weaker level is not read. Managed settings stay out of reach of editing from the workstation, set by an organisation, whereas the other four levels are plain text files that anyone can open and edit directly.

Lists merge, except for four keys

The rule changes as soon as a key holds a list. permissions.allow and permissions.deny, among others, merge across levels: an entry set at user level stays active even when the project adds another one alongside it. Four keys escape this merging, each following its own rule rather than a single one. fallbackModel takes the entire value from the highest-priority level that defines it. modelPicker takes the entire value from the highest priority among managed settings, --settings and the user settings, and simply ignores the key if it is only set at project or local level. availableModels, when managed settings define it, applies as is and ignores whatever the user, project or local level add, and does not merge across several managed sources either. modelSettings is resolved model by model, with effortLevel, each entry specifying itself which file applies to which model.

{
  "permissions": {
    "allow": ["Bash(npm test)"],
    "deny": []
  },
  "env": {
    "NODE_ENV": "development"
  }
}

The env block follows the same rule

The env block inserted in a settings file is an ordinary key that follows the same five levels as the rest of the file, but most of its values, like the permissions.allow rules, only take effect once each team member has trusted the project's folder. A shell environment variable is not a level in this stack: when a behaviour has both a variable and a settings key, which of the two applies is decided pair by pair, not by level, ANTHROPIC_MODEL exported in the shell winning, for instance, over the model key in any file, whereas ANTHROPIC_DEFAULT_MODEL only applies if no file sets model.

This hierarchy makes full sense as soon as a hook comes into play: the declaration of an event, like the one described in hook events, from trigger to message, also lives in this same file, and follows exactly the same order of priority between project and personal machine.

Figure 1

Five precedence levels in settings.json, from strongest to weakest

Managed settings
Set by an MDM or by the claude.ai console, out of reach of a local file.
--settings, command line
Passed at launch, valid for the current session only.
.claude/settings.local.json
Private to the machine, never shared via git.
.claude/settings.json
Shared via git with the rest of the team on this project.
~/.claude/settings.json
Set once, valid across every project opened from this machine.
The stack places at the top the level that wins when the same scalar key is defined at several levels at once.
Figure 2

Four keys with no merging across settings.json levels

4keys
keys in settings.json exempted from list merging, each with its own rule: fallbackModel, modelPicker, availableModels, modelSettings
code.claude.com/docs/en/settings, 2026-09-02
Most lists in settings.json merge across levels, these four keys are the exception and follow the rule for scalar keys.
Calibrate it yourself

A developer adds the entry Bash(npm test) to permissions.allow in her project's .claude/settings.json file. Her machine's ~/.claude/settings.json file already carries the entry Bash(git log) in the same permissions.allow array. She then opens a new Claude Code session in this project and runs both commands.

Write, in one sentence, what this situation establishes, and in one sentence what it does not establish.

What to remember
  • Five precedence levels follow one another in settings.json: managed settings, --settings command line, local project settings, shared project settings, user settings, from strongest to weakest.
  • A shared project settings.json takes priority over the user's as soon as the same scalar key appears in both files.
  • Most lists, including permissions.allow and permissions.deny, merge across levels instead of overwriting one another.
  • Four keys are an exception to this merging, fallbackModel, modelPicker, availableModels and modelSettings, each following its own rule: modelPicker, for instance, simply ignores the key set at project or local level, rather than falling back to it.
  • The env block follows the file's five levels but waits for the folder to be trusted for most of its values, and a shell variable is not a level in this stack: its precedence against a settings key is decided pair by pair.
Do this now

Open or create your current project's .claude/settings.json file, and add an explicit entry in permissions.allow for a command you have been manually approving for several days in this project, then start a new session and check that the confirmation prompt no longer appears.

What still needs checking

These points depend on an interface or a rule that may have changed since this was written. Check them on your own screen before relying on them.

  • The list of four keys exempted from merging across levels may grow with a future version of Claude Code, to be rechecked at https://code.claude.com/docs/en/settings before basing a critical setting on this behaviour.
Check the source

Every datable claim in this lesson links here to the public text behind it. A source that does not open proves nothing.