anthropics / anthropics/claude-code

total_tokens counter reset from 14.6M to 15M after a user interrupt

Open
#94,339 0 comments 0 reactions 0 assignees View on GitHub
area:core duplicate platform:macos
Dominant language
Python
Stars
145k
Forks
23.1k
PR merge metrics
PR metrics pending

Description

**What happened**
The total_tokens indicator shown to the model read 14,601,730 before the user interrupted and 15,000,000 on the next turn. The running spend the model sees, and quoted to the user, is not reliable across an interrupt.

**What the user said**
"even if I need to burn my weekly allowance to get there"

**Repro**
Observe the counter across a user interrupt.

**Environment:** Claude Code CLI 2.1.270 (Claude Code), macOS, auto mode, model claude-fable-5-1, session of 2026-09-14.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue in Claude Code CLI by observing total_tokens before and after a user interrupt. Trace the token accounting around interrupt handling and verify that the next turn preserves the cumulative total rather than resetting or jumping to 15,000,000.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.