Foxl v0.2.16 brings back Claude Code (OAuth) - but this time as a proper compatibility layer, not a direct pipe. The provider was disabled in v0.2.15 after we discovered Anthropic's subscription pool was silently re-routing our requests to pay-as-you-go billing. This post is about how we fixed it.

The problem we found
Anthropic gives Claude Pro and Claude Max subscribers an OAuth endpoint to use their subscription allowance through api.anthropic.com. Officially it is there for the Claude Code CLI. Unofficially, third-party tools (including Foxl up to v0.2.14) have been reusing the same endpoint to let Pro/Max users avoid paying per-token when they already pay per-month.
Two weeks ago we started getting reports that Foxl was burning through users' "Extra usage" budgets much faster than expected. We captured one user's request directly off the wire and replayed it against api.anthropic.com with their OAuth token. What came back was a 400 with "You're out of extra usage" - meaning Anthropic had rejected the request on the pay-as-you-go pool, not the subscription pool. Their subscription allowance was untouched.
We then mutated the request shape piece by piece to find what was triggering the re-route. The results were precise enough to be useful:
The routing rules
- Preamble-only system + zero tools: 200 OK, routed to the subscription pool.
- Preamble-only system + any tools at all with Foxl's tool names: 400 "out of extra usage". Subscription pool refused, routed to pay-as-you-go, which had no credit.
- Preamble-only system + a tools list using the official CC names (
Bash, Read, Grep, WebFetch): 200 OK again, back on the subscription pool. - Preamble with a single extra line of persona text + zero tools: 429 throttled (same pool, but flagged as suspicious).
The routing gate was two separate checks - the system field had to start with exactly the Claude Code preamble and nothing else, and the tools list had to match the official CC names. Miss either condition and Anthropic quietly moves the request onto pay-as-you-go, where most subscribers have no credit and their agent silently fails.
This is not officially documented. It is almost certainly not something Anthropic wants third-party tools relying on. But it is also the only way to respect our users' subscriptions instead of accidentally charging them twice.
The fix: a compatibility layer
Rather than strip Foxl features down to match the CC shape, we built a translation layer. The Foxl agent loop keeps running with its own tool names, its own persona, its own workspace context - nothing inside the agent changes. At the HTTP boundary, we rewrite the request so the wire sees exactly what the subscription pool expects.
Part 1: the message rewriter
Foxl normally ships a multi-KB system prompt: persona, workspace context, agent behavior rules, the current date, everything the agent needs before it reads a single user message. That's what made the subscription pool unhappy - the first system block had 23 KB of text after the preamble.
The rewriter extracts everything except the Claude Code preamble from system, then wraps it in a <foxl-context> block and prepends it to the first user turn. The system field ends up as a single-element array with just the preamble text. The model still sees every byte of the original context - it just sees it as part of the conversation history instead of as a system directive.
The persona move costs us one thing: the first-turn prompt-cache boundary shifts by a few KB, so cache hit rate drops a little on the initial message of each session. After that the cache aligns normally because every subsequent user turn sits at the same position.
Part 2: the tool adapter
Foxl has around 22 tools registered by default. Four of them map cleanly onto the CC surface:
exec becomes Bashfile_read becomes Readcode_search becomes Grepweb_fetch becomes WebFetch
Each mapping ships with a CC-shaped JSON Schema and an input-transform function. When the model emits a Bash tool_use with {command, timeout} (CC shape), the wrapper translates timeout from milliseconds to seconds (Foxl shape), sets up the correct Foxl input, and delegates to the real Foxl exec tool. The agent loop never sees the translation - it just runs the Foxl callback it always ran.
The rest of Foxl's tools have no CC counterpart. Memory save and recall, workspace memory, subagent spawning, schedule management, channel send, browser extension control, view image - there is simply no CC tool that does any of these things, and inventing one would defeat the whole point (the subscription pool is only friendly to the exact names it recognizes). In compat mode these tools are dropped from the outbound tool list entirely. The model cannot emit tool_use blocks for them because it never sees them in the schema.
Tools that would collide on the same CC slot get de-duped. terminal and git both conceptually want Bash, but exec is the primary owner. terminal and git are dropped; the model handles terminal-like and git-like work through the one canonical Bash.
Where the trade-off lands
Compatibility mode gives you Claude Opus 4.7 and Sonnet 4.6 through your Pro/Max subscription with the core agent capabilities: running shell commands, reading files, searching code, and fetching URLs. That is enough for a lot of everyday work - code review, running tests, reading logs, web research.
What it does not give you: Foxl memory (the agent cannot remember things across sessions), subagent orchestration (no parallel children), scheduled tasks driven from within a conversation, or the browser extension. For any of those you need Foxl's full tool surface, which means either a Bring-Your-Own-Key Anthropic setup (pay per token, get every tool) or the foxl.ai relay (pay with Foxl credits, get every tool). The model selector shows all three paths side by side.
Haiku 4.5 is intentionally not exposed in compatibility mode. Even the official CC CLI has been observed to 429 on Haiku once the tool list grows past a few entries - something about how Haiku commits to tool_use across parallel calls doesn't play well with the subscription pool rate limits. Opus 4.7 and Sonnet 4.6 are stable; Haiku will come back if Anthropic ever loosens that path.
What is under the hood
The entire compat layer lives in three files, about 400 lines total, sitting beside the existing Claude Code OAuth provider:
compat/message-rewriter.ts owns the system/first-user relocationcompat/tool-adapter.ts owns the tool-name and schema translation, plus the dedupe and drop lists- The existing
core/transport.ts custom fetch calls into both during preparePayload and never touches the outgoing response stream
Because the rewrites happen at the HTTP boundary, the Strands agent loop, our hook system, the conversation manager, and the tool executor all stay untouched. Nothing inside Foxl needs to know which model it is talking to. Flip to BYOK or to the relay and the exact same agent loop runs against a full tool surface instead.
The first time you pick a Claude Code OAuth model we now surface an info dialog explaining the trade-off - which tools work, which don't, and why. Acknowledge once and it stays out of your way.
The risk we accept
Anthropic can change the subscription pool's routing logic whenever they want, and our compat layer breaks with it the moment they do. We intentionally made the layer loud about what it drops and keeps (the server logs the final tool list on every run), and we kept BYOK and the relay path as unaffected fallbacks. If Anthropic ever ships a contract-guaranteed subscription-compatible surface for third-party clients we will move to it immediately. Until then this is the best we can offer while still respecting your subscription.
Update Foxl to v0.2.16 and Claude Code will be back in your model picker. Let us know if you hit anything we missed.