Skip to content
,

Claude Code Settings Guide: settings.json Files, Precedence and Examples (2026)

8–12 minutes
Woman in a hijab at a whiteboard holding a tablet with a CLAUDE CODE SETTINGS card, hook set it once works everywhere

Claude Code settings live in plain JSON files called settings.json. They decide which model a session starts with, which commands Claude can run without asking, which files it must never read, how the terminal looks and which hooks and plugins load.

The tricky part is not the keys themselves but where you put them. The same key can sit in four different files, and the file you choose decides who the setting affects and whether it wins.

This guide explains every settings file, the precedence order, how to change a setting with /config, a file or a one-session flag, ready-to-copy examples for you and your team, and fixes for settings that do not apply. It follows Anthropic’s official Claude Code documentation as of December 2026.

TL;DR

  • Personal, all projects: ~/.claude/settings.json
  • Team, committed to git: .claude/settings.json in the project
  • Personal, one project: .claude/settings.local.json (kept out of git)
  • Precedence: managed > --settings > project local > shared project > user.
  • Lists merge: permissions.allow from every file is combined, not replaced.
  • Check: run /status to see which files loaded, and claude doctor for rejected entries.

The Four Settings Files

Claude Code reads settings from four files, and an organization can deliver a fifth layer of managed settings. Each file has a scope: the people and projects a setting saved there applies to.

Scope File Who it affects Use it for
User ~/.claude/settings.json You, in every project on this machine Theme, editor mode, default model, your own permission rules
Shared project .claude/settings.json Everyone in that project once committed Team permissions, hooks, plugins, project environment variables
Project local .claude/settings.local.json You, in one project only Personal overrides and testing before you share
Managed managed-settings.json, MDM or the claude.ai console Everyone your organization deploys it to Security policy and compliance

In the table, ~/.claude is the .claude folder in your home directory, while a bare .claude means the folder inside your project. On Windows, ~/.claude is %USERPROFILE%\.claude. You can move the home folder with the CLAUDE_CONFIG_DIR environment variable.

There is also ~/.claude.json. Claude Code writes it for itself to store account details, MCP server configurations and per-project trust decisions. You normally do not edit it by hand. If you are new to Claude Code, start with our Claude Code install guide.

Find or Create Your Settings Files

Installing Claude Code does not create any settings file. If one already exists, it came from one of these places:

  • User file: Claude Code writes ~/.claude/settings.json the first time you save a user setting, such as a theme from /config.
  • Project local file: Claude Code writes .claude/settings.local.json when you pick “Yes, and don’t ask again” on a permission prompt. It saves that approval as an allow rule.
  • Shared project file: a teammate may have committed .claude/settings.json. If not, create it yourself.
  • Managed file: your organization deploys it. You do not create or edit it.

To create a file by hand:

  1. Create the folder if needed: mkdir -p ~/.claude for the user file, or mkdir -p .claude inside your project.
  2. Create settings.json and start with the schema line so your editor can autocomplete keys:
    {
      "$schema": "https://json.schemastore.org/claude-code-settings.json"
    }
  3. Add the keys you want, save, then run /status in Claude Code to confirm it loaded.

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.

Three Ways to Change a Setting

1. The /config menu

Run /config and open the Config tab. It lists a short set of personal options such as theme, editor mode and verbose output, not every key. Most choices are saved to ~/.claude/settings.json; output style is saved to .claude/settings.local.json. You can also set one option directly, for example /config verbose=true.

/config is part of the terminal interface. The VS Code panel and the desktop app use their own settings screens or the files directly.

2. Edit a settings file

This example lets Claude run lint and test commands without asking and blocks it from reading .env files:

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

Each entry under permissions names a tool and what it may do. Our Claude Code Plan Mode guide covers the permission modes these rules work alongside.

3. One session only

  • --settings takes JSON inline or a file path: claude --settings '{"model": "claude-opus-5-5"}'. It sits above your files and below managed settings, and writes nothing to disk.
  • A flag for that key, such as --model for model or --effort for effortLevel.
  • An environment variable, such as ANTHROPIC_MODEL for model.

Commands inside a session usually save your choice: /model stores your pick as the default for new sessions. Press s in the /model picker to switch without saving. All slash commands are listed in our Claude Code commands cheat sheet.

Settings Precedence Explained

When the same key is set in more than one place, Claude Code uses the value from the highest level, from top to bottom:

  1. Managed settings: nothing in your files or --settings overrides a managed key.
  2. Command line: JSON passed with --settings, for one session.
  3. Project local: .claude/settings.local.json.
  4. Shared project: .claude/settings.json.
  5. User: ~/.claude/settings.json.

Environment variables are not a level in this stack. Each variable and key pair has its own rule: an exported ANTHROPIC_MODEL beats the model key from any file, while ANTHROPIC_DEFAULT_MODEL only applies when no file sets model.

Lists merge instead of overriding

List keys such as permissions.allow are combined across files, so each file can add rules without deleting another file’s rules. A few model keys follow their own rules: fallbackModel takes the whole chain from the highest file that defines it, and managed availableModels replaces your entries.

Worked example

You set "spinnerTipsEnabled": false in your user file, but your team’s committed file sets it to true. The project value wins in that project. To get your value back only for yourself, add "spinnerTipsEnabled": false to .claude/settings.local.json, because project local sits above shared project.

Strict security keys

For a few restrictive keys, Claude Code honors the stricter value from a lower file even over managed settings. For example, disableClaudeAiConnectors: true from any file stays on, and a lower maxEffortLevel cap from any scope applies.

Example settings.json Files

