Turn AI rate limits into high-quality checkpoints. Schedule work across Claude Code, Codex, Grok Build, Antigravity & more. Auto-update your Second Brain + handoff.md.
Project description
rate-limit-handoff
Rate limits are a continuity problem.
Wait for the same model, continue now in another model, or switch and return later.
Preserve the exact next action in a living handoff.md so context never evaporates.
Why this exists
A serious AI session accumulates decisions, rejected paths, repository state, test evidence, constraints, and one exact next action. When the current model hits a limit, chat history alone is not a reliable operating state.
rate-limit-handoff gives you three explicit continuity routes:
- Same-model wait — preserve the work and wait for the supplied reset time, with optional explicit auto-run when the same model is expected to be available.
- Cross-model handoff — preserve the context and continue immediately in another provider or model.
- Return later — switch temporarily, then schedule a return to the original model.
Every route writes the durable context first. Context stops evaporating; knowledge compounds.
Features
- Multi-tool by design — Claude Code, OpenAI Codex, Grok Build, Antigravity (agy), Cursor, Hermes
- Proactive offer — skills/rules that present the three continuity routes when capacity is low
- One living handoff.md — single source of truth that works across tools and machines
- Second Brain integration — every schedule automatically writes a dated note so knowledge compounds
- Usage parsers — paste
/statusor dashboard text; extracts remaining % and reset hint - Explicit local auto-run — executes only user-supplied commands, parsed into arguments with
shell=False - Best-effort local jobs — detached runners and reminder artifacts are local, not reboot-durable services
- Zero heavy deps — pure Python stdlib, works offline
- MIT licensed — use it, fork it, ship it inside your company
Quick Start
# Install from GitHub
pip install git+https://github.com/PurpleOrangeAI/rate-limit-handoff.git
# Or install from source for development
git clone https://github.com/PurpleOrangeAI/rate-limit-handoff.git
cd rate-limit-handoff
pip install -e .
The first PyPI release is pending. There is no PyPI installation command yet.
1. Bootstrap a workspace (once)
cd /path/to/your/project-or-second-brain
rate-limit-handoff --init
This creates:
handoff.md(living session state)second_brain/skeleton with skills + project notes
To write checkpoint notes into an existing Obsidian vault while keeping handoff.md
in the project root:
rate-limit-handoff --workspace /path/to/project \
--second-brain-root /path/to/MySecondBrain \
--init
When the supplied root already contains 00 Inbox/ and 10 Projects/, the CLI writes
notes to 00 Inbox/ and uses 10 Projects/ai-rate-limit-handoff/ for the project entry.
Otherwise it preserves the portable inbox/ and projects/ layout.
2. Choose a continuity route
Same-model wait
rate-limit-handoff --schedule \
--model claude \
--reset-at "16:00" \
--summary "Continue the verified release work" \
--auto-run \
--command 'claude -p "Read handoff.md and continue the exact next action"'
Omit --auto-run and --command to create the durable handoff and best-effort local
reminder/resume artifact without executing a model command.
Immediate cross-model handoff
rate-limit-handoff --handoff \
--from claude \
--to codex \
--summary "Continue from the active handoff chain" \
--auto-run \
--command 'codex exec "Read handoff.md and continue the exact next action"'
Temporary switch with planned return
rate-limit-handoff --handoff \
--from claude \
--to codex \
--return-to claude \
--return-at "16:00" \
--summary "Use Codex now, then return for the final review" \
--auto-run \
--command 'codex exec "Read handoff.md and continue"' \
--return-command 'claude -p "Read handoff.md and perform the planned return"'
Resume with a preference
rate-limit-handoff --resume --prefer claude
--prefer changes the continuation instruction. It does not launch that model.
Auto-run truth boundary
Auto-run is opt-in. rate-limit-handoff executes only the explicit command you supply, parses it into arguments, and launches it with shell=False.
The supplied reset time is the availability signal. v0.2.1 does not query provider APIs to confirm that capacity has returned, does not guess provider CLI syntax, and does not guarantee that a detached local job survives a machine reboot. This means there is no live provider-availability detection.
Without --auto-run, scheduling remains a durable handoff plus a best-effort local reminder/resume artifact.
Extra power
# Parse Codex /status or any dashboard paste
rate-limit-handoff --parse-usage "5h limit: 12% left (resets 04:00)"
# Local Codex hints
rate-limit-handoff --codex-status
# Status + model info
rate-limit-handoff --status --model antigravity
Supported Tools
| Tool | Window style | Operator-supplied capacity signal | Possible destination |
|---|---|---|---|
| Claude Code | 5h + weekly | UI countdown / % | lighter Claude / Haiku |
| OpenAI Codex | 5h + weekly (reasoning heavy) | /status, Settings → Usage |
GPT-5.4 / mini |
| Grok Build | Usage % + API | CLI / console | lighter Grok |
| Antigravity (agy) | 5h refresh + weekly | /context, "Resets in Xh" |
Gemini Flash |
| Cursor | Backend-model dependent | Model switcher | cheaper model |
| Hermes + Grok | SuperGrok weekly + RPS/TPM | Hermes /usage | Grok-3 / mini |
The single handoff.md is the universal bridge. Start in Claude Code, hit limit, schedule, resume in Codex (or vice-versa). Your Second Brain stays coherent.
Skills & Instructions (copy these)
After --init you get ready-to-use skills in second_brain/system/skills/:
codex-skill-rate-limit-handoff.mdgrok-build-rule-rate-limit-handoff.mdantigravity-agy-skill-rate-limit-handoff.mdauto-detect-limits-general.md
Copy the relevant skill into:
- Claude Project custom instructions / Claude Code
- Codex skills or system prompt
- Grok Build / Hermes system prompt
- Antigravity (agy) rules
- Cursor Rules (
.cursor/rules) - Continue.dev / any multi-model frontend
They make the AI respond to low-capacity signals by offering the three continuity routes. They do not add live provider-availability detection.
Architecture (mental model)
┌─────────────────┐ low capacity ┌──────────────────────┐
│ Any AI Session │ ───────────────────► │ Wait / hand off / │
│ Claude / Codex │ │ switch and return │
│ Grok / agy / │ └──────────┬───────────┘
│ Cursor / etc │ │ yes
└─────────────────┘ ▼
┌─────────────────┐ update ┌──────────────────────┐
│ handoff.md │ ◄──────────────────── │ rate-limit-handoff │
│ (living state) │ │ + Second Brain note │
└─────────────────┘ └──────────┬───────────┘
│
│ explicit command
▼
┌──────────────────────┐
│ best-effort local job│
│ or reminder artifact │
└──────────────────────┘
Design Philosophy
- Prefer schedule / handoff over silent fallback — make the routing decision explicit.
- Always write to both handoff.md and a dated Second Brain note — knowledge compounds.
- Model-agnostic — the same workflow works whether you live in Claude Code, Codex, or rotate between them.
- Zero magic, full control — pure Python, no telemetry, no cloud, no accounts.
- Forced checkpoints are a feature — every time you schedule you leave a clean, resumable trail.
Development
git clone https://github.com/PurpleOrangeAI/rate-limit-handoff.git
cd rate-limit-handoff
pip install -e ".[dev]"
ruff check .
pytest
mypy src
python -m build
Roadmap (community welcome)
- Pure rolling-window estimator that does not require user-provided reset time
- Hermes / xAI header watcher that auto-triggers schedule
- Telegram / Discord / desktop toast on schedule fire
- Obsidian / Logseq plugin for richer Second Brain integration
- More tools (Kilo, Cline, Roo, etc.) as they mature
Contributing
PRs welcome. Especially:
- New model/tool definitions
- Better usage parsers
- Skills for additional frontends
- Documentation & examples
Please keep the spirit: simple, offline-first, opinionated toward quality continuity.
License
MIT © 2026 Purple Orange AI
Inspiration & Related Work
- Community
HANDOFF.mdpatterns that many of us already use manually - Cross-tool handoff tools such as
cli-continues - The daily reality of 5-hour windows on Claude Code and Codex
This project exists because the best solution is the one that also grows your Second Brain.
Made with ❤️ for builders who refuse to lose flow.
@PurpleOrangeAI
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rate_limit_handoff-0.2.1.tar.gz.
File metadata
- Download URL: rate_limit_handoff-0.2.1.tar.gz
- Upload date:
- Size: 34.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eecb85da000a60c075d7b8dd033c0811bd717b9c43a3de5f384ce77c98717015
|
|
| MD5 |
feff8e65aa18066356f5e23e6f2bf6ad
|
|
| BLAKE2b-256 |
3201d6cc82f26a94818fef39ab40d5676b167e018885cd230238714d417aee6d
|
Provenance
The following attestation bundles were made for rate_limit_handoff-0.2.1.tar.gz:
Publisher:
release.yml on PurpleOrangeAI/rate-limit-handoff
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rate_limit_handoff-0.2.1.tar.gz -
Subject digest:
eecb85da000a60c075d7b8dd033c0811bd717b9c43a3de5f384ce77c98717015 - Sigstore transparency entry: 2179041406
- Sigstore integration time:
-
Permalink:
PurpleOrangeAI/rate-limit-handoff@82545ac1c58e7517765852469482eead61920a9f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/PurpleOrangeAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@82545ac1c58e7517765852469482eead61920a9f -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file rate_limit_handoff-0.2.1-py3-none-any.whl.
File metadata
- Download URL: rate_limit_handoff-0.2.1-py3-none-any.whl
- Upload date:
- Size: 28.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a22d61b20465d8e1a1edba13b52cb55001f27fb9124b20adcdcb7e99de34b2bd
|
|
| MD5 |
54c14390e5ef6ecfe32d05cc572384bc
|
|
| BLAKE2b-256 |
490ec4aa7ffaacb4aa75ebcacea139bbacfb510d496d38157baded5ec9072761
|
Provenance
The following attestation bundles were made for rate_limit_handoff-0.2.1-py3-none-any.whl:
Publisher:
release.yml on PurpleOrangeAI/rate-limit-handoff
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rate_limit_handoff-0.2.1-py3-none-any.whl -
Subject digest:
a22d61b20465d8e1a1edba13b52cb55001f27fb9124b20adcdcb7e99de34b2bd - Sigstore transparency entry: 2179041425
- Sigstore integration time:
-
Permalink:
PurpleOrangeAI/rate-limit-handoff@82545ac1c58e7517765852469482eead61920a9f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/PurpleOrangeAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@82545ac1c58e7517765852469482eead61920a9f -
Trigger Event:
workflow_dispatch
-
Statement type: