Coding prompts · How to use a skill

write-session-handoff-prompt

A prompt that compacts a long AI coding session into a short handoff document a fresh agent can pick up from, with links instead of copies and secrets redacted. Use when the chat is getting too long, context is running out, you are switching agents or tools, or you want to pick the work up later in a new session.

Version 1.0 · Updated 2026-10-31

View raw SKILL.md

Install in Claude Code, Cursor or Codex (optional)

Only for AI coding tools that read skill folders. Run one line in a terminal, in your project folder. It downloads this skill's text files from TheSkillVault and nothing else; you can read them first with “View raw SKILL.md”.

Claude Code (all your projects)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/write-session-handoff-prompt/raw' -o ~/'.claude/skills/write-session-handoff-prompt/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/write-session-handoff-prompt/files/LICENSE.txt' -o ~/'.claude/skills/write-session-handoff-prompt/LICENSE.txt'

Cursor (this project)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/write-session-handoff-prompt/raw' -o '.cursor/skills/write-session-handoff-prompt/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/write-session-handoff-prompt/files/LICENSE.txt' -o '.cursor/skills/write-session-handoff-prompt/LICENSE.txt'

Codex and other Agent Skills tools (this project)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/write-session-handoff-prompt/raw' -o '.agents/skills/write-session-handoff-prompt/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/write-session-handoff-prompt/files/LICENSE.txt' -o '.agents/skills/write-session-handoff-prompt/LICENSE.txt'

Or connect the whole library over MCP

Add TheSkillVault to Cursor or add this to your app's MCP settings (read-only; help):

{
  "mcpServers": {
    "theskillvault": {
      "url": "https://theskillvault.ai/mcp"
    }
  }
}

Write a session handoff (prompt)

Long AI sessions get slow and forgetful. This prompt makes the AI write a short handoff note. You start a fresh session, give it the note, and carry on where you left off.

When to use

  • The conversation is long and the AI starts forgetting earlier decisions.
  • You are moving the work to another agent, tool or teammate.
  • You are stopping for the day and want a clean restart next time.

Steps

  1. Paste the prompt below at the end of your current session. Fill in what the next session is for.
  2. Check the note it writes. Make sure nothing private slipped in.
  3. Start a new session and say: "Read the handoff at <path> and continue."

Prompt

Write a handoff document so a fresh agent with no memory of this chat can continue the work.

- Save it in my OS temp folder ($TMPDIR, else /tmp; %TEMP% on Windows), not in the project.
  Tell me the full path.
- Next session focus: {{WHAT THE NEXT SESSION IS FOR, or "continue where we left off"}}.
  Tailor the document to that focus.
- Use this outline:
  1. Goal: what we are trying to achieve, in two or three sentences.
  2. Current state: what is done, what works, what is broken right now.
  3. Decisions made, and why (one line each).
  4. Next steps, in order.
  5. Open questions and risks.
  6. Where things are: links or paths to specs, plans, ADRs, issues, branches, commits.
  7. Suggested skills: which skills or prompts the next agent should load.
- Do not copy content that already lives in specs, plans, issues, commits or diffs.
  Point to it by path or URL instead.
- Redact anything sensitive: API keys, passwords, tokens, personal data. Write "[redacted]".
- Keep it short enough to read in two minutes.

How to adapt

  • Handing off to a teammate? Add "Write it for a human who knows the codebase but not this chat."
  • Want it in the repo? Ask for docs/handoff.md instead, but never commit secrets.
  • Works with any AI coding tool, including Claude Code, Cursor, Codex or a plain chat.

Gotchas

  • The AI may summarise what it wished happened. Check "Current state" against the actual tests and git status.
  • A handoff that copies whole files wastes the next session's context. Links are better.
  • Do not paste the note into public places. It can still describe private systems.

Done when

  • The handoff file exists in the temp folder and you know its path.
  • A fresh session can state the goal and the next step after reading only that file.

Example prompt

"This chat is getting long. Write a handoff so a new session can finish the login feature."

---

Adapted from "handoff" in mattpocock/skills by Matt Pocock (MIT). See LICENSE.txt.

Adapted from Matt Pocock (mattpocock/skills, 'handoff') (Copyright (c) 2026 Matt Pocock), MIT License. Adapted by TheSkillVault: paste-in prompt with a fixed outline for the document, a focus placeholder instead of command arguments, plain-language steps, how-to-adapt and done-when sections.

Licence: MIT License. Attribution when you reuse it: Based on work by Matt Pocock (mattpocock/skills, 'handoff') (Copyright (c) 2026 Matt Pocock, MIT License), https://github.com/mattpocock/skills/blob/a496f5513d4a4cf889bc48e189e579f4b0bdf6aa/skills/productivity/handoff/SKILL.md; adapted by TheSkillVault, https://theskillvault.ai