
Is your Claude Code settings.json not working? The two most common causes are a file that isn’t valid JSON and a value that a higher-priority file overrides. A single // comment or trailing comma makes Claude Code skip the whole file, and a key in .claude/settings.local.json beats the same key in .claude/settings.json or ~/.claude/settings.json.
The quick fix: run claude doctor in your terminal. If it lists your file under Invalid settings, remove comments and trailing commas and start Claude Code again. If the file is valid, run /status inside a session and check the Setting sources line, then look for the same key in a higher-level file, a --settings flag, an environment variable such as ANTHROPIC_MODEL, or your organization’s managed settings.
We reproduced each of these in a real session below: a broken file, a skipped permission rule, a local file overriding the shared one, and a command-line override.
Browse all our Claude Code tutorials for more fixes and how-tos.
Tested with Claude Code v2.1.332 on macOS on November 29, 2026. We used a throwaway demo project called team-app with a README and a .claude folder, and started Claude Code with project and local settings only so our personal setup stayed out of the test.
We tested on macOS; the Windows and Linux steps follow Anthropic’s official instructions. The file names and rules are the same there, except that ~/.claude means %USERPROFILE%\.claude on Windows.
Quick Summary
| Cause | How to spot it | Fix | Tested by us? |
|---|---|---|---|
| Invalid JSON (comment, trailing comma) | Settings Error at start, claude doctor | Make it strict JSON | Yes |
| One bad entry (malformed rule) | Settings Warning at start | Fix that entry; rest still works | Yes |
| A higher file sets the same key | /status, startup header | Change the winning file | Yes |
--settings flag | Only that session differs | Drop the flag | Yes |
| Environment variable or flag | echo $ANTHROPIC_MODEL | Unset it | From the docs |
| Managed settings | Managed source in /status | Ask your admin | From the docs |
| Key the file can’t set | Value ignored with no error | Move it to user settings | From the docs |
| Key read only at start | Edit has no effect mid-session | Restart, or use /model | From the docs |
Why Claude Code settings.json Is Not Working
Claude Code reads settings from up to four files plus any managed settings your organization sends. If you are not sure where each file lives, our guide on finding settings.json walks through every location.
Anthropic’s settings documentation lists the scopes:
- User:
~/.claude/settings.json, for you in every project. - Shared project:
.claude/settings.json, committed so the whole team gets it. - Project local:
.claude/settings.local.json, for you in this one project. - Managed:
managed-settings.json, MDM policies or server-managed settings from your organization.
When a setting seems ignored, one of three things is usually true. The file did not load, another level sets the same key, or that file is not allowed to set that key. The ladder below puts the checks in the order that saves the most time.

Cause 1: Invalid JSON Makes Claude Code Skip the Whole File
Settings files are strict JSON. The docs are direct about it: a // comment or a trailing comma is a syntax error. That catches a lot of people, because many editors and other tools accept comments in their own JSON config files.
To see it for real, we gave team-app a shared settings file with a comment on the second line and two trailing commas. Then we ran claude doctor, which prints read-only diagnostics without starting a session.

Next we started claude in the same folder. Before anything else, it showed a Settings Error dialog naming the file and the exact spot, line 2, column 3, which is where our comment began.

Note the gray line under the path: files with errors are skipped entirely, not just the invalid settings. So one stray comma switches off every key in that file, including your permission rules, hooks and model.
A broken settings file is not partly applied. It is skipped completely, so check that it loads before you change any values.
How to fix invalid settings JSON
- Pick one of the three options in the dialog. Fix with Claude lets Claude repair the file, Exit and fix manually closes Claude Code, and Continue without these settings starts the session with that file switched off.
- Delete every
//or/* */comment. JSON has no comments, so put notes in a README instead. - Remove the comma after the last item in every list and object.
- Check that all keys and string values use double quotes.
- Run
claude doctoragain. When the Invalid settings section is gone, the file is clean.
Here is our fixed file. It is the same content, just valid JSON:
{
"model": "haiku",
"permissions": {
"allow": ["Bash(ls)"]
}
}To catch mistakes while you type, add the schema line from the docs at the top of the file: "$schema": "https://json.schemastore.org/claude-code-settings.json". Editors that support JSON schema, such as VS Code, then show autocomplete and warnings. The docs note that the schema can lag behind new releases, so a warning on a brand-new key does not always mean it is wrong.
Cause 2: One Bad Entry Is Skipped, the Rest Still Works
Not every mistake breaks the whole file. If the JSON is valid but one entry is wrong, such as a malformed permission rule, Claude Code shows a Settings Warning instead and skips only that entry.
We tested it by adding a second allow rule, "Bash(ls) x", which has extra text after the closing parenthesis.

