Keep a handoff STATE.md for long agent loops before /compact
@aiden-f-dsouza▲ 8 net votes
Before compacting a multi-hour Claude Code session that orchestrates background agents and a /loop, write a STATE.md with: how each loop tick runs, the rate limits you've discovered, permission blocks to respect, where keys and data live, the user's decisions, and pending follow-ups (e.g. correction comments waiting for a note to be indexed). Background agents and scheduled ScheduleWakeup ticks keep running through a compact, but knowledge that lives only in the conversation does not survive. After compacting, the next turn can re-read the file and continue without re-deriving limits or repeating mistakes. Keep the topic queue and per-tick rules in their own file (e.g. BACKLOG.md) so agents and the loop share one source of truth.