CertSafari
    CLAUDE-CERTIFIED-DEVELOPER-FOUNDATIONS-CCDV-F · Lessons

    Domain 2 · Lesson 9/25

    CLAUDE.md and settings.json Scopes in Claude Code

    Configuration Management

    7 min read
    5.52% of exam
    2 sources
    Published 29 Sep 2026
    Docs as of 26 Sep 2026

    What you will be able to do

    • Place an instruction in the right CLAUDE.md scope: managed policy, user, project or local
    • Predict whether Claude Code reads AGENTS.md, CLAUDE.md, or both in a given repository
    • Choose between a managed CLAUDE.md and managed settings when a rule has to be enforced
    • Order the settings.json scopes by precedence and say who each one affects

    Key concept

    Layered configuration scopes — Claude Code configuration comes in layers: organization-managed, per-session command line, project-local, shared project and user. Which layer you write to decides who is affected and what can override it. Managed settings sit above everything else, and the settings you control stack beneath them.

    1.Four places a CLAUDE.md can live

    CLAUDE.md is how you give Claude standing instructions. It is a plain file you write, and Claude Code loads it at the start of every session. Auto memory is a separate mechanism: there, Claude writes the notes itself from your corrections. With CLAUDE.md, the configuration question is where you put the file, because the location decides who shares the instruction.

    CLAUDE.md scopes and who they reach
    ScopeLocationShared with
    Managed policy/Library/Application Support/ClaudeCode/CLAUDE.md (macOS), /etc/claude-code/CLAUDE.md (Linux and WSL), C:\Program Files\ClaudeCode\CLAUDE.md (Windows)All users in organization
    User instructions~/.claude/CLAUDE.mdJust you (all projects)
    Project instructions./CLAUDE.md or ./.claude/CLAUDE.mdTeam members via source control
    Local instructions./CLAUDE.local.mdJust you (current project)

    Project instructions are the team's copy, so you commit them. Local instructions hold personal, project-specific details such as sandbox URLs or preferred test data, and they belong in .gitignore. Write every instruction so it can be checked: 'Run npm test before committing' works, while 'Test your changes' leaves Claude guessing. When one file gets too big, a CLAUDE.md can pull in other files with @path imports, and you can split rules into .claude/rules/. A rule file can use a paths glob so it applies only to matching files:

    A path-scoped rule in .claude/rules/ that applies only to API TypeScript filesmarkdown
    ---
    paths:
      - "src/api/**/*.ts"
    ---
    
    # API Development Rules
    
    - All API endpoints must include input validation
    - Use the standard error response format
    - Include OpenAPI documentation comments

    Sources1

    2.When AGENTS.md loads instead of CLAUDE.md

    By default, Claude reads only your CLAUDE.md files. It falls back to AGENTS.md only when there is no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in the working directory or any directory above it. Some files don't count toward that check, and they keep loading alongside AGENTS.md: your user file, the managed file, and rules files. If a CLAUDE.md imports AGENTS.md, you get both, and the AGENTS.md content arrives through the import.

    The instructionFiles option of the built-in agents-md plugin
    ValueWhat Claude reads
    claude-md-or-agents-mdCLAUDE.md files, or AGENTS.md when there is no CLAUDE.md or CLAUDE.local.md (the default)
    claude-md-and-agents-mdBoth, with each directory's CLAUDE.md files first and its AGENTS.md after them
    claude-mdCLAUDE.md files only
    managed-onlyOnly the managed CLAUDE.md and auto memory at launch

    Sources1

    3.Managed CLAUDE.md versus managed settings

    The managed-policy CLAUDE.md is how IT or DevOps pushes instructions to every developer in the organization. You deploy it with your configuration management system. It is still only an instruction to Claude, though, and it is not a technical control. The documentation separates the two jobs. Anything that has to be enforced goes in managed settings. Anything that shapes Claude's behaviour goes in the managed CLAUDE.md.

    Where each organizational concern is configured
    ConcernConfigure in
    Block specific tools, commands, or file pathsManaged settings: permissions.deny
    Enforce sandbox isolationManaged settings: sandbox.enabled
    Environment variables and API provider routingManaged settings: env
    Login method and organization restrictionsManaged settings: forceLoginMethod, forceLoginOrgUUID
    Code style and quality guidelinesManaged CLAUDE.md
    Behavioral instructions for ClaudeManaged CLAUDE.md

    An engineer edits `.claude/settings.json` mid-session to add a new entry under `permissions.allow` for a Bash pattern the team just approved, then separately edits the `model` field in the same file to pin a different Claude version. Without restarting Claude Code, what should the engineer expect?

    Sources1

    4.settings.json scopes and precedence

    Permissions, hooks, plugins, environment variables and the default model are configured in settings.json, not in CLAUDE.md. Settings use the same layering: a user file, a shared project file, a project-local file and managed sources. The shared file at .claude/settings.json only reaches teammates after you commit it. Until then it is a file on your own disk.

    A shared project .claude/settings.json that allows lint and test runs 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.*)"
        ]
      }
    }
    Settings levels from highest to lowest precedence
    LevelFile or sourceWho it affects
    Managedmanaged-settings.json, MDM policy, or server-managed settingsEveryone the organization deploys it to
    Command line--settings, --model and other flagsThis one session
    Project local.claude/settings.local.jsonYou, in this project only
    Shared project.claude/settings.jsonEveryone working in the folder, once committed
    User~/.claude/settings.jsonYou, in every project on this machine

    Claude Code writes the local file itself. When you answer 'Yes, and don't ask again' to a Bash permission prompt, the approval is saved there as an allow rule. The first time it writes that file inside a git repository, it adds **/.claude/settings.local.json to your global git excludes. If you create the file by hand before that happens, you have to add it to .gitignore yourself. Levels merge key by key: a higher level wins on any key it sets, and a key it leaves out keeps the value from the level below.

    Sources2

    Exam traps

    Each one states something that sounds right. Open it to see what is actually true.

    1. 1.Putting 'never push to main' in the managed CLAUDE.md technically stops Claude from pushing to main.Why is that wrong?

      A managed CLAUDE.md only carries behavioural instructions. To block a command outright, use managed settings with permissions.deny.

      Covered in Managed CLAUDE.md versus managed settings

    2. 2.When a repository has both AGENTS.md and CLAUDE.md, Claude Code reads both by default.Why is that wrong?

      The default is claude-md-or-agents-md: once a CLAUDE.md or CLAUDE.local.md exists, only the CLAUDE.md files load, unless CLAUDE.md imports AGENTS.md or you change instructionFiles.

      Covered in When AGENTS.md loads instead of CLAUDE.md

    3. 3.Passing a key with --settings on the command line overrides the same key in managed settings.Why is that wrong?

      Command-line settings rank above user, project and local files but below managed settings, so a managed key always wins.

      Covered in settings.json scopes and precedence

    Sources

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

    1. 1.
      “CLAUDE.md files: instructions you write to give Claude persistent context.”
      ↩︎ Four places a CLAUDE.md can live
      “Personal project-specific preferences; add to .gitignore”
      ↩︎ Four places a CLAUDE.md can live
      “Not read: AGENTS.local.md, AGENTS.override.md, or anything under a .agents/ directory”
      ↩︎ When AGENTS.md loads instead of CLAUDE.md
      “Deploy with your configuration management system”
      ↩︎ Managed CLAUDE.md versus managed settings
      “Organization-wide instructions managed by IT/DevOps”
      ↩︎ Exam trap 1
      “Don’t count, and keep loading alongside AGENTS.md: your ~/.claude/CLAUDE.md, your organization’s managed CLAUDE.md, and .claude/rules/ files”
      ↩︎ Exam trap 2
    2. 2.
      “Team permissions, hooks, plugins, and the environment variables the project needs”
      ↩︎ settings.json scopes and precedence
      “Claude Code saves that permission approval here as an allow rule.”
      ↩︎ settings.json scopes and precedence
      “Claude Code applies it above your user, project, and local files and below managed settings.”
      ↩︎ Key concept
      “a key you pass with --settings doesn’t override the same managed key”
      ↩︎ Exam trap 3

    Continue to page 2 of 2

    Model Pinning and Plugin Dependency Versions in Claude Code