# Claude Code settings load order

> Managed settings beat --settings, then project local, shared project, then user ~/.claude/settings.json.

Source: https://fullbytedeveloper.com/blog/claude-code-settings-load-order
Published here: 2026-11-26

You set `"deny"` for `.env` in `~/.claude/settings.json`, then a teammate's shared project file silently changes another key and you assume your deny vanished. Claude Code did not merge opinions for scalar keys. It took the value from the highest level that set that key. Learn the stack once [1].

## Read the precedence stack

When the same key appears in more than one place, Claude Code uses the value from the highest level that sets it. Highest first [1]:

1. Managed settings (`managed-settings.json`, MDM, or server-managed settings from the claude.ai console)
2. Command line `--settings <file-or-json>` for that session
3. Project local settings (`.claude/settings.local.json`)
4. Shared project settings (`.claude/settings.json`)
5. User settings (`~/.claude/settings.json`)

Nothing in your own files or `--settings` overrides a managed key [1]. Environment variables are not a level in this stack; pairs such as `ANTHROPIC_MODEL` vs the `model` key are decided per pair [1].

| Scope | File | Who it affects |
| --- | --- | --- |
| User | `~/.claude/settings.json` | You, every project on this machine |
| Shared project | `.claude/settings.json` | Everyone in the folder; commit it for teammates |
| Project local | `.claude/settings.local.json` | You, this project only |
| Managed | managed sources | Everyone your organization deploys it to |

Claude Code keeps `.claude/settings.local.json` out of git when it creates the file; if you create it by hand, add it to `.gitignore` yourself [1].

## Know merge vs replace

List keys such as `permissions.allow` combine across files. Claude Code merges the lists instead of picking one, so each file can add entries without removing another file's [1].

Four model-list style keys follow their own rules [1]:

| Key | Behavior |
| --- | --- |
| `fallbackModel` | Whole value from the highest-precedence file that defines it |
| `modelPicker` | Whole value from the highest of managed, `--settings`, and user; ignored in project/local; needs v2.1.242+ |
| `availableModels` | Managed list applies as-is when managed settings define it |
| `modelSettings` | Resolved per model (with `effortLevel`) |

If your personal `allow` list seems "ignored", check whether another scope added more allows rather than replacing yours [1].

## Deny .env with strict JSON

Settings files are strict JSON: a `//` comment or a trailing comma is a syntax error, and Claude Code reports a Settings Error at the next start [1]. Example from the settings docs (lint/test allows plus `.env` denies) [1]:

```json title="~/.claude/settings.json"
{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "permissions": {
    "allow": ["Bash(npm run lint)", "Bash(npm run test *)"],
    "deny": ["Read(./.env)", "Read(./.env.*)"]
  }
}
```

Commit shared permissions, hooks and project `env` needs in `.claude/settings.json`. Keep personal theme, model preference and standing local allows out of the shared file [1]. For a fuller `.env` lock walkthrough, see [Lock Claude Code out of your .env](/blog/claude-code-env-lock).

## Confirm with /status

Run `/status` inside Claude Code. The Status tab includes a Setting sources line that lists each settings file loaded for the session (for example User settings or Project local settings). When managed settings apply, that entry shows in parentheses how they reached the machine [1]. The line confirms which files were read; it does not show which file supplied each key [1]. For rejected entries, the docs point at `claude doctor` [1].

Standing prose instructions are not this JSON stack. Use `CLAUDE.md` / `AGENTS.md` (memory docs) or `--append-system-prompt`. Those files load into context; they are not enforced configuration [1] [2].

## Failure checklist

1. Key ignored: name the key, list every file that sets it, then walk the stack from managed down [1].
2. Tips or flags flipped by the team: shared project sits above user; put your override in `.claude/settings.local.json` [1].
3. Org policy wins: managed sits on top; `/status` names the managed source [1].
4. One-session surprise: you started with `claude --settings '{...}'`; that lasts one session and does not write a file [1].
5. Settings Error dialog: fix JSON first; comments and trailing commas break the file [1].

Related: [Where each Claude Code instruction belongs](/blog/claude-md-where-instructions-belong), [Write an AGENTS.md coding agents actually read](/blog/write-agents-md-that-agents-read), [Rewrite AGENTS.md rules with a checklist](/blog/rewrite-agents-md-rules-checklist).

Your next debug step for a "settings ignored" report should be: name the key, list which files set it, then read the stack from the top.

Send this to the teammate who keeps rewriting user settings while a managed policy silently wins.

## Sources

1. [Claude Code docs: Settings files and precedence](https://code.claude.com/docs/en/settings)
2. [Claude Code docs: How Claude remembers your project](https://code.claude.com/docs/en/memory)
