Claude Code Per-Project Settings
Configure different Claude models (or LiteLLM backends) per project on the same machine using project-local settings.json.
Why / When to Use
When multiple projects on the same machine need different backends β one project via LiteLLM/GLM proxy, another via direct Anthropic Opus, another via claude.ai subscription β without touching global settings.
Core Concept / Commands
Claude Code reads settings in this priority order (highest wins first):
{project}/.claude/settings.json β project-local (wins)
~/.claude/settings.json β user-global (fallback)
Create a .claude/ folder inside each project root and place settings.json there.
Key Options / Variants
Project A β LiteLLM / GLM proxy
// /projects/A/.claude/settings.json
{
"env": {
"ANTHROPIC_BASE_URL": "http://172.18.0.1:4001",
"ANTHROPIC_API_KEY": "anything",
"CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1"
}
}Project B β Direct Anthropic Opus (API key)
// /projects/B/.claude/settings.json
{
"env": {
"ANTHROPIC_API_KEY": "sk-ant-REAL_KEY_HERE"
}
}No ANTHROPIC_BASE_URL override β Claude Code talks to Anthropic directly.
Project C β claude.ai subscription (interactive login)
cd /projects/C
claude /loginClaude Code stores subscription token per-session; run /login once per project directory.
Gotchas
envkeys insettings.jsonare only active when Claude Code runs inside that project directoryANTHROPIC_BASE_URLmust point to a running LiteLLM/proxy server before Claude Code starts- Per-project
.claude/is not committed to Git by default β add to.gitignoreif the key is sensitive - Running Claude Code from the wrong directory picks up the wrong settings silently
Source
Conversation βMultiple projects with different Claude modelsβ β 2026-05-13