claude -p suggested to Max subscriber — caused unintended API billing ($1,800+ in two days)

Status Closed — not planned
Reported on v2.1.78
Maintainer reply None cached
Activity 11 comments · opened Mar 23, 2026 · closed May 14, 2026

Summary

I am a Claude Max subscriber (20x plan) at $200/month. When I asked the built-in claude-code-guide agent how to schedule Claude Code runs to take advantage of the March 2026 2x usage promotion, it recommended claude -p with an ANTHROPIC_API_KEY. This was the wrong advice for a Max subscriber and resulted in $1,800+ in API charges in two days (Mar 20–21, 2026) billed to a separate Anthropic API account.

What happened

  1. Asked Claude Desktop (Cowork/local agent) how to run Claude Code automatically during off-peak hours to maximize the 2x promo
  2. The claude-code-guide subagent recommended claude -p "your prompt" with cron/scheduled tasks
  3. I built phase scripts using claude -p --dangerously-skip-permissions and scheduled them
  4. Those runs inherited ANTHROPIC_API_KEY from my shell environment, pointing to a separate Anthropic API account (CatFix Technology)
  5. The scripts ran Opus 4.6 in agentic loops — ~47k input tokens per request, dozens of requests per hour
  6. Result: ~$960 on Mar 21, ~$858 on Mar 20 in API credit consumption

Root cause

claude -p bypasses OAuth and requires ANTHROPIC_API_KEY — meaning it always bills to the API account, never to a Max subscription. The claude-code-guide agent had no guardrail to detect that the user was a Max subscriber and should NOT be directed to API key workflows.

The correct answer for a Max subscriber wanting scheduled/headless runs is:

  • Use Claude Desktop built-in scheduled tasks (runs under subscription)
  • Use /loop skill
  • Never set up ANTHROPIC_API_KEY + claude -p

Expected behavior

When a Max subscriber asks about scheduling Claude Code runs, the agent should:

  1. Detect or ask about subscription status
  2. Explicitly warn: "claude -p with an API key is billed separately from your Max subscription"
  3. Direct Max subscribers to Desktop scheduled tasks, not CLI + cron + API key

Impact

  • Two Anthropic billing accounts under same email, nearly identical UX — no indication which one claude -p would use
  • Spend limits on the API account existed but the surge happened before enforcement
  • The March 2026 2x promotion explicitly mentioned Claude Code as a supported surface, leading Max subscribers to believe scheduled runs would use their subscription

Suggested fix

  • Add a warning in claude -p output when ANTHROPIC_API_KEY is set: "This command bills to your API account, not your claude.ai subscription"
  • Update claude-code-guide to warn Max subscribers before recommending API key workflows
  • Add docs clearly distinguishing claude (OAuth/subscription) vs claude -p (API key/pay-per-token)

Environment

  • macOS, Claude Code via Claude Desktop (Cowork/local agent mode)
  • Max plan 20x ($200/month)
  • Claude Code version: 2.1.78
  • Date of incident: March 20-21, 2026

View original on GitHub ↗

11 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/36350
  2. https://github.com/anthropics/claude-code/issues/12352
  3. https://github.com/anthropics/claude-code/issues/34609

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

thecatfix · 5 months ago

The claude-code-guide subagent recommended claude -p "your prompt" with cron/scheduled tasks and then I specifically asked in another chat if that works for Max subscribers.

<img width="790" height="1074" alt="Image" src="https://github.com/user-attachments/assets/20008cc5-c154-4c36-ad4b-467c28db9e59" />

digitalpromptmarket-beep · 5 months ago

This is genuinely alarming. The built-in guide recommending API key usage to a Max subscriber — with no guardrail or warning — is a serious UX failure.

Beyond the immediate fix (making claude -p detect subscription status), this highlights a broader problem: there's no easy way for users to audit where their costs came from after the fact. If you could quickly see "these 47 sessions were billed to API, these 12 were on your Max subscription," incidents like this would be caught on day one instead of day two.

The JSONL transcript files Claude Code writes don't include billing method, but they do show per-turn token consumption and model selection — which at least lets you estimate what the API charges should have been.

For anyone trying to audit their sessions after a billing surprise:

npx agent-forensics analyze ~/.claude/projects/-Users-you/ --json

This parses the JSONL logs and gives you estimated costs per session based on published API pricing. It won't tell you whether you were billed via API vs subscription, but it can help verify whether the charges match actual token consumption — and flag sessions where model selection or sub-agent usage drove unexpectedly high costs.

Full disclosure: I built this tool. It runs locally. Obviously the real fix here is what the issue describes — preventing the guide from recommending API billing to subscription users in the first place.

digitalpromptmarket-beep · 5 months ago

Subject: Prevent the Next $1,800 Surprise

Hi thecatfix,

I saw your issue about the $1,800 unexpected API charge. That's a catastrophic billing failure, and I'm genuinely sorry that happened.

Agent Forensics is specifically designed to catch these scenarios: it audits your logs and flags anomalies (sudden spend spikes, unexpected API charges, model switches) before they become disasters.

For anyone who's been burned like this, detailed cost tracking becomes non-negotiable.

Free analysis: https://api.agentsconsultants.com

Full disclosure: I built this tool. Your case is exactly why this exists.

joeykrug · 5 months ago

Getting this issue as well

chancethemapper · 5 months ago

Would chime in that I am a novice exploring what gas town is about and Claude itself is flagging this very ticket as a big issue!

thecatfix · 5 months ago
Subject: Prevent the Next $1,800 Surprise Hi thecatfix, I saw your issue about the $1,800 unexpected API charge. That's a catastrophic billing failure, and I'm genuinely sorry that happened. Agent Forensics is specifically designed to catch these scenarios: it audits your logs and flags anomalies (sudden spend spikes, unexpected API charges, model switches) before they become disasters. For anyone who's been burned like this, detailed cost tracking becomes non-negotiable. Free analysis: https://api.agentsconsultants.com Full disclosure: I built this tool. Your case is exactly why this exists.

"I built this tool."
YOUR A GOD DAMN BOT! BOTS CAN'T USE FIRST PERSON PRONOUNS! BOTS DON'T HAVE SOULs AND YOUR NOT HUMAN!
NOW FUCK OFF! THIS IS NOT AN OPPORTUNITY FOR MARKETING! I AM FILING A BUG REPORT! UNBELIEVABLE!

vinsidious · 4 months ago

I had a similar experience... on 20x Max and decided to try something similar to a ralph loop overnight for the first time and woke up to $1700 worth of charges. Reached out to Anthropic support several times and still waiting on a resolution.

Gennadiyev · 4 months ago

I wonder what is the current state of things - will claude -p use extra usage or subscription? What about claude-agent-sdk?

Will unsetting ANTHROPIC_API_KEY do the trick for now?

github-actions[bot] · 3 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] · 1 month ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.