Skip to content
mentoor

Topic 4 of 4 · 5 min read

Resuming agent work across days

Goal: Leave a progress file and commit trail that let a new session resume a multi-day task without redoing work.

For work that lasts more than one session, keep the state in the repository, not in anyone's memory: a short progress file, a task list with clear done criteria, and small commits with readable messages. Then any new session, or a teammate, can resume by reading files.

Check yourself · 1 of 3

Why does a multi-day agent task need a progress file in the repository?

Choose one answer

Why it matters

An agent starts each session with an empty context. Anthropic's write-up on long-running agents describes this directly: work spans many context windows, and each new one begins with no memory of the last. Their remedy was a progress file plus a git history that the next session reads first, with the agent making incremental progress and leaving a clean state at the end. They also saw a later session look around, see that features existed and declare the job done too early. A written list of what remains prevents that.

How to do it

  1. Write the task list at the start. Break the goal into items small enough to finish and check in one sitting. Give each a done criterion you can run, such as a named test or command. Keep it in docs/tasks.md or similar.
  2. Keep one progress file. At the end of each session, record what is done, what is half done, what you tried that failed, the next step and how to start the app and tests. Keep it short enough to read in a minute.
  3. Commit often, in small steps. Each commit leaves the code working and has a message that says what and why. The history is then a log a new session can read with git log --oneline and git show.
  4. End each session cleanly. No half-edited files, tests run, progress file updated. If you must stop mid-change, commit it on a branch with "WIP" and say so in the progress file.
  5. Open each session with the same routine. Tell the agent to read the progress file, the task list and recent commits, run the tests, then pick one unfinished item. Do not let it declare done until every task's check passes.

Before and after

Weak: on day two you type "keep going with the billing work". The agent re-explores, redoes a half-built module and misses a decision made on day one.

Better, the progress file the agent reads first:

# Progress: invoice export
Last updated: 2026-12-02
Done: T-1 CSV writer (tests/csv.test.ts), T-2 route /invoices/export
Half done: T-3 PDF export; template renders, fonts missing in CI
Next: fix fonts, then T-4 email delivery
Decisions: use streaming, never load all invoices in memory
Run: npm run dev; npm test -- export

What goes wrong

  • Progress only in chat. When the session ends, the knowledge is gone.
  • Huge commits. A single commit named "wip stuff" gives the next session nothing to read.
  • A stale progress file. If it is not updated, the next session trusts wrong information. Update it as part of finishing.
  • No done criteria. Without a check per task, the agent decides for itself that the work is finished.

Examples

A resume prompt for day two

Read docs/progress.md, docs/tasks.md and the last 10 commits.
Run the test suite and report failures. Then pick the first unfinished
task, tell me your plan in 3 lines, and wait for my go-ahead.
Do not mark a task done until its check command passes.

The agent rebuilds context from files and shows its plan before changing code.

A task entry with a done check

T-3 PDF export of an invoice
Done when: npm test -- pdf passes and a 3-page sample opens
with the company font in a viewer.
Status: half done, fonts missing in CI (see progress.md).

The check is something the agent can run, so "done" is not an opinion.

Key points

  • Each new session starts with an empty context, so multi-day state must live in files and git history.
  • A task list with a runnable done check per item stops a session from declaring the job finished too early.
  • A short progress file records done, half done, failed attempts, next step and how to run the project.
  • Small commits with clear messages make git log a readable record for the next session.
  • Open every session by reading the progress file, task list and recent commits, then running the tests.

Common mistakes

  • Keeping the plan and decisions only in the chat, so the next session has to rediscover them.
  • Making a few giant commits or vague messages, which leaves no usable history to read.
  • Letting the progress file go stale, so a new session acts on information that is no longer true.
  • Writing tasks without a runnable check, which lets the agent declare the job finished on its own judgement.

Check yourself · 2 of 3

Which task entry best helps a new session know when it is really done?

Choose one answer

Check yourself · 3 of 3

You must stop in the middle of a change and the tests fail. What is the best way to end the session?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic