Put each Claude Code setting at the right scope
Pick the file and scope for a team's Claude Code needs (settings, permissions, MCP servers, CLAUDE.md, commands) and complete a shared configuration.
Scenario
A platform team gives 35 engineers Claude Code for a payments service. Two weeks later: half the team still gets asked before every test run, three people pasted an API token into the committed config, and Claude follows the "never push to main" rule most of the time.
Nothing was wrong with the tool. Each setting sat in the wrong file.
Explanation
Claude Code reads its configuration from several files. The file decides who a setting applies to, so the first question for any team need is: who should get this, and who may change it?
| Need | Where it goes |
|---|---|
| Team permissions, hooks, env for one repo | .claude/settings.json, committed |
| Your own override in one repo | .claude/settings.local.json, kept out of git |
| Your preferences in every repo | ~/.claude/settings.json |
| Policy nobody may loosen | Managed settings (admin console, MDM or managed-settings.json) |
| Team MCP servers | .mcp.json at the repo root, committed |
| Personal MCP servers | claude mcp add at local or user scope (~/.claude.json) |
| Team conventions for Claude | CLAUDE.md, committed; personal notes in CLAUDE.local.md, added to .gitignore (it isn't kept out of git by itself) |
| Team commands | .claude/skills/<name>/SKILL.md (or .claude/commands/), committed |
Five rules make the table work:
- Precedence: managed settings, then
--settingson the command line, then local, then shared project, then user. A managed key can't be overridden. - Lists merge.
permissions.allowfrom several files is combined, not replaced. - Permission rules run deny, then ask, then allow. The first match wins, so an allow rule can't carve an exception out of a deny.
- Secrets stay out of shared files.
.mcp.jsonexpands${VAR}inurl,headers,env,commandandargs, so the file names the variable and each developer sets the value. - CLAUDE.md is context, not enforcement. Keep it short (under 200 lines per file); subdirectory CLAUDE.md files load when Claude works there. Anything that must always hold belongs in permissions or a hook.
Worked example
Before. The payments repo's only configuration is a 450-line CLAUDE.md that includes "Never push to main", "Run tests with npm run test", one engineer's sandbox URL and an MCP setup guide with a token in it.
After. The rules move to where they are enforced or shared:
{
"permissions": {
"allow": ["Bash(npm run test *)"],
"ask": ["Bash(git push *)"],
"deny": ["Read(./.env)", "Read(./secrets/**)"]
}
}
That is .claude/settings.json, committed: tests run without a prompt, every push asks, and secret files can't be read. The tracker server moves into .mcp.json with "Authorization": "Bearer ${TRACKER_TOKEN}", the token is revoked, and the sandbox URL goes to that engineer's CLAUDE.local.md, which the team adds to .gitignore. CLAUDE.md shrinks to build, test and review conventions.