Three config files
On Windows the default directory is C:\Users\YOUR_NAME\.claude; on macOS and Linux it is ~/.claude. Two different things live around there, and mixing them up is the first source of confusion.
| File | Path | What it controls |
|---|---|---|
| settings.json | ~/.claude/settings.json | User settings: env vars, model mapping, enabled plugins |
| .claude.json | ~/.claude.json (home directory, not inside .claude) | App state: onboarding completion, project history |
| Project settings | project/.claude/settings.json | Applies to that repo only, can be committed |
Writing settings.json
Put the endpoint, key and model names in the env block. The example below points at MiniMax's Anthropic-compatible endpoint; swap the URL, key and model names for whatever service you use.
| Key | Purpose | Note |
|---|---|---|
| ANTHROPIC_BASE_URL | Where requests go | Must speak the Anthropic protocol — an OpenAI-format URL will not work |
| ANTHROPIC_AUTH_TOKEN | Authentication | The third-party key, not an Anthropic account key |
| HAIKU / SONNET / OPUS mappings | Claude Code calls three tiers internally | With one model available, set all three to it — otherwise tier switching fails |
| API_TIMEOUT_MS | Per-request timeout | Raise it if the provider queues; the sample value is very generous |
| CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC | Disables non-essential telemetry | Recommended when using a third-party endpoint |
The trap: config silently ignored
Config is correct, you restart, and it still opens a login page. Nothing is wrong with your JSON — a newer build gates startup on onboarding, and it never reaches your API settings.
The fix lives in ~/.claude.json:
Change false to true, save, and relaunch.
Plugins and Skills
Installed plugins are recorded in enabledPlugins, keyed as plugin@marketplace:
Set a value to false to disable without uninstalling.
Verify and troubleshoot
Confirm you edited the user-level file
~/.claude/settings.json applies globally. A project-level .claude/settings.json overrides matching keys — check that first.
Validate the JSON
One trailing comma silently discards the whole file. Use your editor's validator or node -e "JSON.parse(...)".
Check .claude.json
Search for hasCompletedOnboarding; confirm it is true and not nested inside env.
Fully quit, then relaunch
Closing the window is not enough — confirm the process ended. Config is read only at startup.
Send one small request
Ask "which model are you?" — if the name matches your mapping, the chain works.
| Symptom | Likely cause |
|---|---|
| Still asks you to log in | .claude.json untouched, or set to the string "true" |
| Model not found | Incomplete tier mapping or a typo in the model name |
| 401 / auth failure | Anthropic key used instead of the third-party key, or expired |
| Timeouts | Slow provider — raise API_TIMEOUT_MS |
| Nothing changed at all | Project config overriding user config, or invalid JSON disabling the file |