Harness Engineering 6 months ahead, in a few hours.

Module 03 — Advanced configuration

Updated

In this module

You'll know how to configure Claude Code in depth: manage the 5 settings scopes, lock down permissions with allow/ask/deny, enable sandboxing, leverage automatic memory, and tune the model's reasoning effort.

3.1 — The five configuration scopes

Claude Code doesn't read a single config file. It merges up to five layers, each with a different priority level. Understanding this hierarchy lets you predict exactly which setting will be active in any situation.

Priority hierarchy (highest to lowest)

Priority Scope File / Source Shared?
1 Managed managed-settings.json (or managed-settings.d/), MDM or the claude.ai admin console The whole organization
2 CLI --settings Session only
3 Local .claude/settings.local.json (project root) No (gitignored)
4 Project .claude/settings.json (project root) Yes (git-tracked)
5 User ~/.claude/settings.json No (global personal)

Only --settings makes up the CLI level. Other flags (--model, --permission-mode...) and environment variables aren't a level: each one overrides the key it replaces, case by case. For example, --model wins over ANTHROPIC_MODEL, which wins over the model key in any file.

Merge rule

Scalar values (strings, booleans) are overwritten by the highest-priority scope. Arrays merge across scopes. Concretely, if the Project scope defines permissions.allow: ["Edit(*.kt)"] and the User scope defines permissions.allow: ["Bash(git status)"], the final result contains both entries. A few lists are exceptions, such as fallbackModel, which Claude Code takes whole from the highest-priority file.

Claude Code
# See which settings files are loaded (Setting sources line)
/status
# See the allow, ask and deny rules in effect, with the file each one comes from
/permissions

Key takeaways

• 5 scopes: Managed > CLI (--settings) > Local > Project > User

• Scalars overwrite, arrays merge

• .claude/settings.json = team, .claude/settings.local.json = personal

• /status to see the loaded files, /permissions for the rules in effect

In this module

  1. 3.1 — The five configuration scopes Available
  2. 3.2 — settings.json in practice
  3. 3.3 — The permissions system: allow, ask, deny
  4. 3.4 — Permission modes
  5. 3.5 — Sandboxing
  6. 3.6 — Automatic memory
  7. 3.7 — Choosing and configuring your model
  8. 3.8 — Environment variables and personalization
  9. 3.9 — Team configuration: Project and Managed
  10. 3.10 — Debugging your configuration with /status

Locked content

Unlock the full course to access this module.

€89 excl. VAT

€106.80 incl. VAT for EU customers · One-time payment

Already purchased? Recover access

Go further