claude-code - 💡(How to fix) Fix [FEATURE] Token usage visibility and threshold hooks in Claude Code [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47720Fetched 2026-04-15 06:44:11
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×5
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

When using the Claude Code desktop app (Pro/Max plans), there is no visibility into daily token consumption during a session. When the limit is reached, the session simply stops — no warning, no summary, no opportunity to wrap up.

This creates two real problems:

  1. Work in progress is lost without any signal it was about to happen.
  2. There's no way to act proactively — by the time you notice, it's already too late.

This affects any workflow involving long, multi-step sessions where context has been built up over time (debugging complex issues, scaffolding features, iterative design work). The loss of context mid-session forces a full restart the next day with no record of what was done or what remained.

Proposed Solution

When using the Claude Code desktop app (Pro/Max plans), there is no visibility into daily token consumption during a session. When the limit is reached, the session simply stops — no warning, no summary, no opportunity to wrap up.

This creates two real problems:

  1. Work in progress is lost without any signal it was about to happen.
  2. There's no way to act proactively — by the time you notice, it's already too late.

This affects any workflow involving long, multi-step sessions where context has been built up over time (debugging complex issues, scaffolding features, iterative design work). The loss of context mid-session forces a full restart the next day with no record of what was done or what remained.

Alternative Solutions

When using the Claude Code desktop app (Pro/Max plans), there is no visibility into daily token consumption during a session. When the limit is reached, the session simply stops — no warning, no summary, no opportunity to wrap up.

This creates two real problems:

  1. Work in progress is lost without any signal it was about to happen.
  2. There's no way to act proactively — by the time you notice, it's already too late.

This affects any workflow involving long, multi-step sessions where context has been built up over time (debugging complex issues, scaffolding features, iterative design work). The loss of context mid-session forces a full restart the next day with no record of what was done or what remained.

Priority

High - Significant impact on productivity

Feature Category

Configuration and settings

Use Case Example

Scenario: multi-hour feature development session

  1. I open Claude Code desktop to work on a new feature. The session starts fresh.
  2. Over 2–3 hours, Claude reads multiple files, runs commands, writes code, and we iterate on the implementation together.
  3. Midway through a complex refactor — context is rich, decisions have been made, multiple files are in flux — the session abruptly stops. Daily token limit reached.
  4. No warning was given. No summary was saved. The next day I have to reconstruct what was done, re-read files, and re-explain decisions already made.

With the proposed feature:

At ~80% usage, an alert appears. I have a few minutes to type /compact, ask Claude to write a summary of the session state to disk, or at minimum finish the current task cleanly. When the limit hits, I have a .session-summary.md with completed work, current state, and next steps — ready to paste at the start of the next session.

Additional Context

  • Platform: Claude Code desktop app (macOS)
  • Plan: Pro / Max (subscription-based — no API key, no external usage monitoring possible)
  • The Stop hook exists but cannot solve this: it fires at session end, when no tokens remain for generation
  • Similar patterns exist in other tools: VS Code shows token usage in Copilot; Cursor displays context window fill percentage inline
  • A threshold hook would be a low-effort, high-impact addition for power users who already use the hooks system

extent analysis

TL;DR

Implementing a token consumption visibility feature with a warning threshold, such as an alert at 80% usage, would allow users to proactively manage their sessions and prevent work loss.

Guidance

  • Consider adding a feature to display daily token consumption in real-time, similar to VS Code's Copilot token usage display or Cursor's context window fill percentage.
  • Introduce a threshold hook that triggers an alert when the token limit is approaching (e.g., 80% usage), allowing users to take action before the session stops.
  • Explore the possibility of automatically saving a session summary to disk when the token limit is reached, to help users recover their work.
  • Investigate the feasibility of integrating the proposed feature with the existing hooks system, potentially leveraging the Stop hook as a starting point.

Example

No code snippet is provided, as the issue focuses on a feature request rather than a specific implementation.

Notes

The proposed feature would require changes to the Claude Code desktop app, specifically the Pro/Max plans, and may involve updates to the app's UI, hooks system, and token management logic.

Recommendation

Apply a workaround by manually tracking token usage and setting reminders to save work periodically, until the proposed feature is implemented. This approach can help mitigate the issue, but a native feature implementation would provide a more seamless and effective solution.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING