Interactive session correctly authenticated via Pro subscription, but usage is billed against Console API balance instead — no identifiable local cause after full diagnostic
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Using Claude Code CLI on a Pro subscription, authenticated via /login
(OAuth, no ANTHROPIC_API_KEY present anywhere in the environment), real
usage is being billed against a separate Anthropic Console organization
balance ("Credit balance is too low" errors), while:
/statusconfirms subscription auth (Auth token: none,API key: /login managed key).- Subscription usage has plenty of headroom (45% of 5h session window, 36%
of weekly limit at time of failure).
- The "Usage credits" overflow-to-API-billing setting is explicitly
disabled in account settings (claude.ai/settings/usage).
- No
ANTHROPIC_API_KEYis present in the shell, in~/.bashrc/
~/.zshrc / ~/.profile, in any project .env / .envrc file, in
~/.claude/settings.json (env / apiKeyHelper), and direnv is not
installed.
This same type of workload (large multi-repo security audit) previously
consumed only the Pro subscription quota with no Console billing. The
behavior changed without any configuration change on my side.
Environment
- Claude Code version: 2.1.245
- OS: Windows 11, WSL2 (Ubuntu), Claude Code installed and run from inside WSL
- Node: v24.14.0 / npm: 11.9.0
- Install method: native installer (
curl -fsSL https://claude.ai/install.sh | bash) - IDE integration: VS Code (Remote-WSL) with the Claude Code extension,
version matches CLI (2.1.245)
- Plan: Claude Pro (individual)
- Console organization: "Ricardo's Individual Org" (same account/email as
the Pro subscription: rperez.zaravia@gmail.com)
What I expected
All usage from an interactive Claude Code session authenticated via
subscription OAuth (confirmed by /status) should be billed against the
Pro subscription's usage limits, not against the separate Console API
balance — regardless of whether the session uses foreground work,
subagents (Task tool), or background agents, per the documented behavior in
"Use Claude Code with your Pro or Max plan."
What actually happened
Attempt 1 — 6 parallel background agents
Launched 6 code-review agents in background (run_in_background) across
different repos of the same project. All 6 failed sequentially with:
Agent "<name>" failed: Agent terminated early due to an API error:
Credit balance is too low
Credit balance too low · Add funds: https://platform.claude.com/settings/billing
Console check confirmed the organization balance was genuinely at -$0.74.
Recharged $6.00. A single re-run of ONE background agent alone dropped the
balance to $3.64 (~$2.36 consumed by one agent), confirming background
work was drawing real dollars from Console, not from the subscription.
Attempt 2 — explicit instruction to avoid background/subagents
Added a standing instruction (via ~/.claude/CLAUDE.md, confirmed loaded
via /context → Memory files count increased after the edit) telling the
agent not to launch background or parallel agents without asking first.
First test: the agent still launched 2 background agents on its own
initiative, despite the loaded instruction — narrating its own reasoning as
context-window management ("to avoid accumulating raw code in context"),
not because I asked for background. After being corrected in-session, it
switched to sequential foreground work and explicitly wrote a memory entry
about the correction (wrote 2 memories).
Attempt 3 — explicit instruction with NO Task tool at all
On a later request, I explicitly instructed the agent not to use the Task
tool or delegate to subagents in any form, and to audit each repo directly
in the same conversation (fully foreground, no dispatch of any kind). The
same error appeared again:
Credit balance too low · Add funds: https://platform.claude.com/settings/billing
This rules out subagent dispatch (Task tool) as the mechanism, since none
was used for this attempt.
Ruled out during diagnosis (with evidence)
| Hypothesis | Check performed | Result |
|---|---|---|
| ANTHROPIC_API_KEY in shell | echo $ANTHROPIC_API_KEY | Empty |
| Key in shell profile files | grep -r "ANTHROPIC_API_KEY" ~/.bashrc ~/.zshrc ~/.profile ~/.env | No matches |
| Key in ~/.claude/settings.json | Manual inspection | Only model, effortLevel, theme — no env/apiKeyHelper |
| Key in project .env/.envrc/docker files | Custom script scanning ~/projects recursively | Only a .env.example template (inert, unrelated repo, not part of the audited project) |
| direnv auto-loading a project .envrc | command -v direnv | Not installed |
| Known issue #39903 (subagents route through stray API key) | Compared root cause | That issue's repro requires an ANTHROPIC_API_KEY present in the environment for another app — not present in my case; also closed as "not planned" |
| Subscription quota exhausted, auto-overflow to Console | claude.ai/settings/usage screenshot | 45% session / 36% weekly used (plenty of headroom); "Usage credits" overflow toggle is OFF |
| Background agent dispatch as the trigger | Reproduced the error in Attempt 3 with zero subagents/background, fully foreground | Error still occurred |
Evidence available on request
/statusoutput from the affected session (subscription auth confirmed).- Console billing screenshots: balance at -$0.74, recharge to $6.00, drop
to $3.64 after one background agent.
claude.ai/settings/usagescreenshot showing 45%/36% usage and overflow
toggle disabled.
- Full transcript of Attempt 2 and Attempt 3, including the agent's own
narration of its reasoning before dispatching background agents.
Suggested next steps for investigation
- Confirm whether interactive Claude Code sessions have any code path that
can independently authenticate a request against Console credentials
even when the parent session is OAuth/subscription-authenticated, with
no API key present anywhere in the user's environment.
- Check whether there's an account-level condition (e.g., the "Ricardo's
Individual Org" Console organization being linked to the same email as
the Pro subscription) that causes ambiguous routing between the two
billing systems.
- If possible, correlate the Console request logs for the affected
timestamps with the Claude Code session ID to identify which internal
component issued the request.
Related issues (not duplicates)
- #39903 and #45572 describe similar symptoms (Console billing instead of
subscription), but their root cause requires ANTHROPIC_API_KEY present in
the environment. My diagnosis explicitly ruled that out (see "Ruled out
during diagnosis" table above), so this appears to be a distinct cause
with the same symptom.
What Should Happen?
An interactive Claude Code session authenticated via Pro subscription
(confirmed via /status: Auth token: none, API key: /login managed key)
should have all its usage billed against the subscription's usage limits —
regardless of whether the work is done in foreground, via subagents (Task
tool), or in background — as long as no ANTHROPIC_API_KEY is present
anywhere in the environment and the "Usage credits" overflow setting is
disabled.
Error Messages/Logs
Agent "<name>" failed: Agent terminated early due to an API error:
Credit balance is too low
Credit balance too low · Add funds: https://platform.claude.com/settings/billing
Steps to Reproduce
- Authenticate Claude Code CLI via subscription OAuth: run
claude,
complete browser login with a Claude Pro account. Confirm with /status
that Auth token: none and API key: /login managed key (subscription
auth, not a raw API key).
- Confirm no ANTHROPIC_API_KEY is present anywhere: check the shell
(echo $ANTHROPIC_API_KEY), shell profile files (~/.bashrc, ~/.zshrc,
~/.profile), project .env/.envrc files, and ~/.claude/settings.json
(env/apiKeyHelper fields). All empty/absent in my case.
- Confirm subscription usage has headroom and overflow is disabled: check
claude.ai/settings/usage — in my case, 45% of the 5-hour session window
used, 36% of weekly limit used, and the "Usage credits" overflow-to-API
toggle explicitly OFF.
- In an interactive session, explicitly instruct Claude NOT to use the
Task tool or dispatch any subagents, and to do all work directly in the
same foreground conversation:
"Do not use the Task tool or delegate to subagents in any form. Do this
work yourself, directly, in this same conversation."
- Give it a substantial, multi-file code review/audit task on a real,
large-ish codebase (in my case: a security audit across a multi-repo
project — Java/Spring Boot microservices).
- After some minutes of real foreground work (reading files, running
shell commands, writing output), the session fails with:
"Credit balance too low · Add funds: https://platform.claude.com/settings/billing"
- Check the Console organization balance (console.anthropic.com →
Plans & Billing) — it will show a real, non-zero dollar amount was
consumed, despite steps 1-3 confirming subscription auth with headroom
and overflow disabled.
Note: I do not have a minimal, fully isolated reproduction — the trigger
condition is not yet identified (see the "Ruled out during diagnosis" table
above for everything I've already excluded as the cause). This reproduces
reliably with large, real-world multi-file audit workloads in my
environment (WSL2 Ubuntu on Windows 11, Claude Code 2.1.245), but I have
not yet confirmed a small synthetic example that triggers it.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.245
Platform
Claude Pro subscription (claude.ai / Claude Code, NOT direct API/Console usage)
Operating System
Windows 11 (WSL2 - Ubuntu)
Terminal/Shell
WSL2 Ubuntu terminal, Claude Code launched via code . (VS Code Remote-WSL integrated terminal)
Additional Information
Regarding "Is this a regression?": I'm inferring this based on my own usage
pattern over time (the same type of large multi-repo audit workload
previously consumed only my Pro subscription quota, with no Console
billing) — not from a controlled before/after test across specific Claude
Code versions. I don't have a "last known working" version number to point
to, so please treat the regression claim as circumstantial rather than
confirmed.