Checkpoint-clear-resume: managing 4 long-lived Claude Code agent seats without compaction

Motiv31 · reddit · 2026-10-12

The author open-sources aigent-OS (MIT), an alternative to context compaction on Claude Code: at a context threshold, the agent writes and confirms a checkpoint, then exactly one /clear is issued, a fresh session is verified via a SessionStart hook, and one resume prompt is sent. Key lessons: one ack authorizes one clear (halt on ambiguity rather than retry — a double clear is unrecoverable), identity comes from the live hook not disk files, the runner owns the PTY with queued keystrokes, and all loaded memory text is tagged with source/hash/time and no authority. Running four daily seats powering a 9k-subscriber newsletter, the reference seat achieved 11/11 clean cycles with zero duplicate clears; a sped-up test failed (the model wrote multiple "done" lines in one session), so the claim stays at 11. Known issues include stalls at the clear step. Code and write-up on GitHub; he's soliciting pushback on halting vs bounded retry for unattended agents.

Original post →

More from coding & agent

coding & agent channel →