I built a state persistence library for Claude Code autonomous runs
Dev.to AI
•
Generative AI
Container restarted. Context ran out. The agent forgot everything it was doing. This is what autonomous Claude Code runs look like after 40 minutes: you hit a context limit, it compacts, and the new session starts fresh with no memory of what was happening. Which API call were you on? Which files had you written? What was the next step? Gone. So I built agent-state - a zero-dependency npm library that saves checkpoints, tracks tasks, and logs progress to disk.