Direct answer: classify the key before choosing a file
Most Claude Code settings keys reside in settings.json files, while a short group has global-config scope in ~/.claude.json. Documented global-config examples include autoConnectIde, autoInstallIdeExtension, diffTool, and externalEditorContext. The env key can be set in any settings file. Do not move every IDE or interface preference into settings.json, and do not treat ~/.claude.json as a supported backup format for every key. Check the settings reference for the exact key, identify its scope, and edit only the documented location. A configured CLAUDE_CONFIG_DIR also requires an absolute path and changes credential storage, but the supplied evidence does not establish universal relocation of every global-config key.
Why a misplaced key wastes time
A configuration key can look familiar and still belong to a different storage surface. Editing settings.json for a global-config key can leave the intended behavior unchanged. Copying the key into another file does not make the new location authoritative.
Official. The settings reference distinguishes most settings.json keys from a short group stored in ~/.claude.json. File classification comes before precedence. A perfectly valid value in the wrong file does not answer the configuration question.
The cost appears during machine comparison or relocation. A developer may copy settings.json, see several preferences missing, and conclude that the copy failed. The missing keys may have global-config scope or belong to editor preferences. A broad file copy can also expose credentials or unrelated local state, which is why classification matters before any backup plan.
The settings precedence runbook explains the five scopes for settings files. This article answers the earlier question: does the key belong in one of those files at all? The status and doctor validation guide helps identify rejected entries after placement is understood.
Keep credential files out of manual editing. The credential storage path guide documents where credentials live by operating system, while the secrets in logs and transcripts article explains why configuration evidence needs redaction.
Identify the configuration key
Start with the exact key name. Similar names can belong to different surfaces, especially around IDE behavior. An editor preference, a Claude Code global-config key, and a settings-file env entry are not interchangeable.
Official. The VS Code documentation places extension settings in VS Code preferences and Claude Code settings in ~/.claude/settings.json. It also notes that some IDE keys are separately listed under global config in ~/.claude.json. The VS Code settings and relaunch runbook maps those surfaces without treating them as one file.
Write down what behavior the key controls. Automatic connection, extension installation, diff tool selection, and external editor context are documented global-config examples. A variable that controls the same broad area may still belong in env, so the key reference remains the deciding source.
The JetBrains documentation covers the integration surface, but the supplied fact pack does not establish that every JetBrains preference lives in ~/.claude.json. Avoid extending the example list by analogy.
For a key that came from a community snippet, verify its current documented location before editing. A screenshot can show one machine’s state without proving the supported storage scope. The settings merge report analysis demonstrates how to keep individual reports separate from official configuration rules.
Check whether it has global-config scope
The settings reference is the classification surface. Look for the key’s listed scope rather than guessing from its name or the file where a colleague placed it.
| Key family | Documented storage | Examples or rule | Boundary |
|---|---|---|---|
| Global config | ~/.claude.json |
autoConnectIde, autoInstallIdeExtension |
Not every IDE preference is included |
| Global config | ~/.claude.json |
diffTool, externalEditorContext |
Check each key individually |
| Ordinary settings | settings.json files |
Most settings keys | Effective scope precedence still applies |
| Environment entries | Any settings file | env |
Process replacement and startup timing still apply |
| VS Code extension preferences | VS Code preferences | Extension settings documented by the VS Code page | Not a Claude Code settings-file scope |
Official. Global-config examples do not imply that every IDE preference is stored there. The reference should be checked for the specific key before editing or relocating it. The caveat is part of the fact, not a footnote to ignore.
A global-config key also does not become a project override merely because a repository contains a similarly named entry. The documented scopes answer different questions. The global config and settings file distinction should be resolved before applying the five-level order.
If the reference does not classify the key clearly, record the gap. Do not promote a plausible location into a supported rule. The troubleshooting documentation can provide adjacent context, but it does not authorize inventing a storage path.
Separate ~/.claude.json from settings.json
~/.claude.json is not another name for user settings. User settings live in ~/.claude/settings.json. The first path is the home-level global-config file for a short key group; the second is one scope in the settings precedence system.
Official. Shared project settings live in .claude/settings.json, and personal project overrides live in .claude/settings.local.json. Windows expands the user path under %USERPROFILE%\.claude. A configured CLAUDE_CONFIG_DIR changes the base path, so inspect the effective configuration context rather than assuming a fixed home location.
| File or surface | Scope | Typical question |
|---|---|---|
~/.claude.json |
Global config | Is this one of the documented global-config keys? |
~/.claude/settings.json |
User settings | Is this a personal default? |
.claude/settings.json |
Shared project settings | Does the repository own this definition? |
.claude/settings.local.json |
Project-local settings | Is this a private project override? |
| Managed settings | Managed scope | Does an organization own the definition? |
| VS Code preferences | Editor preferences | Is this an extension setting rather than a Claude Code key? |
The path difference is small but operationally important. ~/.claude.json and ~/.claude/settings.json are different files with different documented roles. A backup or comparison routine that treats them as interchangeable can miss keys or copy unrelated state.
The project-local versus user merge guide explains precedence among the settings files. It does not convert global-config keys into ordinary settings values. Keep the classification step visible in every relocation checklist.
Map settings.json to user, project or managed scope
Once the reference confirms that a key belongs in settings.json, choose the intended scope. User settings hold personal defaults. Shared project settings hold repository definitions. Project-local settings hold personal project overrides. Managed settings and command-line arguments rank above those file scopes.
Official. The documented order is managed settings, command-line arguments, project-local settings, shared project settings, then user settings. List keys combine across scopes, and model-related keys have special resolution. The five-scope precedence article provides the full map.
Suppose a key is correctly classified as an ordinary setting but appears ineffective. The problem may now be precedence rather than placement. A project-local definition can outrank a user definition, while a launch argument can outrank the project-local file. Moving a global-config key is a different investigation from resolving precedence among valid settings-file values.
Suppose the key is env. The reference allows it in any settings file, but effective precedence and process replacement still apply. The settings env and shell replacement runbook explains why a shell export may not be the final process value.
A scope decision should follow ownership. A repository definition belongs in shared project settings when the repository intentionally owns it. A private exception belongs in project-local settings. Repeating a value in every scope makes future diagnosis harder without improving precedence.
The managed SSO controls guide illustrates why some settings require the managed-source owner. A personal file is not a general method for overriding an organizational definition.
Handle IDE connection keys
IDE-related configuration spans more than one surface. autoConnectIde and autoInstallIdeExtension are documented global-config examples. CLAUDE_CODE_AUTO_CONNECT_IDE is an environment variable that overrides automatic IDE connection and takes precedence over the global autoConnectIde setting.
Official. Documented values for CLAUDE_CODE_AUTO_CONNECT_IDE are false to prevent automatic connection and true to force an attempt. Shell variables are read at startup, so changing that shell variable requires relaunching Claude Code. Settings-file env entries have different timing unless the feature reads the variable only at startup.
| IDE control | Surface | Rule |
|---|---|---|
autoConnectIde |
Global config in ~/.claude.json |
Documented global-config example |
autoInstallIdeExtension |
Global config in ~/.claude.json |
Documented global-config example |
CLAUDE_CODE_AUTO_CONNECT_IDE |
Environment variable | Overrides automatic connection and outranks global autoConnectIde |
| VS Code extension settings | VS Code preferences | Separate from Claude Code settings files |
| Claude Code settings | ~/.claude/settings.json and other settings scopes |
Use the key reference for placement |
A value in VS Code preferences does not become a Claude Code global-config value merely because both affect the integration. The VS Code settings article keeps those surfaces separate. The VS Code WebSocket regression analysis covers a distinct incident class and should not be used to explain a file-placement mistake.
For JetBrains, start with the official JetBrains integration documentation and the key reference. The supplied evidence does not establish that every plugin preference uses ~/.claude.json. Keep plugin behavior and Claude Code global config as separate classification questions.
Account for CLAUDE_CONFIG_DIR
CLAUDE_CONFIG_DIR is a path variable for which the documentation instructs users to write an absolute path. Shorthand such as ~ or $HOME stays as typed. Setting it moves credential storage to that directory.
Official. A correct path changes the credential-storage base, but it does not by itself prove that an existing mount is readable or writable. The absolute-path CLAUDE_CONFIG_DIR runbook covers relocation checks and launch-context differences.
The supplied evidence does not establish that every global-config key in ~/.claude.json relocates with CLAUDE_CONFIG_DIR. Do not promise that changing the variable moves the entire file or makes a copied ~/.claude.json authoritative. Inspect the documented location for the specific key and record any unresolved path behavior.
Shell variables are read at startup. A changed CLAUDE_CONFIG_DIR therefore belongs in a new launch context before its effect is judged. The environment and process replacement guide explains the broader startup boundary.
For container or remote work, the development-container authentication volume guide provides the official persistence pattern. That pattern does not authorize mounting unrelated host secrets or treating every global-config key as portable. The container user and mount ownership guide covers a separate identity question.
Edit only the documented location
After classification, make a narrow edit. If the key belongs in global config, edit ~/.claude.json. If it belongs in user settings, edit ~/.claude/settings.json. If it is a project setting, use the project scope that matches the intended owner.
Official. The env key can be set in any settings file. That exception does not apply to every key. Do not copy a global-config example into a project file simply because the file is easier to share.
Never edit credential files manually as part of this workflow. The authentication documentation and the credential storage path runbook describe credential storage, not a supported manual editing procedure. Keep configuration classification separate from credential rotation.
A comparison between two machines should list key names, documented scopes, and redacted values where sensitivity requires it. The API key security reference offers adjacent guidance for protecting keys. The OpenAI versus Anthropic API compatibility guide is relevant when a separate gateway integration is also being compared, not as a rule for Claude Code file placement.
The custom API base URL resource covers another integration surface. Similar configuration vocabulary does not prove that two keys share a file or precedence rule.
Verify the key in the effective configuration
Use inspection after the edit. /status is recommended for seeing loaded configuration sources, and claude doctor is recommended for identifying rejected entries. The fetched summary does not enumerate every output field, so record only what the current tools show.
/status
claude doctorOfficial. Most keys reside in settings.json, while the global-config group resides in ~/.claude.json. If the key reference says global config but the edit was made in a settings file, correct placement before treating the result as a precedence failure.
For an environment-controlled IDE key, check startup timing. A shell variable change requires relaunching Claude Code. A settings env change can apply immediately unless the feature reads the variable only at startup. The VS Code auto-connect and relaunch guide provides the matching example.
A rejected entry is not proof that every file is invalid, and claude doctor is not documented as an automatic repair tool. The settings validation runbook keeps those limits explicit.
Record the key, documented location, edited file, launch surface, and observed result. Redact secrets. The settings files and exposed secrets article explains why permission-related configuration deserves separate review.
Worked example: classify three IDE controls
Suppose a developer wants to compare automatic connection, extension installation, and a shell-provided connection override across two machines. The key names are autoConnectIde, autoInstallIdeExtension, and CLAUDE_CODE_AUTO_CONNECT_IDE.
Classify from the reference. autoConnectIde and autoInstallIdeExtension are global-config examples in ~/.claude.json. CLAUDE_CODE_AUTO_CONNECT_IDE is an environment variable that overrides automatic connection and takes precedence over global autoConnectIde.
Next, choose the inspection surface. Compare the documented global-config keys in ~/.claude.json. Inventory the environment variable by name without exposing unrelated values. If the variable is set through a settings env block, trace the effective settings scope and process replacement rule.
Derived. The comparison has two global-config keys and one environment-controlled override. That classification follows the documented examples and precedence fact; it is not a measured IDE connection success rate. A machine-to-machine difference can therefore come from file placement, launch environment, or startup state.
For a settings-owned variable, the following safe example uses only the documented connection values and contains no credential:
{
"env": {
"CLAUDE_CODE_AUTO_CONNECT_IDE": "false"
}
}The example belongs in a settings file because env is allowed there. It does not move autoConnectIde out of global config, and it does not claim that an IDE will connect. Relaunch when the feature is startup-sensitive, then repeat inspection.
Practical relocation matrix
| Scenario | First path or surface to inspect | Action boundary |
|---|---|---|
| Personal default missing on another machine | ~/.claude/settings.json |
Confirm the key is an ordinary setting |
| IDE auto-connect key missing | ~/.claude.json |
Confirm global-config scope in the reference |
| Editor extension preference differs | VS Code preferences | Do not move it into Claude Code settings by analogy |
| Environment override differs | Shell or settings env source |
Check replacement and startup timing |
| Configuration directory relocated | Absolute CLAUDE_CONFIG_DIR and documented key location |
Do not assume every global key moves |
| Entry reported as rejected | Specific key reference and defining file | Correct placement before another copy |
| Credential file differs | Documented credential store | Never edit credential contents manually |
Use the matrix before any copy operation. A file-level backup may be useful for some settings, but the supplied evidence does not establish ~/.claude.json as a supported backup format for every key. The uninstall and configuration retention guide reinforces the need for an explicit retention decision.
The PowerShell path quoting guide helps when a Windows launch path is the actual problem. The WSL IDE environment guide helps when terminal and editor environments differ. Neither changes the documented storage scope of a key.
Concrete win, honest loss and practical implication
Win. A developer can classify a key before editing and avoid copying the entire configuration in search of one missing preference. The global-config examples provide a concrete map for several IDE and interface controls.
Loss. The example list is short and does not cover every IDE preference. The supplied evidence does not establish universal relocation of ~/.claude.json, a supported backup format for every key, or complete manual editing procedures for credentials.
Implication. Use the key reference as the gate, then apply scope precedence only to keys that belong in settings files. Verify in the same launch surface, and keep credential material out of manual edits. The settings env runbook is the next step when an environment variable controls the behavior.
Data gaps and future update triggers
Unknown. The supplied evidence does not classify every possible IDE or interface key in this article, establish that CLAUDE_CONFIG_DIR relocates every global-config key, or define ~/.claude.json as a supported backup format for all configuration. It also does not provide a complete credential migration procedure.
Update this runbook when the settings reference publishes a broader key map or explicit relocation behavior. Recheck the reference, VS Code, JetBrains, and environment-variable pages before publication. Add a key only after its current documented location is verified.
Related batch runbooks
- The five Claude Code settings scopes in exact order
- Project-local settings versus user values
- Status and doctor for loaded and rejected settings
- Settings env values and shell process replacement
- 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 provides an OpenAI-format route at https://api.oneaiapikey.com/v1 with one key and the 46 live free IDs. Use the free model route or the OpenAI-format quickstart for a separate agent. The free IDs are not Claude Code credentials, and Claude IDs were unavailable on 2026-11-27. This CTA does not change any Claude Code configuration file.
FAQ
Is ~/.claude.json the same as user settings?
No. User settings live in ~/.claude/settings.json. A short group of keys has global-config scope in ~/.claude.json.
Which IDE keys are documented global-config examples?
autoConnectIde, autoInstallIdeExtension, diffTool, and externalEditorContext are listed examples. Check each key individually because not every IDE preference uses that file.
Can env be placed in any settings file?
Yes. The settings reference allows env in any settings file, but effective precedence, process replacement, and startup timing still apply.
Does CLAUDE_CONFIG_DIR move every global-config key?
The supplied evidence does not establish that. It requires an absolute path and moves credential storage, but universal relocation of ~/.claude.json remains unverified.
Should I copy ~/.claude.json to back up all configuration?
Do not assume that. The evidence does not define it as a supported backup format for every key. Classify each key and keep credential files out of manual editing.
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 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 Docker Config Mount: Permissions and Write Access
- Claude Code VS Code Dev Containers: Align CLAUDE_CONFIG_DIR
Sources
- All settings - Claude Code Docs, official, checked 2026-11-28. Global-config examples, settings-key distinction and env placement.
- Settings files and precedence - Claude Code Docs, official, checked 2026-11-28. Settings file paths, scope order and model exceptions.
- Use Claude Code in VS Code - Claude Code Docs, official, checked 2026-11-28. Editor preferences and Claude Code settings surfaces.
- JetBrains IDEs - Claude Code Docs, official, checked 2026-11-28. Integration documentation boundary.
- Environment variables - Claude Code Docs, official, checked 2026-11-28. Absolute config path, credential storage and startup timing.
- Troubleshooting - Claude Code Docs, official, linked in the research register. Troubleshooting context.