Lesson 10.10 · Phase 10 · Coding & Computer-Use Agents

Long-horizon tasks

Some tasks don't fit in one context window, and some processes don't live long enough to finish them. Put the task's memory on disk instead: a todo list, progress notes and checkpoints. Start every session fresh from that state. Mark an item done only after a check passes. Force a handoff before the context fills. When a session dies mid-item, the next one re-checks that item before trusting it.

Learning objectives

  • Keep a long task's state on disk (todo list, notes, checkpoints) so any session, or any process, can continue it.
  • Bound context per session with a harness-enforced handoff, and compare against one unbounded session.
  • Make "done" mean "verified": mark items done only after a check passes since the last edit.
  • Recover from a crash mid-item by re-verifying inprogress items first, with atomic writes so the state file is never corrupt.

"Migrate all 200 modules from print to logging." An agent starts well. By module 40 its context is full of old diffs and test output; quality drops, it forgets the pattern it settled on, and it starts re-editing files it already did. At module 73 the laptop sleeps, the process dies, and when you restart there's no record of which modules are done, which are half-done, or why module 51 was skipped.

Loading the full lesson…