A three-day migration where no part is done twice
Long-running agentsDeveloper leaving Claude Code on a long migration over a weekend
We left an agent moving 220 test files from Jest to Vitest over a long weekend, with a small script that restarts claude -p 'continue the migration' whenever it exits. Its context filled and compacted, and the machine rebooted for an update on Saturday night. Each restart used to begin with ten minutes of 'let me look at the repo'.
How do I stop a long migration redoing finished parts after a restart?
Write the job into parts with ArcRoom's split_task and complete each part when its tests pass. After a restart or compaction, the agent reads the playbook first, sees which parts are done and starts the next one. The loop guard stops a third identical failing command in a row, and done-checks keep any session from stopping with red tests.
Also asked as: My Claude Code restart loop wastes ten minutes rereading the repo every time. How do I stop that? · How do I run a multi-day migration with claude -p without losing progress? · Can Claude Code remember which parts of a job are done after a reboot?
The first session uses split_task to write the migration into parts in the playbook, one folder each.
- Last-run note
- Claim
- Split into parts
- Loop guard
- Done-checks
Last session here (Claude Code, 6 min ago): stopped mid-way.
Step by step
- The first session uses split_task to write the migration into parts in the playbook, one folder each.
- Each part is claimed, then completed when its tests pass.
- Every restart gets the last-run note and recalls which parts are done.
- The loop guard stops a restart from running the same failing command a third time in a row.
- Done-checks keep any session from stopping with red tests.
What the agent sees
Last session here (Claude Code, 6 min ago): stopped mid-way.
Parts: 14 of 22 done · 1 claimed (packages/billing) · 7 left
Failed before: packages/legacy (jest.mock hoisting)Compared with today's tools
A PROGRESS.md the agent updates
The prompt tells the agent to keep a checklist file and read it on every restart.
- Setup
- 10 min
- Ongoing
- Fix the file when the agent forgets to update it, ~15 min a day
ArcRoom
Every agent reads the team playbook before it works and writes to it when it finishes. Nothing to update by hand.
- Setup
- 2 min (npx arcroom init)
- Ongoing
- None
A progress file is simple and readable; it doesn't block repeated commands, enforce done-checks, or record anything if the agent crashes before writing.
Where it stops
A restart knows which parts are done, not the exact step inside one.
Try it in your project
Works with the agents your team already uses, and any agent over MCP or the HTTP API.
More in long-running agents
- Bot-driven sessions that don't redo the last one's workDeveloper who runs claude -p from a chat bot on a home PC
- Three scheduled agents, nothing done twiceSolo founder scheduling headless agents on a home machine
- Coding agents in containers, one per issueTeam running Claude Code headless in containers on its own server