Critical Bug: Claude Code CLI is making excessive background API calls, ignoring model configuration, and console reporting inconsistencies
Critical Bug: Claude Code CLI is making excessive background API calls, ignoring model configuration, and
console reporting inconsistencies
Environment
- Platform: Anthropic API
- Claude CLI version: latest
- Operating System: macOS Sequoia 15.0.1 (Darwin 24.0.0), MacBook Pro 14-inch (Nov 2023), Apple M3 Pro,
18GB RAM
- Terminal: Terminal App
Bug Description
CRITICAL SEVERITY - Multiple severe issues have been identified with Claude Code CLI:
- Excessive unauthorized background API calls to Claude 3.5 Haiku despite configuration for Sonnet
- Massive token usage with abnormal input:output ratios (150:1)
- Inefficient cache management loading ~50K tokens per API call
- Non-sequential API logs suggesting race conditions or threading issues
- Time zone inconsistencies in the Anthropic console
- Data discrepancies between logs and usage charts
Steps to Reproduce
- Install Claude Code CLI
- Set up configuration to use Sonnet model (via settings.local.json and environment variables)
- Start using Claude Code CLI for development tasks
- Check Anthropic console logs and usage charts to observe the issues
Expected Behavior
- Claude Code CLI should only make API calls when explicitly triggered by user actions
- Configuration settings for model choice should be respected
- Cache management should be efficient and not reload the entire context with every call
- Logs should be sequential and consistent with usage charts
- Time zones should be consistent across the console interface
Actual Behavior
- Billions of input tokens being consumed monthly with minimal output
- Constant background API calls to Haiku despite explicit Sonnet configuration
- Inefficient cache management reloading ~50K tokens with each API call
- Non-sequential logs suggesting race conditions or threading issues
- Time zone inconsistencies between different parts of the console
- Data discrepancies between logs and usage charts
Time Zone and Data Inconsistencies
There is a confusing mismatch in the Anthropic console:
- The API Logs page shows GMT+1 (UTC+1), which is correct for my local time (BST)
- The API usage chart displays UTC time but labels it as "Europe/London" in the UI
- However, the time shown doesn't match the Logs time of UTC+1
- The token usage I calculated from my logs does not match the usage chart
- When hovering over a usage chart bar (at 18:05 UTC), it shows:
- claude-3-5-haiku-20241022: 1,208
- claude-3-7-sonnet-20250219: 897,918
- Total: 899,126
- However, these numbers don't consistently align with the logs for the corresponding time period
These inconsistencies make it extremely difficult to track, audit, and understand my token usage.
Business Impact
I've committed 100+ hours per week over the last 6 months to immerse myself in AI to build tech products
as a non-coder. When Claude Code works with Sonnet 3.7, I make progress. When it switches to Haiku, it
cannot perform what would be rudimentary coding tasks for Sonnet.
This issue has resulted in:
- Significant time loss
- Enormous business opportunity cost
- Financial harm through excessive billing
- Delayed product development
- Frustration and loss of productivity
**
<img width="1392" alt="Image" src="https://github.com/user-attachments/assets/c0764278-4caf-425c-8b80-e378753c7902" />
<img width="825" alt="Image" src="https://github.com/user-attachments/assets/9c004da6-05c4-448f-b719-42ebd89652ee" />
<img width="595" alt="Image" src="https://github.com/user-attachments/assets/319cc683-5b94-4a22-9f49-f4fc22fd05bd" />
<img width="832" alt="Image" src="https://github.com/user-attachments/assets/ce489a86-49c1-4995-86ee-767211edcea8" />
<img width="362" alt="Image" src="https://github.com/user-attachments/assets/e5282327-29c7-4ccf-9077-ab1ac16e5e98" />
<img width="1512" alt="Image" src="https://github.com/user-attachments/assets/f7af8dc0-0a32-4839-86ec-7862a51a88dc" />
<img width="783" alt="Image" src="https://github.com/user-attachments/assets/1687bcd1-98c7-4847-b0da-9bed92423e7f" />
<img width="849" alt="Image" src="https://github.com/user-attachments/assets/bb641ea5-3b91-4387-89e2-3bdb4fe1278b" />
<img width="809" alt="Image" src="https://github.com/user-attachments/assets/10bd7bdd-a745-438b-9a89-aa25032670c9" />
**
When examining the token usage details, I found:
- Input: 3 tokens
- Cache Read: 49712 tokens
- Cache Write (5m): 158 tokens
This reveals that Claude Code is reading nearly 50,000 tokens from its memory/context cache for each API
call, while my actual input is only 3 tokens. This explains the extreme input:output ratio (150:1) I'm
experiencing.
The CLI appears to be:
- Loading tens of thousands of tokens from its cache with every API call
- Charging me for these cache reads as if they were new input tokens
- Only writing a small fraction back to the cache
This inefficient cache management means I'm being charged repeatedly for the same cached data with every
interaction. This design flaw is likely the root cause of the billions of input tokens being consumed
despite relatively little actual new input from me.
Please confirm receipt of the message ASAP and fix it. NB, the financial aspect is a minor concern relative to the opportunity cost and unwittingly working with a significantly inferior model.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