c-thru
A transparent router between Claude Code and the models you actually want —
without patching the vendor CLI.
Claude Code ──▶ c-thru ──▶ Anthropic · Ollama · Gemini · xAI · OpenRouter · …
│
capability × hardware tier × mode
| See | Choose | Route |
|---|
| Unmodified Claude Code | Connectivity mode + RAM tier | Concrete model, translated only when needed |
Requests resolve by capability, hardware tier, and connectivity mode. Wire formats are translated only when the backend requires it.
Capabilities
- Route Anthropic-shaped traffic to local and cloud backends
- Resolve models per role, tier, and mode
- Mix providers in a single session
- Fall back and reload without restarting Claude
- Observe every decision (
x-c-thru-*, optional journal)
- Optional 97-agent fleet and
/cplan waves (CLI install)
In practice
cthru --mode best-local-oss # air-gapped / local Ollama
cthru --mode best-cloud-oss # cost-aware default
# CLI fleet: /cplan "add JWT auth"
# Or: "ask agent grok to critique this plan"
Quick start (Shape C)
c-thru is a CLI launcher (cthru) that wraps the real claude binary with
routing and agent fleet inject. The private marketplace plugin discovers and
bootstraps that CLI (symlinks under ~/.claude/tools). Product code lives
only in this repository; catalogs point at plugins/c-thru.
Pick exactly one marketplace identity. Installing both c-thru@c-thru and
c-thru@claude-craft activates the plugin twice and double-fires its hooks.
1. Install from private marketplace
/plugin marketplace add whichguy/c-thru
/plugin install c-thru@c-thru
(Family catalog, same package: whichguy/claude-craft → c-thru@claude-craft.)
2. Bootstrap the CLI (/c-thru:install-cli)
Do not rely on SessionStart to clone (hook timeout is too short). Run:
/c-thru:install-cli
That pins ~/.claude/c-thru-src, symlinks c-thru / cthru into
~/.claude/tools, writes .c-thru-cli-installed, and scrubs residual loopback
ANTHROPIC_BASE_URL. Open a new shell (or source your rc) so PATH picks up
~/.claude/tools.
3. Runtime — always use cthru
cthru
cthru --mode best-cloud-oss
Plain claude is not the full product (no launch-time --agents / fleet inject).
Developer path (clone)
git clone https://github.com/whichguy/c-thru.git
cd c-thru
bash install.sh
cthru
install.sh and plugin bootstrap share the same symlink core.
Team repos can prompt the catalog via extraKnownMarketplaces — see
docs/marketplace-release.md. Safety / remove:
SECURITY.md. Plugin vs CLI details:
Appendix C.
Removing c-thru
Order matters (plugin uninstall alone does not scrub global settings):
pkill -f claude-proxy — required; an orphan proxy can mask a dead base URL
bash uninstall.sh (CLI) — tools, stamp, loopback ANTHROPIC_BASE_URL; optional
--purge-src removes ~/.claude/c-thru-src
/plugin uninstall c-thru@c-thru (or the family identity)
Cloud backends (optional)
Local-only routing needs no cloud keys. Subscription-backed Claude: see
docs/subscription-auth.md.
Optional environment variables (set values in your shell profile — do not commit keys):
ANTHROPIC_API_KEY
OPENROUTER_API_KEY
GOOGLE_API_KEY — Gemini AI Studio
XAI_API_KEY — Grok routes
Full list: docs/env-vars.md.
How c-thru works
The bash entrypoint selects a model-map and routing mode, spawns the Node proxy (unless
CLAUDE_PROXY_BYPASS=1 is set), and execs the real claude binary with ephemeral session
injection. The proxy translates Anthropic ↔ Gemini / Ollama and forwards everything else; agent
files declare logical capability names (planner, coder, ...) that the proxy resolves to
concrete models at request time.
flowchart TD
A[c-thru invoked] --> B[resolve model-map + route/model]
B --> C{backend needs a proxy?}
C -- yes --> D[spawn claude-proxy<br/>FIFO READY-port handshake]
C -- no --> E[transparent: skip proxy spawn]
D --> F[inject --settings / --agents /<br/>--append-system-prompt]
E --> F
F --> G[exec real claude binary]
Full flow with every branch (native-subcommand bypass, --bypass-proxy, backend lookup ladder,
FIFO handshake failure modes): docs/architecture-diagrams.md § 1.