OmniscioSettings examplesA team project
Claude Code settings.json example for a team project
A team file has one job: give everyone the same starting point without taking away their ability to disagree. This is the whole file, every key explained, the exact place it goes, the checks that prove it loaded, and the trust rule that makes half of it look broken on a fresh clone.
Checked against Anthropic’s Claude Code 2.1.332. By the Omniscio team. Updated .
Who this file is for
A repository several people work in, where the same few commands should stop asking. You run tests and linters all day, nobody wants a prompt for each one, and nobody wants Claude pushing to a shared branch on its own. The file is committed, so it is also the place to say what a teammate should never be able to read.
If you are alone on the machine, the solo power-user file reaches every project without a commit. If your organization owns the machine, policy belongs in a managed file instead: see the locked-down enterprise file.
The file
Copy this to .claude/settings.json in the repository root. It is strict JSON, so it carries no comments and no trailing commas; a // comment is a syntax error and Claude Code reports the file as a Settings Error at the next start.
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"permissions": {
"allow": [
"Bash(npm run *)"
],
"ask": [
"Bash(git push *)"
],
"deny": [
"Read(./.env)",
"Read(./.env.*)",
"Read(./secrets/**)",
"Bash(rm -rf *)"
],
"defaultMode": "acceptEdits"
},
"sandbox": {
"enabled": true,
"filesystem": {
"allowWrite": [
"/tmp/build"
]
},
"network": {
"allowedDomains": [
"registry.npmjs.org"
]
}
},
"extraKnownMarketplaces": {
"your-org-tools": {
"source": {
"source": "github",
"repo": "your-org/claude-plugins"
}
}
},
"enabledPlugins": {
"code-formatter@your-org-tools": true
},
"plansDirectory": "./plans"
}Replace your-org with the GitHub organization that holds your plugin marketplace. If you have no marketplace yet, delete the extraKnownMarketplaces and enabledPlugins blocks. If you do not want plan files kept in the repository, delete the plansDirectory line.
What every key does
| Key | What it does here | Scope Anthropic gives it |
|---|---|---|
$schema | Points your editor at the published JSON schema for Claude Code settings, which gives autocomplete and inline validation. The schema can lag a release, so a warning on a new key does not make your file invalid | Not a setting; it is editor metadata |
permissions.allow | Approves every command that starts with npm run without asking. A rule is Tool or Tool(specifier) | Any file; in a committed file it waits for workspace trust |
permissions.ask | Prompts before git push even in a mode that would otherwise approve it | Any file |
permissions.deny | Blocks reads of .env, .env.* and everything under secrets/, and blocks rm -rf commands. Claude Code also leaves the matching files out of search results | Any file; applies in every session, trusted or not |
permissions.defaultMode | Starts new sessions in acceptEdits, so file edits and a few filesystem commands such as mkdir and mv run without asking; every other Bash command still follows the rules above | Any file, but auto and bypassPermissions are ignored here in a project file |
sandbox.enabled | Runs Claude’s Bash commands inside an OS sandbox, so a command is held to the writable paths and allowed hosts you set. It has two limits. Claude can still retry a blocked command outside the sandbox, because allowUnsandboxedCommands defaults to true. On Linux or WSL2 it needs bubblewrap and socat; where those are missing, commands run unsandboxed unless you also set failIfUnavailable | Any file; macOS, Linux and WSL2, where Linux needs bubblewrap and socat |
sandbox.filesystem.allowWrite | Adds /tmp/build as a writable path. A sandboxed command can already write inside the working directory and the per-user temp directory | Any file |
sandbox.network.allowedDomains | Pre-approves registry.npmjs.org so installs do not stop on a host prompt. A wildcard such as *.example.com also matches subdomains | Any file |
extraKnownMarketplaces | Registers a plugin marketplace by name for anyone who opens the repository, instead of each person adding it | Any file; in a committed file it waits for workspace trust |
enabledPlugins | Switches one plugin on, keyed as plugin-name@marketplace-name. In a project file that switches it on for everyone; it does not install it | Any file |
plansDirectory | Keeps plan files inside the repository at ./plans instead of the default ~/.claude/plans | Any file |
Two entries in permissions.deny are weaker than they look, and the rest of this page turns on that. A Bash rule matches the command as Claude writes it, so Bash(rm -rf *) does not stop /bin/rm -rf or a command that builds the same string another way; the sandbox block is the real fence, as long as it is running and Claude does not retry outside it. And a Read deny rule covers the file tools and the commands Claude Code recognizes, such as cat and head, but not a subprocess that opens the file itself.
Which file this is, and what outranks it
This is the shared project file. Claude Code reads four settings files, plus any file passed with --settings, and this is the one that reaches everyone who works in the folder that contains it.
| Scope | File | Who it reaches |
|---|---|---|
| User | ~/.claude/settings.json | One person, in every project on their machine |
| Shared project | .claude/settings.json | Everyone in the folder, once the file is committed |
| Project local | .claude/settings.local.json | One person, in this project. Claude Code keeps it out of git when it creates the file; a copy you make by hand needs adding to .gitignore yourself |
| Managed | managed-settings.json and other managed sources | Everyone the organization deploys it to |
Strongest first, the order is managed settings, then JSON passed with --settings, then the project local file, then this shared project file, then the user file. Two details matter for a team. Lists combine instead of replacing, so your permissions.allow rules and a teammate’s local rules both apply. And a local allow rule does not outrank an ask rule from this committed file, so a teammate who approves something once can still be prompted.
A handful of keys never take effect from a repository file. A few of those can still be switched off from one, whatever value you write: Anthropic’s settings index marks each one with a scope such as User, local, or managed, User or managed, User, Managed or Global config. The settings.json location and precedence guide lists them, and if a key of yours is one of them, that is where it silently stops.
What a teammate gets after a clone
Not all of it reaches them. A committed file’s allow rules, additionalDirectories and extraKnownMarketplaces entries apply only after that person accepts the workspace trust dialog for the folder, and the dialog names that exact folder rather than a parent one. deny and ask rules apply in every session, trusted or not.
So the first session after a clone behaves like this: .env is already unreadable, git push already prompts, and npm run test still prompts until the trust dialog is answered. Nothing is broken; the file is doing exactly what Anthropic documents.
The plugin line is the one that surprises people. A plugin enabled in a project file is requested for everyone who trusts the folder, but the file cannot install it: each person still has to run claude plugin install code-formatter@your-org-tools --scope project on their own machine before it loads.
How to confirm it took effect
- Run
/statusand read theSetting sourcesline. An entry for the project’s shared settings file in that list means the file was read. The line does not say which file supplied a key. - Run
/permissionsto see the resolved allow, ask and deny rules in effect, which is the fastest way to see whether a rule survived the merge with a teammate’s local file. - Ask for something the file denies. A read of
.envor arm -rfcommand is refused rather than prompted, and that refusal is the file working. - If an entry is skipped, run
claude doctorfrom your terminal or/doctorinside a session. Both list rejected entries; an interactive session also warns you at startup with a Settings Warning.
You do not have to restart to pick up an edit. Claude Code watches its settings files and reloads most of them into the running session, including permissions. The keys read only at session start are the exceptions, and model is the one you are most likely to change.
The three common mistakes
The usual failure is not a typo. It is a commit that reads as a guarantee and is not one: the deny rules only apply where the file was read, and the sandbox only covers commands, so a teammate who starts in a subdirectory gets neither.
- Claude Code reads the shared project file from the directory the session starts in. A teammate who starts in
packages/api/does not read the root file at all, so the root’s deny rules do not apply there. For a repository shaped like that, see the monorepo file. - A pattern like
Read(./**/dist/**)matches the directory itself, so Claude cannot list it or change into it, which is usually the opposite of what you wanted. Anthropic’s own monorepo example ends each directory pattern with/**/*for that reason. - A committed
allowrule never beats a deny rule from any scope, and a rule in the wrong array does nothing.denyis evaluated first, thenask, thenallow, and the first match decides.
If you keep getting a rule wrong, the permissions builder writes the block for you and names the shapes Claude Code skips, and the power-user file shows the same keys at user scope, where trust does not apply.
Common questions
Where does a team Claude Code settings file go?
In .claude/settings.json at the top of the repository, committed. Claude Code reads it from the directory the session starts in, so a teammate who starts in a subdirectory does not get it. Everyone who clones the repository gets the file, and each person can still override a key in .claude/settings.local.json, which Claude Code adds to their global git excludes once it writes the file; a copy you make by hand needs adding to .gitignore yourself. Keys scoped User, local, or managed; User or managed; Managed; or Global config do not take effect from a repository file, and neither do the auto or bypassPermissions values of defaultMode. Permission lists combine rather than replace, so a local file adds rules instead of overriding the committed ones.
Why do my allow rules not work for a teammate?
Allow rules in a committed .claude/settings.json apply only after that person accepts the workspace trust dialog for the folder. Allow rules, additionalDirectories and extraKnownMarketplaces wait for trust; deny and ask rules apply in every session, trusted or not. The trust dialog names that exact folder, not a parent, so a teammate who clones into a parent folder that was already trusted is asked again.
How do I check that a team settings file loaded?
Run /status and read the Setting sources line: it lists each settings file the session loaded, such as the project’s shared settings file. It confirms which files were read and does not say which one supplied a key. For an entry Claude Code rejected, run claude doctor from your terminal or /doctor inside a session.
Where to go next
- The other four files in this library: a solo power-user setup, a locked-down enterprise policy, Bedrock or Vertex, and a monorepo.
- Team settings, end to end: what to commit, what never to, and onboarding one teammate.
- Managed settings: the file above this one in the precedence order, for policy your team cannot edit.
- Hooks: the other key a team file usually carries, and the trust rule it shares with this one.
Run the sessions side by side, settings included
Omniscio starts Claude Code sessions side by side and shows each one’s own transcript, so you can watch a shared settings file take effect in every session you open in that folder. The features page covers what it adds, and you can download it for Windows, macOS or Linux.