# AI Memory Handoff

> Use this skill for any request whose goal is session continuity across agents or time: finding a pending handoff, resuming previous work, saving next-session context, wrapping up, or discarding a mistaken handoff. Trigger by semantic intent rather than exact wording.

- Skill: `akitaonrails/ai-memory-handoff` (Agent Skill)
- Install (CLI): `npx skillmds@latest add akitaonrails/ai-memory-handoff`
- Raw SKILL.md: https://api.skillmd.com/api/skills/akitaonrails/ai-memory-handoff/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: akitaonrails (https://skillmd.com/u/akitaonrails)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/akitaonrails/ai-memory-handoff

---

<!-- ai-memory-managed: routing-skill -->

# ai-memory handoff

Use this skill for single-use cross-session handoffs. Handoffs are for the next agent, not durable project documentation.

## Tools in this cluster

- `memory_handoff_list` is the read-only inspect path: it returns open handoffs without claiming or expiring them. Use it when no SessionStart handoff block is in context (Grok, Zero, and other no-stdout / MCP-only clients), when the user asks what is pending, or when you need an exact id.
- `memory_handoff_accept` consumes one open handoff. Prefer listing first when no prepended block is visible, then pass the listed `handoff_id` to claim that exact row. Omitting `handoff_id` claims the latest eligible open handoff. Use this when the user asks where we left off and no already-fetched handoff block is visible.
- `memory_handoff_begin` creates a terse next-session handoff only when the user is wrapping up, ending the session, or explicitly asks to save context for the next session.
- `memory_handoff_cancel` expires a mistaken pending handoff by exact handoff id from begin or list.

## Single-use handoff behavior

The SessionStart hook usually fetches and consumes any pending handoff before the agent sees its first prompt. If the current context already contains a pending handoff block, answer from that block directly. Do not call the accept tool again to find it in another project, because handoffs are single-use and the tool will normally return null after SessionStart consumed it.

If no pending handoff block is visible, inspect with `memory_handoff_list` first. Listing does not claim or expire anything. When the user asks where we left off, claim one listed row with `memory_handoff_accept` and that `handoff_id`, using the client-aware project scope below. Do not treat list as a second accept path.

## Creating a handoff

Create a handoff only at session end or when the user explicitly asks to save context for the next session. Do not use handoffs for status checks, briefings, project notes, or permanent memory. Keep the summary to two or three concise sentences, and put details in open questions and next steps bullets.

Lifecycle hooks already capture routine prompts and tool calls, so do not manually write a handoff just to record normal progress.

On a shared server, a handoff belongs to the operator who created it. Set `shared: true` only when the user explicitly wants any operator in the project to receive the baton; do not infer sharing from ordinary collaboration prose.

## Canceling a handoff

Cancel only when the user asks to discard a handoff or you created one by mistake. Use the exact handoff id returned by the begin or list tool. Cancellation is idempotent from the user's point of view, but it should still target only the known handoff.

Accept and cancel normally act only on the caller's own plus shared handoffs. `any_owner: true` is a root-only recovery action over another operator's context; use it only on an explicit user request.

## Project scope

Choose scope from the MCP client's identity support:

- **Session-aware MCP clients** that forward the real lifecycle-hook session id on every request should use automatic current-project routing. Omit `workspace`, `project`, and `cwd` for the current repository; pass explicit scope only when the user names a different project.
- **Static MCP clients** (including clients with lifecycle hooks but no bridge connecting that hook session id to MCP requests) must pass `workspace` and `project` together on every project-scoped call, including requests about this project, here, or our work. Read the exact names from the nearest `.ai-memory.toml` when it declares both. If it does not, obtain the names from the operator or server configuration; never guess them from a directory name and never rely on the server's last active project.

This rule applies only to project-scoped calls. For cross-project retrieval, `global=true` must omit `workspace`, `project`, and `scopes`. For a standing preference written with `scope: "global"`, omit `workspace` and `project`.

