Skip to content

Claude Code via CLI Proxy

ccx runs one Claude Code session through the CLI Proxy gateway. Plain claude keeps the logged-in Claude user.

The command lives at dotfiles/bin/.local/bin/ccx and is stowed to ~/.local/bin/ccx.

Terminal window
make stow-bin

CLI_PROXY_API_KEY must already be set in the shell. CLI_PROXY_BASE_URL is optional. When it is set and ends in /v1, ccx strips that suffix, because Claude Code appends /v1/messages itself. The default host is https://cli-proxy.dataplanelabs.com.

Terminal window
ccx <model-id> [claude args...]

ccx always passes --dangerously-skip-permissions. Add --effort and --autocompact for that model. Extra arguments are forwarded to claude.

An empty ANTHROPIC_BASE_URL in ~/.claude/settings.json overrides the process environment. Claude then sends the proxy token to Anthropic and returns 401 Invalid bearer token. ccx pins the proxy host with --settings, so that empty value does not apply. Leave the empty entry in place when plain claude should ignore an ambient base URL.

Every Claude Code tier for that process, including subagents, uses the model id you pass. Check /status inside the session. It should show the proxy base URL.

Start a new session for a proxy model. Resume a proxy session with ccx <model-id> --continue from the same directory.

statusLine runs ~/.local/bin/agent-statusline (dotfiles/bin), the same script Grok and pi use:

Opus 5.5 xhigh ◔ 37% ~/dotfiles main* ↯ fast

Model and effort, context used (amber at 70%, red at 85%), folder, branch with * when tracked files changed, and ↯ fast only while fast mode is on. Claude does not pass the permission mode to the script; its own line under the status line shows it. Codex cannot run a script, so tui.status_line lists its built-in items in the same order.

~/.claude/settings.json on this Mac is a plain file Claude rewrites, not a stow link, so a change to statusLine here also has to be made there.

OpenRig seats keep a blank status line: OpenRig installs its own collector in each seat’s .claude/settings.local.json, and its idle check expects no row between the input box and the mode line.

Windows below are the vendor input limits already used for compaction on this gateway. --autocompact accepts 100k through 1M.

FamilyModelIDWindowEffort
GPTSol 6.1gpt-6.1-sol272khigh
OpusOpus 5.5claude-opus-5-51Mhigh
GrokGrok 4.7 Fastgrok-4.7-build-fast500khigh
GLMGLM 5.3glm-5.31Mhigh
MuseMuse Spark 1.3 Contributormuse-spark-1.3-contributor1Mhigh
Terminal window
ccx gpt-6.1-sol --autocompact 272k --effort high
ccx claude-opus-5-5 --autocompact 1M --effort high
ccx grok-4.7-build-fast --autocompact 500k --effort high
ccx glm-5.3 --autocompact 1M --effort high
ccx muse-spark-1.3-contributor --autocompact 1M --effort high

grok-4.7 is the same 500k model at normal speed. Grok 4.7 also accepts xhigh. GLM 5.3 accepts low, high, and max, and reasoning stays on. Opus 5.5 and Sol 6.1 also accept xhigh and max.

The proxy keeps one account per model id. ccx does not choose between providers. grok-4.7 and grok-4.7-build-fast are the xAI account. claude-opus-5-5 is the Anthropic account. A Cursor-only id, such as composer-2.5, bills the Cursor account.

Which catalog ids answer through ccx, and which image or video ids need their own endpoint, is tracked on CLI Proxy model status. Invoke /cli-proxy-models in this repo to refresh that page. List the live set with:

Terminal window
curl -fsS -H "Authorization: Bearer ${CLI_PROXY_API_KEY:?Set CLI_PROXY_API_KEY}" \
"${CLI_PROXY_BASE_URL:?Set CLI_PROXY_BASE_URL}/v1/models" | jq -r '.data[].id' | sort
Terminal window
./scripts/ci/test-ccx.sh