# Claude Code Settings Precedence

> The order that says which file wins when two set the same key.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** settings precedence, settings order

## Think of it like

It is like asking a parent and then a teacher. The higher one has the last word.

## Definition

Settings precedence is the order Claude Code uses when two files set the same key. From top to bottom it is managed settings, the command line, the local file, the shared repo file and your user file. The top one that sets a key wins. Lists such as permissions.allow are not like that. They merge, so each file adds its own lines.

## Example

Lucy set a model in her user file, but Claude keeps using another. The project file sets one too, and it is higher.

## Example code

```bash
claude --settings '{"model": "claude-opus-5-5"}'
```

A flag sits above your files, for this one session.

## Why it matters

When a setting seems to be skipped, this order nearly always says why.

## Common mistake

Thinking a deny rule in a lower file is lost. Lists of rules merge, so each file's rules still count.

## Three principles

- **Five levels.** Managed on top.
- **Highest wins.** For one key.
- **Lists merge.** Rules add up.

## Related terms

- [Managed Settings File](https://learn.benibix.com/term/ai/managed-settings-file)
- [Local Settings File](https://learn.benibix.com/term/ai/local-settings-file)
- [--settings Flag](https://learn.benibix.com/term/ai/settings-flag)

![The five levels of Claude Code settings, highest first, and how lists merge across them.](https://learn.benibix.com/diagrams/settings-precedence.svg)

---

Source: https://learn.benibix.com/term/ai/settings-precedence
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
