Claude Code
Claude Code is Anthropic's official CLI coding agent. It speaks the Anthropic Messages wire format and reads its provider settings from a JSON config file.
Support state: auto-configurable. routerly clients configure writes
this file for you.
Config file: ~/.claude/settings.json (JSON)
Wire format: Anthropic
Auto-configure (recommended)
With the CLI installed and logged in:
routerly clients configure claude-code --router <your-router>
This mints a router token (or reuses one you pass with --token), backs
up your existing ~/.claude/settings.json, and merges in the env block
below, every other key already in the file is left untouched.
Minting a new token requires router:write permission on the target
router (use --token <existing-token> to skip this).
Manual configuration
Open ~/.claude/settings.json and merge in:
{
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:3000",
"ANTHROPIC_AUTH_TOKEN": "sk-rt-YOUR_ROUTER_TOKEN"
}
}
ANTHROPIC_BASE_URL has no /v1 suffix. Claude Code talks to the root of
the Anthropic-compatible endpoint. Replace http://localhost:3000 with your
Routerly instance's URL and sk-rt-YOUR_ROUTER_TOKEN with a router token
(create one on the Routers page, or let
clients configure mint one for you).
Provider compatibility
Claude Code sends its full tool set on every request, so a provider is only
usable here if tool calls survive the round trip. Verified end to end with the
real claude binary (a prompt that forces a Read tool call, then the answer):
| Connection provider | Works |
|---|---|
anthropic (API key) | yes, verbatim pass-through |
anthropic-oauth (Pro/Max) | yes. Routerly drops the context-1m beta, which a subscription token cannot use |
openai (API key) | yes |
openai-oauth (ChatGPT subscription) | yes. The Codex Responses backend is mapped to and from the Anthropic format, tool calls included |
gemini | yes. Replayed tool calls are stamped with the placeholder thought signature Gemini 3 requires |
deepseek | yes |
local models via ollama | wire format works; whether the model follows Claude Code's system prompt depends on the model |
Undo
Every configure run prints a Backup ID. Restore the file to its exact
prior state with:
routerly clients undo <backupId>
See CLI: routerly clients for the full command
reference, including inspect (check current status) and doctor (check
service reachability).