Session handoff

From romiluz13/auto-pi · View interactive version

Session handoff is an AI agent skill from the GitHub repository romiluz13/auto-pi. Hand off work to another Pi session — write a handoff doc, save key decisions to memory, and notify the target session via intercom. Use when a session is getting long, when you need to continue work in a fresh context, or when transferring work between projects/sessions. Composes handoff.ts (doc wr

How to use this skill

Skill file

Session Handoff

Transfer work from one Pi session to another without losing context. This is the cross-session version of compact-safe — instead of compressing the current session, you're moving the work to a new session.

When to use

Procedure

  1. Write the handoff doc. The handoff extension (extensions/handoff.ts) writes a deterministic HANDOFF.md from recent turns + the last compaction summary. No LLM call — it's a snapshot. If the extension is available, it fires automatically. If not, write a markdown file to docs/handoff/<YYYY-MM-DD>-session-handoff.md with:
  1. Save key decisions to memory. Use the memory tool to save:

Capture memory payload BEFORE validation — compaction can fire between return and parse. If memory is full, save to the handoff doc instead.

  1. Discover the target session. Run intercom({ action: "list" }) to see active sessions. Filter by:
  1. Notify the target session. Run intercom({ action: "send", to: "<session-id-or-name>", message: "..." }) with:
  1. Confirm to the user. Tell them:

Rules

Discovery without manual IDs

intercom({ action: "list" }) returns all active sessions with their IDs, names, cwd, and status. You don't need to know the session ID in advance — list first, then send. The session-status.ts extension also writes ~/.pi/agent/session-status.jsonl which any session can read for a quick overview.

Convention: when starting a new session in a project, run intercom list to discover other sessions in the same project. If any exist, send them your session ID + role so they know you're there.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.