You changed a setting in Claude Code and nothing happened. Or you set the default model in one file, your team’s shared config overrode it, and you spent twenty minutes wondering which file is lying to you. Claude Code settings live in four JSON files plus whatever your organisation enforces — and installing Claude Code creates none of them. Once you understand which file wins, where each one lives, and which keys ignore the files entirely, the whole system becomes predictable. This guide covers exactly that, verified against Anthropic’s official settings documentation on 18 November 2026.
The four Claude Code settings files
Claude Code reads settings from four files, and an organisation can also deliver managed settings from the claude.ai console. Each file has a scope — the set of people and projects a setting saved in it applies to:
| Scope | File | Who it affects | Use it for |
|---|---|---|---|
| User | ~/.claude/settings.json |
You, in every project on this machine | Personal preferences: theme, editor mode, default model, your own permission rules |
| Shared project | .claude/settings.json |
Everyone working in the folder that contains it — teammates once committed | Team permissions, hooks, plugins, project environment variables |
| Project local | .claude/settings.local.json |
You, in this one project only | Personal overrides for one project, and testing before you share |
| Managed | managed-settings.json and other managed sources |
Everyone your organisation deploys it to | Security policy and compliance requirements |
In those paths, ~/.claude is the hidden .claude folder in your home directory, and a bare .claude is the folder inside your project. There is also a fifth file, ~/.claude.json, which Claude Code writes for itself — it holds your account details, MCP server configurations, and per-project state such as trust decisions. You do not edit it.
The file that doesn’t exist yet
The first surprise: installing Claude Code does not create any settings file. If your machine or project already has one, it came from one of these sources — or you created it. Claude Code writes the user file the first time you change an option in the /config menu that it stores in user settings, such as the theme. It writes the local file the first time you give a standing approval on a permission prompt, such as choosing “Yes, and don’t ask again” for a Bash command. A few /config options, including Show tips, save to the local file instead.
So if you go looking for ~/.claude/settings.json and it is not there, nothing is broken. Create it yourself — it is a plain JSON file — or change one option in /config and let Claude Code create it for you.
Claude Code settings precedence: which file wins
When the same key appears in more than one place, Claude Code uses the value from the highest level that sets it. The stack, highest precedence first:
- Managed settings — deployed by your organisation. Nothing in your own files or
--settingsoverrides a managed key, and a flag such as--modelpicks only from the models your organisation allows. - Command line — JSON passed with
--settingswhen you startclaude, for that session only. A key you set there overrides the same key in your project and user files; a key you leave out keeps its value from those files. - Project local settings (
.claude/settings.local.json) — your personal settings for this project. - Shared project settings (
.claude/settings.json) — settings your team checks into source control. - User settings (
~/.claude/settings.json) — your personal settings for every project.
Here is the scenario that confuses everyone. Suppose you set spinnerTipsEnabled to false in your user file because you are tired of the one-line tips under the spinner. Your team’s shared project file sets it to true. Claude Code uses the project value, because shared project sits above user — so you see tips in that project and nowhere else. To get your value back, add "spinnerTipsEnabled": false to .claude/settings.local.json in that project. Project local sits above shared project, so your sessions there stop showing tips and your teammates’ sessions don’t change. If your organisation’s managed settings set it to true, nothing you put in any file turns it off — managed is the top level, and you can’t get your value back. Run /status to see which managed source applies, and ask your administrator if the policy should change.
Lists merge instead of overriding
There is one important exception to the stack: when you set the same list key, such as permissions.allow, in more than one file, Claude Code combines the lists instead of picking one, so each file can add entries without removing another file’s. Four keys follow their own rules — fallbackModel takes the whole value from the highest-precedence file that defines it, modelPicker is never merged, availableModels applies as-is from managed settings, and modelSettings resolves one model at a time.
Environment variables are not a level in this stack. When a behaviour has both a shell variable and a settings key, which one applies is decided per pair: ANTHROPIC_MODEL exported in your shell applies over the model key from any file, while ANTHROPIC_DEFAULT_MODEL applies only when no file sets model.
How to change a setting
You have three ways to change a setting, and they serve different purposes.
1. The /config menu
Run /config inside Claude Code and open the Config tab. It lists a short set of personal options such as theme, editor mode, and verbose output — not every settings key. Select an option to change it and Claude Code saves it for you: most options go to ~/.claude/settings.json, a few (such as Show tips) to .claude/settings.local.json, and the global config options to ~/.claude.json. To set one option without the menu, pass key=value, such as /config verbose=true.
2. Edit a settings file
Open the settings file for the scope you want in your editor and add or change a key. Settings files are strict JSON: a // comment or a trailing comma is a syntax error, and Claude Code reports the file as a Settings Error at the next start. After you save, run /status inside Claude Code to confirm the file loaded — its Setting sources line lists each settings file Claude Code loaded for the current session.
Add this line to the top of any settings file to get autocomplete and inline validation in VS Code, Cursor, and any editor that supports JSON schema:
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"model": "claude-sonnet-5"
}
The schema can lag behind the newest CLI releases, so a validation warning on a recently documented key doesn’t mean your configuration is invalid.
3. Change a setting for one session
To try a value without saving it, set it when you start Claude Code. You have three ways: --settings with a key as JSON (inline or as a path to a file), a flag for that key such as --model for model, or an environment variable such as ANTHROPIC_MODEL for model. For example, to start one session on Opus without changing your default:
claude --model claude-opus-5-5
Inside a session, /model switches the model and saves it as your default for new sessions — unless you press s in the picker, which switches without saving. /effort does the same for the effort level.
The Claude Code settings that matter most
Most of the settings reference is keys you will never touch. These are the ones worth setting on day one.
model — your default model
The model key sets which model new sessions start on. It is read once at session start, so an edit to it only applies to the next session — use /model to switch mid-session. One catch: each model has its own prompt cache, so the first request after a switch re-reads the whole conversation uncached.
permissions — what Claude Code may run without asking
This is the security-critical key. Each entry under permissions is a rule naming a tool and what it may do, in allow, ask, and deny lists. A sensible starting point for your user file — let Claude Code run your lint and test commands without asking, and never let it read your secrets:
{
"permissions": {
"allow": [
"Bash(npm test)",
"Bash(npm run lint)",
"Bash(npm run build)"
],
"deny": [
"Read(.env*)",
"Read(**/*.pem)"
]
}
}
Two things to know. First, deny and ask rules from a committed project file apply to teammates right away, but allow rules only apply after each teammate trusts the folder — until then they still see prompts. Allow rules in your own local file apply without the trust step, because that file is yours and not the repository’s. Second, the permissions.defaultMode values auto and bypassPermissions don’t take effect from project or local settings at all — set them in user or managed settings instead, or pass --permission-mode for one session.
hooks — automate around the agent
The hooks key runs your own commands at lifecycle events — after a file edit, before a tool runs, when a session starts. Our Claude Code hooks guide covers seven practical examples, from auto-formatting edited files to blocking dangerous commands. Hooks set in the shared project file are team-wide automation; hooks in your user file are yours alone.
env — environment variables for the session
The env key sets environment variables inside Claude Code sessions — useful for project-specific values like NODE_ENV or an API base URL that every teammate needs. Note the limits: telemetry export variables in an env block don’t take effect from project or local settings, and most env values in a committed file wait for folder trust, like allow rules.
The display keys — theme, editorMode, verbose, outputStyle
theme, editorMode, verbose, and outputStyle control how Claude Code looks and how much it tells you. They are the keys the /config menu edits, so you will rarely write them by hand — but knowing they live in your user file explains why a fresh machine looks different from your usual one. outputStyle, like model, is read once at startup.
A complete starter settings file for one developer
Put this in ~/.claude/settings.json. It is a sane default for a solo developer: a default model, quiet tips, your test commands pre-approved, secrets off-limits, and a hook that formats code after edits:
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"model": "claude-sonnet-5",
"spinnerTipsEnabled": false,
"permissions": {
"allow": [
"Bash(npm test)",
"Bash(npm run lint)",
"Bash(npm run build)",
"Bash(git status)",
"Bash(git diff)"
],
"deny": [
"Read(.env*)",
"Read(**/*.pem)",
"Bash(rm -rf *)"
]
},
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "npx prettier --write \"$CLAUDE_FILE_PATHS\" 2>/dev/null || true"
}
]
}
]
}
}
Adjust the commands to your stack — swap npm test for composer test or pytest — and keep the deny list: it is the one part of the file that protects you when you are tired and clicking “allow” too fast.
A team settings file that actually works
Commit this to .claude/settings.json at your repository root so every teammate gets the same baseline. It sets the team’s default model, the project’s environment, a shared hook, and a deny rule nobody can accidentally override from their own files — remember, deny applies immediately, without the trust step:
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"model": "claude-sonnet-5",
"env": {
"NODE_ENV": "development"
},
"permissions": {
"deny": [
"Read(.env*)",
"Bash(git push --force *)"
]
}
}
Each teammate can still override it for themselves in their own .claude/settings.local.json — project local sits above shared project. And Claude Code keeps the local file out of git for you: the first time it writes the file in a repository that doesn’t already ignore it, it adds **/.claude/settings.local.json to your global git excludes. If you created the file by hand before Claude Code ever wrote to it, add it to .gitignore yourself.
When a setting doesn’t apply: troubleshooting
Sooner or later you will set a key and Claude Code will behave as if you hadn’t. Work through this list in order.
Check what actually loaded
Run /status and read the Setting sources line — it lists every file Claude Code loaded for the session. If your file isn’t listed, it didn’t load. Run claude doctor from your terminal to list the entries Claude Code rejected and why.
A value you set is ignored
Something else is setting the same key at a higher level, the file can’t set that value, or the file is broken. The usual culprits: a managed setting you can’t override, a --settings flag or ANTHROPIC_MODEL export from an earlier terminal session, defaultMode values that only work from user or managed settings, or a key that needs folder trust before it applies from a committed file.
The file is broken
Invalid JSON or a value the schema rejects produces a Settings Error at the start of an interactive session, with a dialog that lets you fix the file with Claude’s help, exit, or continue without the broken settings. If only individual entries fail — a malformed permission rule, an unknown hook event name — you get a Settings Warning instead: Claude Code skips those values and keeps the rest of the file in effect. A -p run shows no dialog and silently skips the broken file; run claude doctor afterwards to see what it dropped.
Your change doesn’t survive a restart
A few keys are read once at session start — model and outputStyle are the ones you will meet most. Editing them mid-session does nothing until the next session; use /model or /effort to change them live. And if a choice you saved inside Claude Code vanishes in new sessions, check whether something else generates your user file — if another tool writes ~/.claude/settings.json or links it to a read-only copy, Claude Code’s write goes nowhere.
Five mistakes everyone makes once
- Writing comments in settings files. They are strict JSON. A
//comment or a trailing comma is a syntax error, and the whole file gets skipped. Keep your notes in yourCLAUDE.mdinstead. - Editing
~/.claude.json. That file is Claude Code’s own state — account details, MCP servers, trust decisions. Edit the settings files; leave~/.claude.jsonalone. - Putting
defaultMode: bypassPermissionsin the project file. It silently does nothing there. It belongs in user or managed settings, or as a--permission-modeflag for one session. - Committing
settings.local.json. It is yours, not the team’s. Let Claude Code add it to your global git excludes, or add it to.gitignoreif you created it by hand. - Expecting the team file to just work for everyone.
allowrules and mostenvvalues in a committed file wait until each teammate trusts the folder. Tell the team to run/statusand trust the folder — or they will keep seeing prompts and assume the file is broken.
Claude Code settings look scattered until you see the shape: four files, one stack, and a handful of keys that do the real work. Set your user file once, commit a thin team file, keep your secrets in deny, and check /status whenever reality disagrees with your config. The rest is just JSON.
Last updated: 18 November 2026. All settings behaviour in this guide was verified against Anthropic’s official Claude Code settings documentation on the date of publication.
Further Reading & References
- Anthropic — Claude Code Settings Files and Precedence — the official documentation: the four files, the precedence stack, per-session overrides, and troubleshooting.
- WotAI — Claude Code settings.json: every scope and which file wins — a worked walkthrough of the scopes, verified against the official docs on 11 November 2026.
- AI Parabellum — Claude Code settings.json Location Explained — where each file lives, when Claude Code creates them, and how it picks a winner.
- AI Parabellum — Claude Code Settings Files Explained — a demo-project test of all three editable files, with Claude Code 2.1.310.
- The AI Architects — Claude Code Settings: settings.json Explained (2026) — the settings that matter on day one, including the permissions and hooks keys.
- HowToShipIt — Claude Code Hooks Explained: 7 Practical Examples You Can Copy — the hooks key in action.
- HowToShipIt — Claude Code Slash Commands: Built-Ins Worth Knowing and Custom Commands That Save Hours — the other half of customising Claude Code.
- HowToShipIt — How to Use AGENTS.md in Any Repo — standing instructions for Claude Code, the companion to settings.


