LESSON · 1 OF 3

The settings hierarchy

The settings hierarchy

Claude Code reads its configuration from JSON settings files. There are three places they live, and each one has a clear job.

The three files

FileScopeCommitted to git?
~/.claude/settings.jsonYour user defaults, every projectNo, it is your home dir
.claude/settings.jsonThis project, shared with the teamYes, commit it
.claude/settings.local.jsonThis project, just youNo, it is gitignored

The user file holds your personal defaults. The project file holds settings the whole team should share, so you commit it. The local file holds your own overrides for that project, and Claude keeps it out of git so your private tweaks never land in a pull request.

What goes inside

All three use the same shape. Common keys:

json
{
  "model": "sonnet",
  "permissions": {
    "allow": ["Bash(git status:*)", "Read", "Edit"],
    "deny": ["Bash(rm:*)"]
  },
  "env": { "MY_FLAG": "1" },
  "hooks": { }
}
  • model picks which Claude model runs.
  • permissions.allow and permissions.deny are lists of rule strings that decide which tools run without asking.
  • env sets environment variables for the session.
  • hooks wires shell commands to events.

How they combine

More specific scopes override broader ones. The local file wins over the project file, and the project file wins over your user file. So a team can set a shared model in .claude/settings.json, and you can quietly override just that value for yourself in .claude/settings.local.json without touching what everyone else sees.


Your lab setup

This VM comes with Claude Code preinstalled and signed in - just run claude to start.

Spin up a fresh environment and practice live.
claude-code-ubuntu · fresh machine · ready in under a minute