Claude Code (Pro/Max subscriptions) has 5-hour and 7-day/weekly usage caps. If you're running long, semi-autonomous sessions — especially ones that dispatch sub-agents via the Agent/Task tool — it's easy to get cut off mid-task with no warning and no record of what was in progress. Resuming such a session after the cache expired will use a good portion of the next quota window and resuming with compacting the context that was cut short often doesn't give me the result I want. A formal handoff to a next agent or session is a clean boundary between sessions.
This is a self-contained setup that:
- Surfaces live quota usage (session % and weekly %) into the model's own context every turn, and every time a sub-agent finishes — not just when a human types something, so it also works during fully hands-off runs.
- Tells the orchestrator, via
CLAUDE.md, to write a handoff document (.claude/HANDOFF.md) once usage crosses a so