What happened
Restarting cldctrl relaunched an in-flight Claude Code session. The agent was resumed with a bare "Continue from where you left off." and a context that reflected a point ~4 commits behind actual HEAD.
The agent believed it was still mid-task on a feature it had in fact already finished, committed, and built three further slices on top of. Concretely, it thought it was still wiring a detector, when 4e0926b, e7f208f, 4365241, ae94ae1 had all landed and a PR was open.
Consequences
The agent resumed and redid completed work:
- restarted dev servers that didn't need restarting
- re-ran verification of already-verified, already-committed code
- overwrote a memory file with a less-complete version (used
Write, clobbering richer content written later in the same session)
- re-derived, from scratch, a
uvicorn --reload gotcha that its own memory file had already recorded — costing real time
It only self-corrected because a memory file happened to describe work beyond its context, prompting a git log check.
This run was benign only by luck: the working tree was clean and the re-derived edits happened to match what was already committed. With a dirty tree or a differing plan, the same flow could duplicate commits, re-open PRs, re-run migrations/releases, or clobber newer work. An agent told "continue" while holding stale state is being invited to repeat side effects.
Suggested fixes (roughly in order of value)
- Don't resume with a bare "continue" prompt. If a continuation prompt is injected on restart, prepend a state header the agent can trust: current branch, HEAD sha,
git status, last N commits, open PRs.
- Tell the agent its context may be truncated and that it must re-orient (check
git log/memory) before mutating anything. A one-line instruction would have prevented all of the above.
- Distinguish "resume a live session" from "relaunch after restart." The latter should reconcile state, not simply replay a continuation.
- Consider not auto-resuming mid-task sessions on cldctrl restart, or marking them "needs re-orientation" so the user opts in.
Notes / uncertainty
I could not find the literal string "Continue from where you left off" in this repo — resume goes through claude --resume <id> / claude --continue (cldctrl.ps1:3040, :3028). So the prompt may come from the harness, or from the dashboard/cockpit path (packages/cli/src/web/cockpit.ts has t.prompt → &prompt= on tile URLs, and 'resume:' PTY respawn). Worth confirming where the continuation text originates before fixing.
Reported from a PhysioMetrics session; filed at the operator's request.
What happened
Restarting cldctrl relaunched an in-flight Claude Code session. The agent was resumed with a bare "Continue from where you left off." and a context that reflected a point ~4 commits behind actual HEAD.
The agent believed it was still mid-task on a feature it had in fact already finished, committed, and built three further slices on top of. Concretely, it thought it was still wiring a detector, when
4e0926b,e7f208f,4365241,ae94ae1had all landed and a PR was open.Consequences
The agent resumed and redid completed work:
Write, clobbering richer content written later in the same session)uvicorn --reloadgotcha that its own memory file had already recorded — costing real timeIt only self-corrected because a memory file happened to describe work beyond its context, prompting a
git logcheck.This run was benign only by luck: the working tree was clean and the re-derived edits happened to match what was already committed. With a dirty tree or a differing plan, the same flow could duplicate commits, re-open PRs, re-run migrations/releases, or clobber newer work. An agent told "continue" while holding stale state is being invited to repeat side effects.
Suggested fixes (roughly in order of value)
git status, last N commits, open PRs.git log/memory) before mutating anything. A one-line instruction would have prevented all of the above.Notes / uncertainty
I could not find the literal string "Continue from where you left off" in this repo — resume goes through
claude --resume <id>/claude --continue(cldctrl.ps1:3040,:3028). So the prompt may come from the harness, or from the dashboard/cockpit path (packages/cli/src/web/cockpit.tshast.prompt→&prompt=on tile URLs, and 'resume:' PTY respawn). Worth confirming where the continuation text originates before fixing.Reported from a PhysioMetrics session; filed at the operator's request.