▶ YouTube Summaries

← All summaries

Handoff skill - passing context between agent sessions

2026-05-21 Thu ⏱ 12 min mattpocockuk

Matt Pocock explains his /handoff skill (in his skills repo under productivity). It compresses the current session into a disposable markdown file in the OS temp directory so a fresh agent session, possibly in a different tool, can continue a slice of the work. Unlike compact, which squeezes one session into itself, handoff splits work across independent sessions and keeps each context window small and sharp.

Smart zone, dumb zone and compact

Even with a 1M token window, the agent gets worse as context fills: more tokens mean more diffuse attention. Matt feels the dumb zone from around 120k tokens, so the useful budget is far smaller than advertised. Compact (or auto compact) summarizes a long session - referenced files, what was said, the tone - into the start of a new one, which is good for barrelling on at one problem such as debugging, but repeated compaction leaves layers of sediment and it is still only one session.

Why handoff differs from compact

When a side task appears mid-session (e.g. an out-of-scope refactor), extending the session dilutes its context and compacting clobbers progress. Handoff instead takes only the slice relevant to the side task, writes it to a markdown file, and lets two sessions run independently while the current one stays pure. Matt was doing this by hand ("write me a handoff.md") so often that it became a skill.

Handoff during grilling

In a grilling session (planning features for his Sandcastle software factory) he says a part is out of scope and asks to hand it off, stating the reason and what the document should contain. This sharpens the current grilling (a dependent question collapses) and produces a file with the focus, e.g. file a GitHub issue and design a separate API for iterations and the completion signal, which another agent then picks up.

Handoff to prototype and back

Grilling questions are either known unknowns the agent can ask, or things you need to see in code or UI. At question 13 of a grilling session he handed off the hard parts (window communication, tldraw SDK integration) to a prototype session. That session grew to 169k tokens, far more than would fit in the grilling. He then asked for a handoff back with non-obvious learnings not captured in the prototype, finished the grilling and wrote PRDs and issues with the prototype attached. This works like a DIY sub-agent: spend a context window on one task, compress the learnings, return them to the parent.

Cross-agent workflow

Because the handoff is a plain markdown file rather than a native agent feature, the first session can be Claude Code and the next Codex or Copilot CLI. This makes adversarial review or other cross-agent interaction easy.

Skill design decisions

  • Suggested skills section: lets the next session invoke the flavor-defining skills (grill with docs, diagnose, prototype) just by pasting the document.
  • Do not duplicate content already in other artifacts (markdown files, GitHub issues); use pointers, as handoffs otherwise bloat.
  • Save to the OS temp directory, not the workspace: handoffs are disposable and should not rot in repo docs.
  • Redact sensitive information such as API keys, passwords, PII.
  • Arguments describe what the next session will focus on; the doc is tailored to it. Matt always states the purpose, often by dictation, since a good handoff cannot be written without knowing it.

Wrap up

Handoff is now an essential tool in his kit, though it did not exist a few weeks earlier. He promotes his AI Coding For Real Engineers cohort (starting June 1st, about 2,500 people in the previous run) and floats a "what's on my bookshelf" video.