[FEATURE] Token usage visibility and threshold hooks in Claude Code
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] 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:
- Work in progress is lost without any signal it was about to happen.
- 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:
- Work in progress is lost without any signal it was about to happen.
- 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:
- Work in progress is lost without any signal it was about to happen.
- 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
- I open Claude Code desktop to work on a new feature. The session starts fresh.
- Over 2–3 hours, Claude reads multiple files, runs commands, writes code, and we iterate on the implementation together.
- 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.
- 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
Stophook 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
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