<command-name>/context</command-name> <command-message>context</command-message>…
Assistant
Claude Code supports custom headers via the
ANTHROPIC_HEADERSenvironment variable. It accepts a comma-separated list ofkey: valuepairs:bashANTHROPIC_BASE_URL=http://localhost:3000/proxy/llm/anthropic \ ANTHROPIC_HEADERS="X-Workspace-Id: abc123, X-Custom-Auth: bearer-token" \ claudeThis is documented in Claude Code's configuration. Each header is separated by a comma, with the format
Header-Name: value.If you need headers that contain commas in their values, that could be tricky with this format. In that case you might need to handle it at the proxy level instead.
Want me to look at your LLM proxy implementation to see what headers it expects, so we can wire this up?
- User
/context context
- User
is it possible to specify these in claude config ?
Assistant
Let me check what Claude Code's config files support.
Assistant
Yes — use the
envkey in settings.json:Per-project (
.claude/settings.local.json, gitignored):json{ "env": { "ANTHROPIC_BASE_URL": "http://localhost:3000/proxy/llm/anthropic", "ANTHROPIC_HEADERS": "X-Workspace-Id: your-workspace-id" } }Global (
~/.claude/settings.json):json{ "env": { "ANTHROPIC_BASE_URL": "http://localhost:3000/proxy/llm/anthropic", "ANTHROPIC_HEADERS": "X-Workspace-Id: your-workspace-id" } }The settings hierarchy (highest priority first):
- Shell environment variables
.claude/settings.local.json(project, gitignored).claude/settings.json(project, shared)~/.claude/settings.json(global)
For your LLM proxy,
.claude/settings.local.jsonis probably the right place — keeps it per-project and out of git.- User
/context context
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.