[FEATURE] Expose usage-limit reporting and add hook points for graceful shutdown and resume
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
The model and hooks appear have no visibility into my session or weekly usage, and no way to act on it. When a session hits its limit and pauses mid-task, the model learns only after the fact, so long-running work is interrupted with no graceful shutdown and can be left half-applied. Nothing signals when a new session begins, so nothing can trigger a resume. I run multi-step work that often spans these boundaries.
Proposed Solution
Two platform primitives. Anthropic exposes the data and the extension points; users write their own shutdown and resume logic.
- Expose limit reporting: current usage percentage and reset time for both the session and weekly windows, available to the model and to hooks.
- Provide hook points: a usage-threshold hook that fires when a configurable threshold is crossed (for example 85 percent of the session limit), and a SessionStart signal that reports a prior session ended at a limit and which one. Thresholds and scripts live in settings.json.
Let each user decide what graceful shutdown and resume mean. A standard handoff-file resume could ship as an optional default, but the primitive is the ask.
Alternative Solutions
- One built-in behavior with no user control. Every workflow handles interruption differently, so a fixed behavior fits few; a signal plus an extension point is more durable.
- A manual handoff file the model maintains. My current workaround, but it only fires when I remember to trigger it and cannot tell a session limit from a weekly one.
- A UI-only usage warning. Tells me a limit is close but gives me nothing to attach shutdown or resume logic to.
Priority
High - Significant impact on productivity
Feature Category
Configuration and settings
Use Case Example
I write a threshold hook that fires at 90 percent of the session limit: finish the current file, write a checkpoint, stop new work. The session pauses. On the next session, the SessionStart signal reports it ended at the session limit, and my resume hook points the model at the checkpoint to continue from the next file. For the weekly limit I write a more conservative hook, since the reset can be days away. The platform exposes the state and the hook points; the behavior is mine.
Additional Context
My current handoff-file workaround only works when I remember to trigger it and does not distinguish session from weekly limits. The missing pieces are platform primitives: the limit reporting (usage percentage and reset time for both windows) and the hook points to attach my own shutdown and resume logic.
<img width="662" height="143" alt="Image" src="https://github.com/user-attachments/assets/f25b3404-36eb-4131-9f30-e4ba0770ce5a" />