CertSafari
    Anthropic Claude Certified Architect – Professional (CCAR-P)· Lessons

    Domain 7 · Lesson 36/38

    Claude Code settings scopes, precedence and permission rules

    Configure Claude tools and environments for teams

    12 min read
    2.33% of exam
    4 sources
    Published 19 Oct 2026
    Docs as of 14 Oct 2026

    What you will be able to do

    • Pick the right settings file for a rule that is shared with the team, kept personal, or enforced by the organization
    • Predict which value applies when a key is set in several scopes, and explain why permission lists merge instead of replacing each other
    • Write allow, ask and deny rules and predict the outcome when a broad deny and a narrow allow both match
    • Decide whether a team convention belongs in CLAUDE.md or in settings

    Key concept

    Settings scope — Each Claude Code settings file has a scope, and the scope decides who the file reaches and how much weight its values carry. Managed settings come from the organization and sit above every file a developer controls. Below them are the shared project file that the team commits, the local file that stays with one developer, and the user file that applies across one developer's projects.

    1.Four settings scopes and who each one reaches

    When a team uses Claude Code, the first choice for any setting is which file it goes in. The same permission rule does different things depending on where you put it. Committed to the repository, it reaches every teammate. In your home directory, it stays on your laptop. Deployed by IT, nobody below can override it. Claude Code reads four scopes, and each one answers the question "who gets this?" differently.

    The four settings scopes, where each lives, and what it is for
    ScopeFileWho it affectsUse it for
    Managedmanaged-settings.json and other managed sourcesEveryone the organization deploys it toSecurity policy and compliance requirements
    Shared project.claude/settings.jsonEveryone working in the folder; commit it so teammates get itTeam permissions, hooks, plugins, and the environment variables the project needs
    Project local.claude/settings.local.jsonYou, in this one project onlyPersonal overrides for one project, and testing before you share
    User~/.claude/settings.jsonYou, in every project on this machinePersonal preferences such as theme, editor mode, default model

    For a platform team, the shared project file is the one that matters. .claude/settings.json lives in the repository, so changes to it go through ordinary code review and land in every clone on the next pull. Until you commit it, though, it is just a file on your disk and nobody else has it. A rule you write in ~/.claude/settings.json never leaves your machine, even if that machine is the team's reference box. Managed settings are the wrong tool for team conventions the other way round: the organization deploys them, so developers do not create or edit them, and they skip the repository's review process altogether.

    The local file is where personal overrides belong. When Claude Code first writes .claude/settings.local.json in a git repository, it adds the file to your global git excludes so it stays out of your commits. If you create the file by hand, add it to .gitignore yourself. Claude Code also writes to this file for you: choosing "Yes, and don't ask again" on a Bash prompt saves an allow rule here. Because the file belongs to you and not to the repository, its allow rules apply without the workspace trust step that the committed file needs, as long as the file stays untracked.

    Checkpoint 1 of 6· Match them up

    A platform team is deciding where each setting should go. Match each settings file to the setting that belongs in it.

    Tap a term, then the definition that fits it.

    Checkpoint 2 of 6· Exam question

    A platform team wants every engineer's Claude Code session to inherit a shared set of Bash allow rules and MCP server configuration that the team maintains and reviews through normal code review, while still letting each engineer add personal overrides that never leave their own machine. Where should the team place the shared rules, and where should individual overrides go?

    Sources1

    2.Which value wins when scopes disagree

    For a single-value key such as model, the higher scope wins outright. From highest to lowest, the order is: managed settings, then JSON passed with --settings for one session, then project local, then shared project, then user. The --settings flag sits above your user, project and local files but below managed settings. It can set anything your user file can set, but never a managed key.

    Arrays work differently, and permission rules are arrays. Across the non-managed scopes, Claude Code merges the arrays instead of letting the higher file replace the lower one. Suppose the project file denies a command and your local file allows something. The local file does not replace the project's deny list. Both rules end up in the effective set. A few keys are exceptions. fallbackModel is an ordered chain, so Claude Code takes the whole value from the highest file that defines it. When managed settings define availableModels, Claude Code applies that list as-is and ignores entries you add lower down.

    Checkpoint 3 of 6· Check yourself

    Your project's committed .claude/settings.json has a permissions.deny entry for a command. In your .claude/settings.local.json, you add a permissions.allow entry for a narrower form of that command. Local settings rank above shared project settings. What ends up in the effective permission rules?

    Sources1

    3.Writing allow, ask and deny rules

    A permission rule names a tool and, optionally, a specifier in parentheses. Bash on its own matches every Bash command. Bash(npm run build) matches only that exact command. Read(./.env) matches reading .env in the current directory, and WebFetch(domain:example.com) matches fetches to that domain. Some tools also accept a parameter match such as Agent(model:opus). Each rule names one parameter, so gating on two parameters takes two rules. Rules go into permissions.allow, permissions.ask or permissions.deny in whichever scope should own them.

    A settings file that pre-approves lint and test commands and denies reading .env filesjson
    {
      "$schema": "https://json.schemastore.org/claude-code-settings.json",
      "permissions": {
        "allow": [
          "Bash(npm run lint)",
          "Bash(npm run test *)"
        ],
        "deny": [
          "Read(./.env)",
          "Read(./.env.*)"
        ]
      }
    }

    The three rule types do three different jobs. An allow rule lets a tool run without asking for approval. An ask rule prompts for confirmation every time. A deny rule stops the tool from being used at all. An allow rule does not grant access past a deny; it only removes the prompt. Because rules from every scope merge into one set, a project-level Bash(aws *) deny and a local Bash(aws s3 ls) allow both apply to aws s3 ls, and the call is blocked. A more specific allow does not carve an exception out of a broad deny, and a local file does not cancel a project's deny.

    Path rules hide an asymmetry that catches teams writing secret-file protections. As an allow rule, Edit(src/**) matches only src/ under the current directory. As a deny or ask rule, the same pattern matches a src directory at any depth. So Read(secrets/**) in a deny list also covers nested copies such as vendor/pkg/secrets/. To allow a directory name at any depth, write Edit(**/src/**).

    Checkpoint 4 of 6· Check yourself

    A teammate wants Claude to run aws s3 ls without stopping for approval. The committed .claude/settings.json denies Bash(aws *). The teammate adds Bash(aws s3 ls) to permissions.allow in their .claude/settings.local.json. What happens the next time Claude tries to run aws s3 ls?

    Checkpoint 5 of 6· Exam question

    A security lead configures a project-level deny rule Bash(aws *) to block all AWS CLI usage from Claude Code. A developer later adds an allow rule Bash(aws s3 ls) to their local settings so they can list bucket contents. When the developer runs aws s3 ls in a session, what happens?

    Sources2

    4.Shared instructions versus enforced settings

    CLAUDE.md files use the same layering as settings, but they guide Claude instead of constraining it. A project CLAUDE.md (or .claude/CLAUDE.md) reaches team members through source control. ~/.claude/CLAUDE.md holds personal preferences for all projects. CLAUDE.local.md holds personal notes for one project. A managed policy CLAUDE.md at the OS policy path, such as /etc/claude-code/CLAUDE.md on Linux, carries organization-wide instructions that are loaded in every session and cannot be excluded.

    The split matters because an instruction is not a control. "Never read .env" written in CLAUDE.md is guidance that Claude may or may not follow. Read(./.env) in permissions.deny stops the read regardless. If two instructions contradict each other, Claude may pick either one arbitrarily, which is acceptable for style guidance but not for a security boundary.

    Where an organization should put each kind of requirement
    ConcernConfigure in
    Block specific tools, commands, or file pathsManaged settings: permissions.deny
    Enforce sandbox isolationManaged settings: sandbox.enabled
    Login method and organization restrictionsManaged settings: forceLoginMethod, forceLoginOrgUUID
    Code style and quality guidelinesManaged CLAUDE.md
    Behavioral instructions for ClaudeManaged CLAUDE.md

    Checkpoint 6 of 6· Check yourself

    Security requires that Claude Code never reads .env files on any developer machine, and nobody may opt out. Someone proposes adding "Never read .env files" to the managed policy CLAUDE.md, because it loads in every session and can't be excluded. What should the organization do?

    Sources34

    Sources

    (4)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “It reaches your teammate’s clone and the cloud session only if you commit the file to version control”
      ↩︎ Four settings scopes and who each one reaches
      “Personal overrides for one project, and testing before you share”
      ↩︎ Four settings scopes and who each one reaches
      “Its allow rules don’t wait for trust while the file stays untracked.”
      ↩︎ Four settings scopes and who each one reaches
      “Claude Code applies it above your user, project, and local files and below managed settings.”
      ↩︎ Which value wins when scopes disagree
      “Across non-managed scopes Claude Code merges the arrays as usual.”
      ↩︎ Which value wins when scopes disagree
      “Nothing in your own settings files or --settings overrides a managed key”
      ↩︎ Key concept
      “Team permissions, hooks, plugins, and the environment variables the project needs”
      ↩︎ Exam trap 2
      “Everyone working in the folder that contains it. In a git repository, commit it so teammates get it”
      ↩︎ Checkpoint
      “Claude Code saves that permission approval here as an allow rule.”
      ↩︎ Prediction
    2. 2.
      “Allow rules let Claude Code use the specified tool without manual approval.”
      ↩︎ Writing allow, ask and deny rules
      “Deny and ask rules: Read(secrets/**) matches a directory named secrets at any depth under the current directory”
      ↩︎ Writing allow, ask and deny rules
      “Each rule names one parameter.”
      ↩︎ Writing allow, ask and deny rules
      “Deny rules prevent Claude Code from using the specified tool.”
      ↩︎ Exam trap 1
      “Deny rules prevent Claude Code from using the specified tool.”
      ↩︎ Checkpoint
    3. 3.
      “Organization-wide instructions managed by IT/DevOps”
      ↩︎ Shared instructions versus enforced settings
      “Block specific tools, commands, or file paths | Managed settings: permissions.deny”
      ↩︎ Checkpoint
    4. 4.
      “Org-wide instructions loaded in every session, can’t be excluded”
      ↩︎ Shared instructions versus enforced settings

    Continue to part 2 of 2

    Managed policy for Claude Code: delivery, locks and model pins

    Spotted a mistake, or was something unclear? Tell us.