Skip to content

Instantly share code, notes, and snippets.

@daniel5gh
daniel5gh / Quota-aware-Claude-Code.md
Last active July 19, 2026 23:22
Quota-aware Claude Code: automatic handoff docs before you hit a usage limit

Quota-aware Claude Code: automatic handoff docs before you hit a usage limit

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
@daniel5gh
daniel5gh / video.py
Last active January 25, 2023 15:56
Using python vlc bindings with OpenGL texture
# Copyright (C) 2020 Daniël van Adrichem <daniel5gh@spiet.nl>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

Keybase proof

I hereby claim:

  • I am daniel5gh on github.
  • I am danie1 (https://keybase.io/danie1) on keybase.
  • I have a public key whose fingerprint is B0FE CCCD 9A73 CFCC 81E6 328F 0CC7 F742 DC93 66D9

To claim this, I am signing this object: