⚡ PromptLoot

Home › AI Agents

HANDOFF.md: Move Tasks Between Claude Code, Codex & Cursor

A HANDOFF.md prompt that makes your current coding agent write a short, exact handoff file so a fresh session or a different agent can pick up the task without re-reading everything.

Added · Updated

You are finishing a work session on a coding task. Another agent (or a fresh session of you) will continue it with no memory of this conversation. Write a HANDOFF.md at the repo root so it can pick up in one read.

## Rules
- 60 lines max. Facts only, no narration of how we got here.
- Exact paths, commands, branch names, and error messages, copied verbatim.
- Mark anything you are not sure of as UNVERIFIED.
- Do not paste secrets, tokens, or .env values. Say where they live instead.

## Write exactly these sections
# Goal
One or two sentences: what "done" means for this task, in testable terms.
# Status
Branch: [name] · Last commit: [hash + message] · Uncommitted changes: [yes/no, which files]
# Done so far
Bullets of what is finished AND verified (say how: test name, command, manual check).
# In progress
The exact step you stopped on, the file and function, and what is half-changed.
# Next steps
Numbered, smallest-first. Each one should be doable without asking me.
# How to verify
The commands to run (install, test, lint, build) and what passing looks like.
# Decisions and why
Choices already made that the next agent must not undo, each with a one-line reason.
# Dead ends
Approaches tried that failed, and why, so nobody repeats them.
# Open questions for the human
Only things that truly need me. If none, say "None".
# Do not touch
Files, folders, or systems out of scope for this task.

After writing it, read it back once as if you were the next agent, and fix anything that would make you ask a question.

How to use it

  1. Click Copy template.
  2. Paste into ChatGPT, Claude, Grok, Cursor, or your agent framework.
  3. Replace the [BRACKETED] parts with your details.

Pairs well with: One Rules File for Claude Code, Codex, Cursor & Gemini

Sponsor this page · Reach builders who use AI daily. Get details

FAQ

What is a HANDOFF.md file?

A short file at the repo root that tells the next AI agent session what the task is, what's done, what's half-done, how to verify it, and what not to touch. It lets you switch between Claude Code, Codex, Cursor, or a fresh context without losing work.

How is HANDOFF.md different from AGENTS.md or CLAUDE.md?

AGENTS.md and CLAUDE.md hold standing project rules that apply to every task. HANDOFF.md is temporary and about one task in progress. Delete or archive it when the task is done.

How long should a handoff file be?

Short enough to read in one pass, roughly 60 lines. If it's longer, the next agent spends its context re-reading history instead of working. Put long logs in a separate file and link it.

Can parallel agents share one HANDOFF.md?

Give each parallel agent its own handoff file and its own branch or worktree, with one writer per file. Shared handoff files get overwritten.

Get 3 new templates every week

Free. Unsubscribe anytime.

Related templates

Multi-Agent Crew Setup (Planner/Worker/Critic)

A three-role agent pattern that produces better results than one agent.

AI Agent Run Postmortem Prompt (Find the Real Fix)

When an AI agent does something wrong, reconstruct what happened from logs and decide the right fix: a prompt edit, a rules-file change, a test, or a hard permission limit.

End-of-Session Review: Decision Log & Rules File Updates

Run before /clear or closing a session: the agent logs decisions to docs/decisions.md, notes where it stalled, and proposes small rules-file fixes so the next session doesn't repeat mistakes.

Browse all AI Agents templates

New on PromptLoot

Check Current Docs First: Stop Agents Using Outdated APIs

Rules that make Claude Code, Cursor, and Codex check your installed versions and current docs before calling any API, cite the version, and flag deprecations.

Minimal Diff Rules: Stop AI Agents Rewriting Unrelated Code

Rules for Claude Code, Cursor, and Codex: change only what you asked, no drive-by renames, refactors, or reformatting, and list every changed file.
PromptLoot Pro Pack · 200+ advanced templates, agent workflows, and Cursor rules bundles. Coming soon