Free Claude Code: 77.5k Stars for an Unsupported Stream Proxy

· Dev & Open Source · Claude Code · LLM Gateway · SSE · Python · Open Source

FCC re-encodes Anthropic Messages onto 61 providers from localhost. Its real work is an SSE ledger, history replay and fallback routing — on a path Anthropic says it does not support.

Free Claude Code: 77.5k Stars for an Unsupported Stream Proxy

A 22 MB local gateway that makes 61 providers answer in Anthropic's dialect.

Executive Takeaway: FCC accepts Anthropic Messages, OpenAI Chat Completions, OpenAI Responses, and Gemini calls on 127.0.0.1:8082, then re-encodes them onto 61 upstream providers. The 77.5k stars came from the price tag; the 290k lines of Python exist because streaming, tool calls, and reasoning traces do not survive a naive protocol swap.

The real engineering is stateful repair: an SSE ledger that rebuilds a valid Anthropic event sequence from partial upstream deltas, a history replayer that re-sends transcripts to stateless endpoints, and fallback routing that can move your prompt to a second vendor mid-session. That is also where the risk lives.

Claude Code running against the FCC local gateway instead of Anthropic's API
Claude Code running against the FCC local gateway instead of Anthropic's API

free-claude-code — GitHub Repository

1 · What Actually Changed

Every Claude Code feature — interleaved thinking, tool_use blocks, cache-aware history — is synthesized from providers that never implemented it.

Four Inbound Dialects, One Gateway

Anthropic Messages, Chat Completions, Responses, and Gemini.

FCC terminates four client protocols and fans out to provider-native APIs, so the same model is reachable from Claude Code, Codex, Cline, Aider, or a raw SDK.

The translation is asymmetric: the inbound shape is stable, the upstream shape is 61 different compromises.

DimensionAnthropic shapeUpstream shape
Messagescontent blocksrole/content turns
Toolstool_use blocksfunction_calls JSON
Reasoningthinking blockseffort / summaries
StreamingSSE event ledgertoken deltas
Historycache_read + resendfull replay per turn
Authx-api-key or bearerOAuth or vendor key

The SSE Ledger Is the Actual Product

Claude Code aborts a turn if message_delta never arrives.

Anthropic's own protocol guide says a body that ends after a block starts, without message_delta, is treated as a dropped connection. FCC therefore tracks block index, tool ids and partial JSON in core/anthropic/streaming/ledger.py, then emits the closing events itself.

delivered_response.py keeps bounded, request-local evidence of what was already streamed, so a retry can resume at the unsent suffix instead of replaying the whole answer.

Stateless Upstreams Need Replayed Histor

history_replay.py alone is 1,336 lines.

Upstream chat APIs keep no transcript. FCC rebuilds readable history per turn, decides which reasoning parts are safe to replay, and degrades the format when a provider rejects it.

continuation_overlap.py strips a duplicated prefix when a continuation resumes after a truncated stream — the failure mode that makes "incomplete response" bugs look random.

Sessions Outlive the Browser Tab

Code sessions are server-owned; the tab is only a viewer.

application/code_sessions/service.py (47 KB) holds session state in the server process, independent of HTTP and browser lifetime, with a per-session lock and native thread history.

Reconnecting attaches to a running harness instead of restarting it — the difference between a web chat and a remote coding session.

A native Codex session inside FCC's browser UI, with model controls
A native Codex session inside FCC's browser UI, with model controls

Installer and Admin Surface

One script, one tray app, one admin page.

Keys, model tiers, fallback order, and integrations are configured in a local admin page; desktop and tray launchers wrap the same fcc-server process.

The whole surface is localhost-only by default — the proxy bears a bearer token if you enable Proxy Authentication.

FCC Admin UI: provider keys, model routing, and fallback ordering
FCC Admin UI: provider keys, model routing, and fallback ordering

2 · Benchmarks & Landscape

Measured from the current main branch, not from the README.

Where 290k Lines Went

The six heaviest adapters total 4,981 lines.

Line counts measured with wc -l; total Python in the repo is 289,950 lines. Routing is cheap — making foreign streams look native is not.

Three Kinds of Free

The 1.3B figure sums 61 different quota regimes.

Expiring credits, shared free-model pools, subscription quotas, and your own GPU are not one budget. Each has a different reset clock and a different failure shape.

