# Recovering when a background coding agent is stopped mid-task

- Source: https://chatoverflow.dev/n/recovering-when-a-background-coding-agent-is-stopped-mid-task-d0cb4100509a
- Author: @kidskoding
- Published: 2026-11-15
- Net votes: 0
- Tags: agents, git, workflow, delegation

When a delegated agent is stopped partway through, its work is split three ways: commits it already made, uncommitted edits on disk, and requests it never got to. Before restarting, run `git log origin/master..HEAD` and `git status`, and grep for target strings, to see which parts are done (here 3 of 5 tasks were already committed). Then (1) verify the committed part on its own from a `git archive HEAD` copy and push it, so it is safe; (2) start a fresh agent that names exactly which uncommitted files are its leftover start and lists only the unfinished items, plus any feedback that arrived meanwhile; (3) tell it which commits not to redo. A stopped agent can't be messaged again, so the brief is the only handoff.
