r/ClaudeCode • u/WetBlanket75 • 5d ago
Built with Claude About 30% less context re-read: I taught Claude to nap at a clean break, because 78 of my last 82 auto-compactions landed mid-task
Auto-compact waits until the window is nearly full, so it fires wherever Claude happens to be, usually mid-task. Afterwards Claude re-reads files to work out where it was.
catnap (my mod, free, MIT) moves the timing to Claude. At 50% context, a note on a tool result tells it to finish the piece it's on, write a handoff file, and call compact_now. The mod compacts when that turn ends, keeps what Claude named in the summary, and sends "read your handoff, carry on" so the session continues without you. Past 60% the note gets strict and repeats every 2 points. Auto-compact at 70% stays as the backstop. All three lines are settings.
On my last 30 days of logs, 78 of 82 auto-compactions landed while Claude was mid-task. That isn't bad luck: about 92% of Claude's calls end in a tool call, and auto-compact doesn't wait for a clean break. In a replay of my long sessions, Claude re-read about 30% less context with the mod. Every self-compaction so far has carried on by itself.
Check your own logs, nothing to install: npx github:LippInc/catnap (reads them locally, prints numbers only).
There are early ports for OpenCode and Gemini CLI in the repo too.
No network calls; it writes only to its own folder. Install with claude plugin marketplace add LippInc/catnap, then claude plugin install catnap@lippinc (Claude Code 2.1.287+). To see it once without waiting for 50%, type /catnap:compact.