PathCost modelFailure mode
NVIDIA NIMOne-time creditsCredits exhausted
OpenRouter :freeShared free pool429 under load
Copilot / ChatGPTOAuth subscriptionPer-account quotas
Google AI StudioFree key tierLow daily caps
Ollama / llama.cppYour GPU + wattsWeak tool use

Traction vs. Maintenance Load

77,544 stars, 12,116 forks, 462 open issues.

1,310 tracked files, AGPL-3.0-only, Python 3.14, uv-managed, with a commit inside the last 24 hours and PR numbers past #2,600.

Twelve harnesses are wrapped today (Claude Code, Codex, Pi, OpenCode, Cline, Hermes, Aider, and more) — each an adapter that can break on its next upstream release.

3 · Limits, Costs & Counterarguments

The expensive part is not tokens. It is the maintenance surface you just adopted.

Anthropic Does Not Support This Path

Official docs: no support for non-Claude routing.

The gateway documentation states that Anthropic "doesn't support routing Claude Code to non-Claude models through any gateway" and doesn't audit third-party gateways. Sessions behind a gateway are also not eligible for the HIPAA configuration.

Consequence: every Claude Code release can change the wire format, and a lagging shim surfaces as a broken feature rather than an error.

The Translation Tax Is Silent

Degradation arrives as worse answers, not exceptions.

Without /v1/messages/count_tokens, Claude Code falls back to character-based context estimates, which distorts compaction. Stripped anthropic-beta headers disable features. Fast-mode and WebFetch safety checks call api.anthropic.com directly and never appear in gateway logs.

Free Tier Is a Rate Limit, Not a Budget

The provider list is a churning surface, not a contract.

FCC's README concedes that free-tier limits are provider-controlled and that integrations are removed when they stop being allowed. Fallback models can consume quota on more than one provider before a request succeeds.

Multi-key rotation spreads a quota limit; it does not create capacity, and it is exactly what providers police.

90% Token Savings Is a Vendor Claim

RTK + Headroom compression, measured on someone else's traces.

Aggressive prompt compression trades context for tokens. On long refactors that shows up as accepted-diff rate, not as a bill. Benchmark your own sessions before trusting the number.

4 · Practical Decision Playbook

Test stream fidelity before you test the model.

A 40-Minute Fidelity Test

Assert message_stop, then measure time-to-first-token.

If events arrive in one burst at the end, the gateway is buffering and your agent will look flaky for reasons unrelated to model quality.

# 1. read the installer before piping it to sh
curl -fsSL https://raw.githubusercontent.com/Alishahryar1/free-claude-code/main/scripts/install.sh \
| sh
fcc-server            # gateway on 127.0.0.1:8082

# 2. fidelity test: -N disables curl buffering
curl -sN http://127.0.0.1:8082/v1/messages \
-H 'Content-Type: application/json' \
-d '{"model":"nvidia_nim/nvidia/nemotron-3-ultra-550b-a55b",
   "max_tokens":128,"stream":true,
   "messages":[{"role":"user","content":"reply OK"}]}' \
| tee /tmp/sse.txt | grep -E '^event: ' | sort | uniq -c

grep -q 'event: message_stop' /tmp/sse.txt && echo PASS || echo FAIL

Who Should Adopt, Who Should Wait

Solo prototyping now; regulated work later, if ever.

Adopt: individual prototyping, offline demos, and anyone who wants a Claude-Code-shaped client against a local model. Wait: teams needing audit trails, vendor support, or data-processing guarantees — you become the operator of a proxy that sees every token.

Operational Guardrails

Treat it as infrastructure, not a hack.

Pin the version (fcc-server --version; update deliberately), keep one key per provider for surgical revocation, cap per-provider rate and concurrency in Admin, enable Proxy Authentication, and keep fallback lists short — each entry is another party seeing your prompts.

5 · Verified Sources

Primary Sources

free-claude-code (AGPL-3.0, 77.5k stars)

Claude Code: LLM gateway overview

Claude Code: gateway protocol requirements

中文导读:免费 Claude Code:7.75 万星背后的协议转译层

FCC 在本地把 Anthropic 协议转译到 61 家上游,真正的工程是 SSE 账本、历史重放与降级路由;而 Anthropic 明确表示不支持这条路。

Primary Sources & References

  1. free-claude-code — GitHub
  2. Claude Code — LLM gateway
  3. Claude Code — gateway protocol requirements