The warning explains the rule format: rules look like Tool or Tool(content) and must end at the closing parenthesis. Our valid Bash(ls) rule and the model setting kept working.
If a permission rule seems ignored, this warning is the first thing to look for. Our guide to Claude Code permissions covers the full rule syntax.
Broken settings in claude -p runs
Scripts and CI jobs that use claude -p never see a dialog, so a broken file can slip by unnoticed. The docs say a -p run skips the broken file or entries and carries on, printing the problems to stderr.
We broke our local file on purpose with a trailing comma and ran one short prompt. The answer, OK, still came back, but stderr listed both problems first.

If you pipe stderr away in a script, you lose this message. Run claude doctor after any -p run that behaves oddly.
Cause 3: A Higher-Priority File Sets the Same Key
When the same key appears in more than one place, Claude Code uses the value from the highest level that sets it. Here is the order from the docs, highest first.

So your personal ~/.claude/settings.json is at the bottom. If the team’s shared file sets a key, the team value wins in that project, even though the file is “just” a project file.
We tested it: project file vs local file
With the fixed shared file setting "model": "haiku", we started Claude Code. The startup header showed Haiku 5.5, and a line under it named the exact source: Using Haiku 5.5 (from .claude/settings.json).

Then we created .claude/settings.local.json with "model": "sonnet" and started again. The session opened on Sonnet 5.5, because project local sits above shared project.

This works in reverse too. If your shared or personal setting seems to do nothing, open .claude/settings.local.json in that project. Claude Code writes allow rules there when you pick “Yes, and don’t ask again”, so the file may exist even if you never created it.
Confirm which files loaded with /status
Run /status inside Claude Code and look at the Setting sources line. It lists each settings file that loaded for the session.

In our run it read Shared project settings, Project local settings, matching the two files in team-app. User settings did not appear because we started our test sessions with project and local settings only. The docs add one caution: this line shows which files were read, not which file supplied each key.
If you expect a file and it is missing from the list, check two things. Claude Code reads the shared .claude/settings.json from the folder where you start the session, so launch claude from the project root. And a file with a Settings Error that you chose to continue past is not in effect.
Lists merge instead of overriding
Lists behave differently. If permissions.allow appears in several files, Claude Code combines them instead of picking one. We saw that in /permissions: the Allow tab held Bash(git status) from our local file and Bash(ls) from the shared file.

The docs name a few keys that don’t merge this way: fallbackModel, modelPicker, availableModels and modelSettings follow their own rules. One more surprise from the docs: an allow rule in your local file doesn’t outrank an ask rule from a project or managed file, so you can still be prompted after choosing “don’t ask again”.
Cause 4: A Command-Line Flag or Environment Variable Wins
A setting can also come from the way you start Claude Code. The --settings flag takes JSON or a file path and sits above every settings file except managed.
We started a session with claude --settings '{"model": "opus"}'. Both files still asked for Haiku and Sonnet, yet the session opened on Opus 5.5.

