Rolling Out Claude Code to a Team: Settings Precedence, dontAsk in CI, a Hook for Every-Time Rules and a Plugin for Five Repos
A platform team puts Claude Code into five repositories on Monday. Settle four things first: which settings file wins, how a CI run works with nobody to approve, which extension fits a team habit, and how one setup reaches every repo.
What you will learn
- Predict which settings file wins, and why permission lists add up across files
- Run Claude Code in CI with dontAsk and an allowlist instead of bypassing checks
- Pick a hook for a rule that must always hold, and a plugin for a setup shared by many repositories
- Check a plugin marketplace file before you ship it
Before you start
- What Claude Code is
- Choosing a Claude Code extension
A platform team has a good problem. Claude Code goes live in five repositories on Monday, and the lead's message is short: roll it out the same way everywhere.
Each repository has its own committed settings. Developers keep personal files too, and the company has a policy. Before Monday, four things need an answer:
- When two settings files disagree, which one wins?
- How does a pipeline run Claude Code with nobody there to say yes?
- Which extension fits a team habit?
- How does one setup reach every repository, with its updates?
The settings stack
What each file is for (CLAUDE.md advises, settings.json enforces, a plugin packages) is covered in CLAUDE.md, settings.json and plugins. This walk-through is about rolling them out to a whole team.
Settings come from several levels. A higher level wins.
- Managed settings are deployed by the organization. Nothing overrides a managed key, not even the settings flag.
- The command-line settings flag lasts for one session and sits just below managed.
- The project local file holds your own overrides for this repository.
- The shared project file is committed, so everyone who clones the repo gets it.
- The user file applies in every project, at the bottom.
One exception: lists, such as the allow and deny rules, merge across files. They add up instead of replacing each other. In real Claude Code, the status command shows which settings sources loaded.
stack.py: the stack as a tiny stand-in
The example project models the stack in plain Python, with no model at all, so you can see the rule work. These are the four files:
// managed/managed-settings.json
{ "spinnerTipsEnabled": true,
"permissions": { "deny": ["Bash(git push *)"] } }
// .claude/settings.local.json (project local)
{ "spinnerTipsEnabled": false,
"permissions": { "defaultMode": "plan", "allow": ["Bash(npm run lint)"] } }
// .claude/settings.json (shared project)
{ "spinnerTipsEnabled": false,
"permissions": { "defaultMode": "acceptEdits",
"allow": ["Bash(npm test)"], "deny": ["Read(./.env)"] } }
// home/.claude/settings.json (user)
{ "model": "sonnet",
"permissions": { "defaultMode": "default", "allow": ["Read"] } }
ORDER = [
"managed", "command line", "project local", "shared project", "user",
]
def resolve(key, cli=None):
for level in ORDER:
value = dig(load(level, cli), key)
if value is not None:
return value, level
return None, "nowhere"
def merged(key):
rules = []
for level in ORDER:
rules += dig(load(level), key) or []
return rules
resolve() walks the list from the top, and the first level that sets the key wins. merged() does the opposite for a list key: it adds every level together.
settings precedence
defaultMode -> plan (project local)
defaultMode -> dontAsk (command line)
spinnerTipsEnabled -> True (managed)
model -> sonnet (user)
lists merge
allow: Bash(npm run lint), Bash(npm test), Read
deny: Bash(git push *), Read(./.env)
The default mode comes from the developer's own project local file. Pass a settings flag and the command line wins for that session. The tips key comes from managed, so both project files that set it to false lose. The model comes from the user file, because nobody higher sets it. And the allow and deny rules from every file are all in force together.
Decision 1: one developer wants plan mode
The committed settings set the default mode to acceptEdits. One developer wants plan mode for herself, in this repository only. It goes in the project local file. It is hers alone and sits above the shared file. The committed file would change it for every teammate, the user file is too low to beat the team's value, and managed settings would change policy for the whole organization.
Decision 2: CI runs with nobody to approve
A pipeline step runs Claude Code with the print flag to review pull requests. Nobody can answer a prompt. It may read files and run the test command, and nothing else.
The fit is dontAsk mode with an allowlist of read and the test command. dontAsk denies everything that isn't pre-approved, which is exactly what a locked-down pipeline needs. Here is the stand-in for what each mode does with one call:
def decide(mode, call, allow, deny):
if call in deny:
return "denied (deny rule)"
if mode == "bypassPermissions":
return "runs (no checks)"
if call in allow:
return "runs (allowed)"
return "denied (not pre-approved)"
claude -p in CI
dontAsk: npm test -> runs (allowed)
dontAsk: npm publish -> denied (not pre-approved)
dontAsk: git push * -> denied (deny rule)
bypassPermissions: npm publish -> runs (no checks)
bypassPermissions: git push * -> denied (deny rule)
The test command runs because it was pre-approved. Publish is denied because nobody approved it. A deny rule holds in every mode, bypass included. But look at the fourth line: bypass lets publish run, because it turns the checks off. It belongs only in an isolated container. The default mode with no rules would deny even the test command, and plan mode is for exploring a codebase before changes; it gives the run no allowlist. The review job itself is covered in a Claude Code review bot in CI.
Decision 3: a rule that must hold every time
Every file Claude edits must be formatted, every time, no exceptions. A line in CLAUDE.md is sometimes skipped. The fix is a hook that runs the formatter after each edit. A hook fires on its event without Claude deciding. A skill is instructions that Claude chooses whether to apply. A subagent isolates context for a side task and guarantees nothing runs. A slash command depends on people remembering to type it.
The demo prints the choice for five team habits:
extension choice
hook format every file after each edit, no exceptions
skill our release checklist, run when someone asks
subagent read forty files, report only the findings
CLAUDE.md build and test commands every session must know
plugin the same setup in five repositories
The full decision guide is in choosing a Claude Code extension.
Decision 4: one setup, five repositories
The team built a review skill, a format hook and a test subagent. All five repositories need the same setup and its updates, from one place. Package them as a plugin in a marketplace, and declare it in each repository's committed project settings. A plugin bundles skills, hooks and subagents as one unit, and the marketplace delivers updates.
The alternatives drift. Hand copies mean a fix in one repo never reaches the other four. CLAUDE.md holds context and cannot define a hook. Asking each developer to install leaves no single place, so someone always misses an update.
{
"name": "acme-tools",
"description": "Plugins for the Acme platform team",
"owner": { "name": "Acme Platform Team" },
"plugins": [
{ "name": "team-kit",
"source": "./plugins/team-kit",
"description": "Review skill, format hook and test subagent" }
]
}
The project also has a miniature version of what claude plugin validate checks: the marketplace needs a name, an owner and a plugin list, a source must not climb out with .., and each entry's name must match the plugin's own manifest.
marketplace check
acme-tools: ok
renamed: ['teamkit: manifest name is team-kit']
Rename the entry to teamkit and the check catches it, because the plugin's plugin.json still says team-kit. Run the real validator before you ship a marketplace change.
Common mistakes
- Putting a personal preference in the committed file, so every teammate gets it.
- Expecting a project file to override a managed key.
- Thinking a lower file's allow rule disappears. Lists merge.
- Using
bypassPermissionsin CI because "nobody can answer anyway". - Writing an every-time rule as a line in CLAUDE.md instead of a hook.
- Copying the same
.claudefolder into five repos by hand.
Recap
| Question | Answer |
|---|---|
| Which setting wins? | The highest level that sets it; managed is never overridden; lists merge |
| Where does a personal tweak go? | The project local file |
| How does CI run? | -p with dontAsk and an allowlist; deny rules hold in every mode |
| A rule that must always hold? | A hook |
| The same setup in many repos? | A plugin from a marketplace, declared in each committed project file |
Try it yourself
Add "model": "opus" to the shared project file and predict what resolve("model") returns before you run it. Then add Bash(npm publish) to the managed deny list and work out which of the five CI lines change.
Related course on Udemy
Claude Certified Developer - Foundations (CCDV-F) Exam Prep
Build and ship Claude apps: the API, agents, tools and MCP, prompts, evals, security and model choice.View on Udemy ↗: Claude Certified Developer - Foundations (CCDV-F) Exam Prep (paid course, opens in a new tab)Related posts
CLAUDE.md, settings.json and Plugins: Which Claude Code File Advises, Which Enforces, Which Packages
Three needs in one repo: a test command, a rule that Claude must never read .env, and a shared deploy skill. See which file each belongs in, how the settings layers merge, and what a plugin manifest carries.
Authoring a Claude Skill: SKILL.md, Frontmatter, Progressive Disclosure and the Description That Triggers It
Pack a support team's ticket-triage routine into one skill folder, then watch three requests load one, two or all three levels: the catalog, the SKILL.md body, and a script whose code never enters the context.
One Change, Four Environments: Where a Claude Config Edit Lands in Dev, Staging, Prod and CI
Change one line in a repo and ask where it lands. A small resolver for bookshop-bot shows that a new model id in settings.json reaches only CI, a prompt bump reaches dev and CI, and a prod block edit reaches only prod.
Claude in the SDLC: Prompts in Git, a Change Gate by Path, a Claude Review That Advises and a Person Who Merges
Follow one prompt edit from a branch to a merge: version prompts and the model pin like code, keep the API key in GitHub Secrets, gate changes by path, let Claude review the diff, and leave the merge to a person.