Direct answer: local settings can outrank user values
Claude Code project-local settings have higher precedence than shared project settings and user settings. For an ordinary conflicting key, a value in .claude/settings.local.json can therefore supersede a personal value in ~/.claude/settings.json. List keys such as permissions.allow combine across scopes instead of simply replacing lower-scope lists, and model-related keys have special resolution rules. Do not assume a universal deep merge. Managed settings and command-line arguments still rank above the project files. The safe approach is to inspect the key at each applicable scope, classify its value type, and change the narrowest definition that matches the intended owner.
Why a personal preference changes inside one project
A developer can use the same user settings file across several repositories and still see different behavior in one of them. The usual explanation is not that the user file changed. A project-local definition may have higher precedence for the affected key, while a shared project definition may supply another value.
Official. Project-local settings outrank shared project settings and user settings. Managed settings and command-line arguments remain higher still. That order gives a concrete place to look before editing a personal default again. The five-scope precedence runbook provides the complete rank order.
A repeated edit to the user file can create a second problem. It adds another definition that appears relevant but does not control the project’s effective value. Future readers then have to distinguish intentional layering from abandoned experiments. Cleanup becomes harder because no single file tells the whole story.
The cost is operational rather than abstract. A developer may lose time chasing a setting that is already correct in its own scope. A team may document a personal default as a repository rule even though a private local file overrides it. Neither situation proves a merge defect.
Keep the diagnosis narrow. Ask which key changed, in which project, and under which launch surface. The status and doctor validation guide helps separate loaded sources from rejected entries. That distinction prevents a syntax or key-placement problem from being mislabeled as precedence.
Identify the two local-settings files
The word “local” can refer to two different scopes. Shared project settings live in .claude/settings.json. Personal project overrides live in .claude/settings.local.json. Both sit under the project, but only the second has the project-local rank in the documented order.
| File location | Configuration scope | Precedence relative to user settings | Ownership question |
|---|---|---|---|
~/.claude/settings.json |
User settings | Lowest of the five documented levels | Is this a personal default? |
.claude/settings.json |
Shared project settings | Higher than user settings | Is this intended for the repository? |
.claude/settings.local.json |
Project-local settings | Higher than shared project and user settings | Is this a private project override? |
| Managed settings surface | Managed settings | Higher than command-line and file scopes | Does an organization own this definition? |
| Current invocation | Command-line arguments | Higher than all three settings file scopes | Was a value supplied for this launch? |
Official. Windows expands the user path under %USERPROFILE%\.claude. A configured CLAUDE_CONFIG_DIR changes the configuration base path. The absolute-path configuration directory runbook explains why path inspection should begin with the effective launch context.
File proximity does not establish ownership by itself. A .claude/settings.json file can be present without defining the key under investigation. A .claude/settings.local.json file can contain unrelated entries. Inspect the specific key rather than assuming that the mere existence of a local file replaces the entire user configuration.
This is also why a broad statement such as “local settings overwrote everything” is too imprecise for a useful bug report. Name the file, key, lower-scope value and observed effective behavior. Avoid including secret values. The settings files and exposed secrets article explains the adjacent risk of permission choices that expose sensitive material.
Apply the documented scope order
Start above the project files. If managed settings define the key, a local edit cannot outrank them. If the launch supplies the key as a command-line argument, the project-local file remains below that argument. Only after those checks should the trace move to project-local, shared project, then user settings.
Official. The documented order is managed settings, command-line arguments, project-local settings, shared project settings and user settings. A local file is therefore powerful inside a project but not the highest authority in every launch. The managed SSO controls runbook illustrates a setting family whose enforcement depends on managed scope.
Suppose an ordinary key appears in all three file scopes. The project-local value is the candidate winner unless a higher source defines it. The user value has not been deleted or rejected. It is simply lower priority for that key. Calling the lower value “missing” can obscure the actual configuration.
Suppose only the shared project file and user file define the key. The shared project value then outranks the user value. The absence of a local definition changes which lower scope matters. This is why a key-by-key trace is more reliable than a rule based on file presence.
Environment variables need their own branch in the trace. ANTHROPIC_MODEL overrides file-based model settings regardless of settings-file scope. The settings env and process replacement guide explains how a settings env entry can also replace an inherited shell value in most sessions.
Inspect keys defined at each scope
Make a small inventory before editing. For the affected key, record whether managed settings, the launch arguments, project-local settings, shared project settings and user settings define it. A compact table is enough; there is no need to copy an entire configuration file into a ticket.
Official. /status is recommended for seeing loaded configuration sources. claude doctor is recommended for identifying rejected entries. The fetched summary does not enumerate every /status field or promise a per-key winner display, so use the commands as inspection surfaces rather than invented oracles.
A source can be loaded and still lose precedence. A source can also contain a rejected entry, in which case ordinary precedence is not the first question. Keep those observations in separate columns. The validation runbook gives a correction sequence that does not claim automatic repair.
For each definition, record its path and purpose without recording secrets. If a value is sensitive, use a presence marker or a redacted description. The secrets in logs and transcripts guide explains why a configuration screenshot can become an exposure incident.
When path syntax differs by shell, the PowerShell path quoting guide helps separate a launch problem from a settings-scope problem. For an IDE that receives a different environment, the WSL IDE environment-variable guide provides a focused comparison. A separate gateway integration may also require the OpenAI versus Anthropic API compatibility reference, but format compatibility does not change Claude Code’s local settings order.
An inventory should also capture the working directory and launch surface. An IDE-launched session may not inherit the same environment as a terminal session. The VS Code settings and relaunch guide covers that timing boundary without claiming that every IDE behaves identically. The API key security reference provides adjacent guidance for keeping sensitive values out of the inventory.
Handle list values separately
List keys combine across scopes. A higher-scope list therefore does not automatically erase every lower-scope entry. This is the clearest reason to reject a universal replacement story for all settings.
| Value type | Documented behavior | What to inspect | What not to assume |
|---|---|---|---|
| Ordinary conflicting value | Higher applicable scope has priority | Definitions from highest scope downward | Every file deeply merges with every other file |
List key such as permissions.allow |
Combines across scopes | Contributions from each applicable scope | The highest list replaces the whole lower list |
Model-related key such as fallbackModel |
Special resolution rules | The specific key reference | Ordinary scalar behavior applies unchanged |
Model-related key such as modelPicker |
Special resolution rules | The specific key reference | One model exception generalizes to all keys |
Settings-file env entry |
Can replace inherited process values | Effective scope and startup timing | Shell and settings always share one value |
Official. The list rule establishes combination, not a guaranteed ordering, duplicate policy, or universal deep merge for every nested object. Those details are not supplied in the fetched summary. A safe audit records contributing scopes without inventing an algorithm for the final list layout.
Consider a list entry that appears in user settings and another entry defined at project scope. Removing the user entry may not remove an equivalent effective entry if another scope contributes it. Conversely, deleting an entire lower-scope file may remove unrelated values that were not part of the problem.
The settings precedence guide explains the rank order alongside this list exception. Use it when the question is “which scope wins?” Use this article when the question is “what kind of combination behavior applies?”
A list inspection does not require creating a new permissions policy. The goal is to explain effective configuration. Keep organizational permission design outside this runbook, and keep real credentials out of every example.
Check model-specific resolution
Model-related keys are another exception. The official settings page names fallbackModel and modelPicker as having special resolution rules. That statement is a prompt to check the key reference, not permission to invent a complete model merge algorithm.
Official. ANTHROPIC_MODEL overrides file-based model settings regardless of settings-file scope. A file edit can therefore appear ineffective even when the ordinary five-level trace looks correct. The environment-variable exception must be checked before calling the result a merge failure.
Use the all settings reference for the specific model key. If the available documentation does not answer the exact scenario, record the gap. Do not generalize the behavior of one model key to every nested object or every preference.
A second timing question can appear after precedence is resolved. Shell variables are read at startup, while settings env changes can apply immediately unless the feature reads its variable only at startup. Relaunch when the feature is startup-sensitive, then repeat the inspection in the same launch surface.
The apiKeyHelper refresh runbook applies a similar separation to credentials. A helper definition can be shadowed by scope, while its generated value can be shadowed by credential priority. Refresh timing does not answer either selection question.
Read the community report with its status
Community. Issue #19487 reported missing global values when a project settings.local.json file existed. The reporter expected a deep merge. The issue was closed as not planned after inactivity, and the fetched page documents no human maintainer fix.
| Community evidence | What it establishes | What it does not establish |
|---|---|---|
| A reporter observed missing global values with a local file present | An individual configuration experience worth reproducing | A universal defect in every project |
| The reporter expected deep merging | The expectation behind the report | An official guarantee of deep merging |
| The issue closed as not planned after inactivity | The visible closure status in the fetched page | A maintainer statement that every merge behavior is correct |
| No human maintainer fix was documented in the fetched page | A limit on the available outcome evidence | A promised future fix or a verified fix version |
Official documentation outranks the report for the general rule. The report remains useful as a test-case prompt because it names a concrete scenario: a local file exists and global values appear missing. Reproduce the exact key and launch context before drawing a broader conclusion.
Do not rewrite the closure as “fixed” or “confirmed bug.” Neither claim appears in the verified fact pack. The issue is not evidence that current documentation should be ignored, and the documentation is not evidence that every individual report has been fully explained.
The credential precedence article shows a similar evidence discipline for a different subsystem. A documented ladder explains expected selection, while an individual report can identify a scenario that needs more evidence.
Choose the narrowest intended override
Ownership should drive placement. A personal default belongs in user settings when it should apply without a higher project definition. A shared repository definition belongs in shared project settings when the repository intentionally owns it. A private exception belongs in project-local settings when one developer needs a different value for that project.
Official. Project-local settings outrank the shared and user files, but managed settings and command-line arguments remain higher. Moving a value downward cannot make it override a higher source. Moving it upward can change behavior for other contexts, so each move needs an explicit intent.
Suppose a developer wants a personal default to apply in one project. If a local override currently defines the key, the corrective action is to remove or change that local definition, not to keep editing the user file. If the repository intentionally defines the key, the developer needs to decide whether a private exception is still required.
Suppose a team wants one shared value for a repository. A private local override can still defeat that value for one developer. The shared definition alone does not prove uniform effective behavior. This is a scope consequence, not automatically a bug.
Use a narrow edit rather than deleting an entire file. A local file may contain unrelated settings. The uninstall and configuration retention guide reinforces the same separation between removing a component and deciding what configuration should remain.
Verify the effective configuration
After one scoped correction, repeat the inspection. Confirm that the intended source is loaded, check for rejected entries, and observe the behavior in the same project and launch surface. If the result differs, return to the key classification instead of adding another override.
Official. The settings page recommends /status for loaded sources and claude doctor for rejected entries. Identification is not automatic repair, and a rejected entry does not prove that every settings file is invalid. The status and doctor comparison keeps those limits explicit.
/status
claude doctorRun /status inside the relevant Claude Code session. Run claude doctor from the matching launch context. These are the documented inspection commands; no exit code, output field, or repair behavior is promised here.
A useful verification note records the key, project path, intended owner, scope changed, and observed result. For a secret, record only the source and presence. The global config versus settings.json guide helps catch a misplaced key before precedence is blamed.
If the key belongs to the short global-config group in ~/.claude.json, editing a settings file is the wrong surface. Most keys use settings.json, but that majority rule is not universal. The absolute-path CLAUDE_CONFIG_DIR guide is also relevant when configuration has been relocated.
Worked example: one key in three files
Imagine an ordinary key with a user value of personal, a shared project value of repository, and a project-local value of private-project. No managed definition applies, and the launch supplies no value for the key.
Apply the documented order. Managed settings and command-line arguments do not define it. Project-local settings are the highest remaining applicable source, so private-project is the candidate effective value. The lower values remain present, but they do not control this ordinary key in this project.
Now change the key to a documented list type. The analysis changes. List keys combine across scopes, so the correct inspection records contributions from user, shared project and project-local settings rather than naming one whole-list winner. The available summary does not specify final ordering or duplicate handling, so the example stops before inventing those details.
Derived. For the ordinary key, the trace visits five ranked sources and stops at rank 3. For the list key, the trace inspects contributions across applicable scopes. This comparison is derived from the documented precedence and list facts, not from a benchmark or an assumed deep-merge implementation.
The corrective action depends on intent. Remove the local value if the private override is accidental. Change the shared value if repository ownership is intended, while recognizing that an existing local value still outranks it. Keep the user value as a personal default only if the higher project behavior is acceptable.
Concrete win, honest loss and practical implication
Win. A developer can explain why one project behaves differently without deleting user settings or reinstalling Claude Code. The scope order identifies a finite set of files and launch surfaces to inspect, and the list rule prevents an incorrect whole-list replacement assumption.
Loss. The documented behavior is not a universal deep merge. Nested objects may require key-specific research, model keys have special resolution, and the supplied evidence does not answer every merge detail. Issue #19487 adds an individual report but no verified universal fix.
Implication. Assign each intentional definition an owner, then remove only confirmed lower-priority conflicts. Verify in the launch surface where the symptom appeared. The environment and process replacement runbook is the next check when file scope alone does not explain the effective value.
Data gaps and future update triggers
Unknown. The fetched summary does not establish every nested-object merge rule, final list ordering, duplicate handling, or every model-key resolution path. It also does not provide a maintainer explanation for every scenario in issue #19487. Those gaps should remain visible.
Update this article if official documentation publishes a detailed merge table or a maintainer provides reproducible evidence that changes the current rule. Recheck the settings page before publication. A future issue outcome should be added only after its body and status are verified, not inferred from a title or search snippet.
Related batch runbooks
- The five Claude Code settings scopes in exact order
- Status and doctor for loaded and rejected settings
- Settings env values and shell process replacement
- Global config in ~/.claude.json versus settings.json
- Dynamic apiKeyHelper credentials and refresh timing
- Credential precedence across keys, helper and OAuth
- Absolute CLAUDE_CONFIG_DIR paths for auth storage
- Managed SSO organization and login-method controls
- Stable, latest and minimumVersion update controls
- Browser sign-in, first-launch state and logout
- Uninstall ownership and configuration retention
- VS Code settings, auto-connect and relaunch timing
One AI option for OpenAI-format agents
One AI supports OpenAI-format agents with one key and the 46 live free IDs at https://api.oneaiapikey.com/v1. Use the free model route and the OpenAI-format quickstart for that separate integration. The free IDs do not work as Claude Code credentials, and Claude IDs were unavailable on 2026-11-27.
FAQ
Why does settings.local.json change a user preference?
Project-local settings have higher precedence than user settings for an ordinary conflicting key. The user value can remain present while the local value controls the project’s effective behavior.
Does Claude Code deep merge all settings objects?
The supplied official evidence does not establish that. List keys combine across scopes, model-related keys have special rules, and other values require key-specific inspection.
What happened to issue #19487?
The community report described missing global values when a project-local file existed and expected a deep merge. It was closed as not planned after inactivity, with no human maintainer fix documented in the fetched page.
Should I delete settings.local.json to restore user values?
Not as a default. Inspect which keys it defines and remove only unintended overrides. Deleting the whole file can discard unrelated personal project configuration.
Can a project-local value override managed settings?
No. Managed settings and command-line arguments rank above project-local settings in the documented order.
More Claude Code troubleshooting
- Claude Code Native Install: Verify PATH and Binary Ownership
- Claude Code Homebrew Install: Manage Cask Updates Manually
- Claude Code WinGet Install: Locate the Binary and Maintain PATH
- Claude Code npm Install: Node 22, Global Prefix and PATH
- Claude Code Linux Packages: Compare apt, dnf and apk Updates
- Claude Code Credential Storage: macOS, Linux and Windows Paths
- Claude Code Terminal Keybindings: Shift+Enter Compatibility Guide
- Claude Code tmux Setup: Passthrough Keys and Notification Bells
- Claude Code Terminal Theme: Light, Dark and Custom JSON
- Claude Code VS Code Install: Extension Panel and Standalone CLI
- Claude Code JetBrains Install: CLI Plus Marketplace Plugin
- Claude Code JetBrains External Terminal: Host Install and /ide
- Claude Code Dev Container Feature: Install and Node Fallback
- Claude Code Dev Container Auth: Persist Config With a Volume
- Claude Code Docker Config Mount: Permissions and Write Access
- Claude Code VS Code Dev Containers: Align CLAUDE_CONFIG_DIR
- Claude Code Container User: Align HOME, Config and Workspace
Sources
- Settings files and precedence - Claude Code Docs, official, checked 2026-11-28. Scope order, list combination and model exceptions.
- All settings - Claude Code Docs, official, checked 2026-11-28. Key-specific storage and global-config distinctions.
- Bug: Project settings.local.json overwrites global settings #19487, community, fetched 2026-11-28. Individual report and verified closure status.
- Environment variables - Claude Code Docs, official, checked 2026-11-28. Process replacement and startup timing.
- Troubleshooting - Claude Code Docs, official, linked in the research register. Troubleshooting context.
- Quickstart - Claude Code Docs, official, search result and linked in the research register. Setup context.