Personal file

Adapted from Anthropic’s own example, this picks a model and effort, turns on vim mode, hides spinner tips and pre-approves a read-only command:

{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "model": "claude-sonnet-5",
  "modelSettings": {
    "claude-sonnet-5": { "effortLevel": "xhigh" }
  },
  "editorMode": "vim",
  "theme": "light-daltonized",
  "spinnerTipsEnabled": false,
  "preferredNotifChannel": "terminal_bell",
  "permissions": {
    "allow": ["Bash(git diff *)", "Read(~/.zshrc)"]
  },
  "autoUpdatesChannel": "stable",
  "cleanupPeriodDays": 20
}

Team file

A simple committed .claude/settings.json that allows safe project commands and protects secrets:

{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "permissions": {
    "allow": ["Bash(npm run lint)", "Bash(npm run test *)", "Bash(git status)"],
    "deny": ["Read(./.env)", "Read(./.env.*)", "Read(./secrets/**)"]
  },
  "env": {
    "NODE_ENV": "development"
  }
}

Hooks also go in these files. See our Claude Code hooks guide for every event and ready-made recipes, and our status line guide for the statusLine key.

Useful Keys to Know

Key What it does
model Model every new session starts with
modelSettings / effortLevel Default effort level, per model
permissions.allow / ask / deny Rules for which tools and commands run without asking, need a prompt or are blocked
permissions.defaultMode Starting permission mode (auto and bypass only from user or managed files)
env Environment variables for every session
hooks Shell commands that run on Claude Code events
statusLine Custom line under the prompt
editorMode, theme Vim keys and colour theme
cleanupPeriodDays How long session data and checkpoints are kept
autoUpdatesChannel Update channel, such as stable
enabledPlugins Plugins turned on for the project

Claude Code’s system prompt is not a setting. For standing instructions, use a CLAUDE.md file or the --append-system-prompt flag.

When Changes Take Effect

Claude Code watches its settings files and reloads them on save, so most edits reach the running session with no restart, including permissions, hooks and credential helpers.

A few keys are read only at session start. The most common is model; use /model to switch mid-session. Effort is the same; use /effort. Managed settings from MDM or the claude.ai console arrive on a schedule, not on save.

Sharing Settings With a Team

  1. Put team rules in .claude/settings.json and commit it.
  2. Each teammate trusts the folder the first time they open it. Allow rules, extra directories, marketplaces and most env values wait for that trust step; deny rules apply at once.
  3. Personal exceptions go in .claude/settings.local.json. When Claude Code creates this file in a git repository, it adds **/.claude/settings.local.json to your global git excludes. If you create it by hand, add it to .gitignore yourself.

Some keys never apply from a repository file. Keys marked “User”, “User or managed”, “Managed” or “Global config” in the settings reference are ignored in the shared file.

Settings in Cloud Sessions

Claude Code on the web runs on a fresh clone of your repository. Your user and local files stay on your machine and are not read there. A committed .claude/settings.json is read in a single-repository session, and your organization’s server-managed settings also apply.

To change a value for a cloud session, set an environment variable on the cloud environment. More in our Claude Code on the web guide.

Troubleshooting

Settings Error at startup

The file has invalid JSON or a rejected value. Remove comments and trailing commas. Claude Code offers to fix it with Claude’s help, exit or continue without it.

Settings Warning

Only some entries failed, such as a malformed permission rule like Bash(ls) x. Claude Code skips those and keeps the rest. Run claude doctor for details.

A value I set is ignored

A higher level sets the same key, an environment variable overrides it, or the file cannot set that value. Run /status and check the Setting sources line.

bypassPermissions in my project file does nothing

The auto and bypassPermissions default modes do not take effect from project or local files. Use the user file, managed settings or --permission-mode.

My /model choice is lost in new sessions

Claude Code could not write ~/.claude/settings.json, often because another tool generates or symlinks it read-only. Make the file writable or set the key in that tool.

I still get prompted after “don’t ask again”

Your saved allow rule lives in the local file, and an ask rule from a project or managed file outranks it.

Teammates do not get my committed setting

They have not trusted the folder yet, or the key is one that repository files cannot set.

FAQ

Where is the Claude Code settings.json file?

Your personal file is ~/.claude/settings.json. Project files are .claude/settings.json and .claude/settings.local.json inside the project.

Can I add comments to settings.json?

No. The files are strict JSON, so comments and trailing commas cause a Settings Error.

Do VS Code and the desktop app use the same settings?

Yes. The terminal, the VS Code and JetBrains extensions and the desktop app all read the same settings files.

Do I need to restart after editing settings?

Usually not. Most keys reload on save. model and effort are read at session start, so use /model and /effort instead.

What is the difference between settings.json and ~/.claude.json?

settings.json holds the settings you edit. ~/.claude.json is Claude Code’s own state file with account details, MCP servers and trust decisions.

How do I see every available key?

Anthropic’s settings reference lists every key with its scope, default and an example. Adding the $schema line gives autocomplete in most editors.

How do I reset Claude Code settings?

Rename or delete the settings file for that scope, for example ~/.claude/settings.json, then start a new session. Keep a copy first so you can restore anything you need.

Sources

Free weekly email

Get new AI guides every week

One short weekly email with our newest local AI, ComfyUI and AI tool guides. No spam, no pop-ups, just the good stuff.

Free. Unsubscribe anytime in one click. We only use your email to send this newsletter. See our privacy policy.

Woman in a hijab at a whiteboard holding a tablet with a CLAUDE CODE SETTINGS card, hook set it once works everywhere