rethread
v0.2.0
Published
Portable, token-bounded handoffs between Claude Code, Codex, and Antigravity when an AI coding subscription hits its quota.
Maintainers
Readme
rethread
Carry unfinished work across Claude Code, Codex, and Antigravity without paying the context tax again.
Running multiple $20 AI-coding subscriptions? You know the moment: one coding agent hits its usage limit mid-task, and the next agent burns its own quota re-reading the repository and repeating failed approaches.
rethread creates a small, secret-redacted, token-bounded handoff so the next CLI can continue immediately.

Quick start
$ npm install --global rethread
$ rethread
rethread — continue work across coding agents
1. Claude Code
2. Codex
3. Antigravity
Select tools [1,2]: 1,2
Install automatic checkpoint hooks? [Y/n]:
✓ ready — claude, codex
✓ hooks installed — claude (SessionEnd), codex (Stop, PreCompact)
next: rethread checkpoint "what you’re working on"When an agent runs out of quota:
$ rethread checkpoint "fix login redirect" --next "add regression test" --failed "middleware guard"
$ rethread resume --agent codex
handoff ~800 tokens · cold re-read ~11K · saved ~10K (93%)Commands
| Command | Purpose |
| --- | --- |
| rethread | First-run setup; later shows current task and subscription status |
| rethread checkpoint "goal" | Capture Git state, decisions, failures, commands, and next actions |
| rethread resume --agent codex | Emit a token-bounded handoff for the next coding agent |
| rethread list | List saved checkpoints newest-first |
| rethread status | Show checkpoint freshness, dirty state, quota runway, and lifetime savings |
| rethread hooks install | Safely install missing hooks for configured agents |
What gets handed off
- Current goal, decisions, failed approaches, and explicit next actions
- Branch, commit, changed files, dirty state, and diff summary
- Recent shell commands and test/build output tail
- Estimated handoff size, cold-read size, and tokens saved
The target is a useful brief under roughly 2K tokens—not a transcript dump or another memory database.
Automatic checkpoints
Interactive setup can install hooks with your permission. Existing hook files are merged, backed up, and deduplicated.
- Claude Code:
SessionEnd - Codex:
StopandPreCompact - Antigravity: manual checkpoints in v1
Codex asks you to review and trust newly installed hooks through /hooks before running them.
Why not repository packing or agent memory?
Repository packing still spends tokens describing code the next agent can inspect when needed. Per-agent memory stays inside one vendor. rethread records the small piece neither can reconstruct reliably: what you were trying to do, what changed, what failed, and what should happen next.
Local, open, and inspectable
Handoffs are local Markdown plus JSON validated against a published schema. rethread never drives agent UIs, parses private session stores, proxies prompts, or touches subscription credentials. Common API keys, bearer tokens, URL credentials, private keys, and configured patterns are redacted before persistence.
Deliberate limits
No token proxy. No account automation. No cloud service. No daemon. No semantic memory. Quota runway uses reset schedules you declare; rethread never scrapes vendor dashboards.
Development
git clone https://github.com/farhanmansurii/rethread.git
cd rethread
npm testNode.js 20 or newer. Zero runtime dependencies.
If rethread saves you a context rebuild, starring the repository helps other capped-plan users find it. Issues and small adapters are welcome.
License
MIT