The flag lasts one session and writes nothing to disk. If a shell alias, wrapper script or IDE launch setting adds --settings or --model, every session overrides your files and it looks like settings.json is broken.
Environment variables are not a level in the stack. The docs say each variable is paired with its key one by one. For example, ANTHROPIC_MODEL exported in your shell beats the model key from any file, while ANTHROPIC_DEFAULT_MODEL applies only when no file sets model. Check your shell with these commands:
echo $ANTHROPIC_MODEL
env | grep -E '^(ANTHROPIC|CLAUDE)_'
unset ANTHROPIC_MODELThen remove the export from ~/.zshrc or ~/.bashrc so it doesn’t come back. Our guide to environment variables lists the common ones.
Cause 5: Managed Settings, Key Scope and Restarts
These last causes come from the official docs. We didn’t reproduce them because they need an organization policy or would change a real setup.
Your organization’s managed settings
Managed settings sit at the top. Nothing in your own files or --settings overrides a managed key.
Run /status: when managed settings apply, the Setting sources line names the managed source. The only fix is asking your administrator. If managed settings fail to arrive, our fix for managed settings errors helps.
The docs also list a few security keys where Claude Code honors a stricter value from a lower level, such as disableClaudeAiConnectors set to true in any file. If one of those stays on no matter what you set, that is expected.
The file is not allowed to set that key
Some keys never apply from certain files. According to the docs, permissions.defaultMode values auto and bypassPermissions don’t take effect from project or local settings; set them in user settings or pass --permission-mode. Telemetry export variables in an env block don’t take effect from project files either.
Each key’s entry in the settings reference has a Scope line. If it says User, User or managed, Managed or Global config, a value in your shared .claude/settings.json is ignored. Global config keys apply only from ~/.claude.json, which /config writes for you.
The key waits for trust or a restart
In a shared file, permissions.allow rules, additionalDirectories and most env values apply only after you trust the folder. deny and ask rules apply right away.
Claude Code watches settings files and reloads most edits without a restart, including permissions and hooks. A few keys are read only at session start: model, effortLevel and modelSettings. Use /model or /effort mid-session, or start a new session.
Real Examples of Claude Code settings.json Not Working
| What you see | Likely cause | What to do |
|---|---|---|
| All your settings vanished at once | Invalid JSON in that file | Run claude doctor, fix the syntax |
| Wrong model in one project only | model in shared or local file | Check the startup header and both files |
| Wrong model everywhere | ANTHROPIC_MODEL exported | unset ANTHROPIC_MODEL |
| Still prompted after “don’t ask again” | ask rule in a project or managed file | Check /permissions |
| Teammates don’t get your committed rule | Folder not trusted, or key is user-only | Trust the folder; check the key’s scope |
/model choice gone next time | ~/.claude/settings.json not writable | Make the file writable |
That last row is from the docs too: if another tool generates your user file or links it to a read-only copy, changes last only for the current session. Our page of settings.json examples has working files you can copy.
Try It Yourself
Make a throwaway folder with a .claude folder inside, add a settings file with a deliberate trailing comma, and run claude doctor. Then fix it, add a settings.local.json with a different model, and watch the startup header change.
If you would rather let Claude check an existing file, start a session in the project and paste this prompt:
Read .claude/settings.json and .claude/settings.local.json in this project.
Tell me if either file has invalid JSON, and list any key that appears in both
files with the value that wins. Do not change anything.Common Mistakes
- Adding comments to
settings.json. They break the whole file. - Leaving a trailing comma after the last rule in a list.
- Choosing Continue without these settings and forgetting the file is now off.
- Editing
~/.claude/settings.jsonwhen the project’s shared or local file sets the same key. - Starting Claude Code in a subfolder and expecting the shared file at the repository root to load.
- Putting
defaultModeset toautoin a project file, where the docs say it does not take effect. - Assuming the Config tab in
/configshows yoursettings.json. The docs say it does not.
Pro Tips
- Use
claude --settings '{"key": value}'to test a value for one session before saving it. - Keep personal overrides in
.claude/settings.local.jsonso you never need to edit the team file. - Add
"$schema"to every settings file to catch typos in the editor. - Run
/doctorinside a session for a fuller checkup that can propose fixes. Our doctor guide explains the output. - If nothing makes sense, the docs describe a clean-configuration test with
CLAUDE_CONFIG_DIRpointed at an empty folder and--setting-sources user, so you can add files back one at a time. - For other startup trouble, check our list of common errors.
Cheat Sheet

Frequently Asked Questions
Why is my Claude Code settings.json not working?
Usually the file has invalid JSON, so Claude Code skips it, or another file sets the same key at a higher level. Run claude doctor first, then /status to see which files loaded.
Can I put comments in Claude Code settings.json?
No. Settings files are strict JSON, and a // comment is a syntax error that makes Claude Code skip the whole file.
Which wins, settings.json or settings.local.json?
.claude/settings.local.json wins over .claude/settings.json, and both win over ~/.claude/settings.json. Managed settings and --settings beat all three.
Do I need to restart Claude Code after editing settings.json?
Mostly no. Claude Code reloads settings files when they change. Keys read only at start, such as model and effortLevel, need a new session or /model and /effort.
How do I see which settings file Claude Code is using?
Run /status and read the Setting sources line. For a model set by a project or managed file, the startup header also names the file.
Conclusion
When Claude Code settings.json is not working, check that the file loaded before you change any values: claude doctor and the Settings Error dialog showed us that one comment and a trailing comma switched off our entire file, while a single malformed rule only cost that one entry. Once the file is valid, follow the precedence stack, because in our tests a local file beat the shared file and a --settings flag beat both, and the docs add environment variables, managed settings, key scopes and start-only keys to the list of suspects. With /status, the startup header and /permissions, you can see exactly what Claude Code is using. For more on Claude itself, see our Claude AI overview.


