mcpField
S
session-handoff

session-handoff

github.com/oimiragieoAgent workflows4568 installsUpdated 19w ago
Repository

About session-handoff

A skill for carrying session context across processes when work is ending or context is near capacity. It runs a script that writes a handoff log, checks active tasks, and opens a detached terminal window.

Key features

  1. 01Writes handoff logs with atomic locks
  2. 02Checks active tasks before handoff
  3. 03Uses a cross-platform OS decision matrix
  4. 04Synthesizes context from the memory file

Use cases

  1. 01Preparing continuation before ending a long session
  2. 02Handing off when context nears its limit
  3. 03Restarting or changing shifts at a user's request

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/oimiragieo/agent-studio --skill session-handoff

After installing, type/session-handoffin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

session-handoff.cjs
commands/
session-handoff.md
hooks/
post-execute.cjs
pre-execute.cjs
references/
research-requirements.md
rules/
session-handoff.md
schemas/
input.schema.json
output.schema.json
scripts/
main.cjs
templates/
implementation-template.md

Details

From the project README
Session Handoff Specialist - Executes the Phase 7 context handoff loop, transferring session continuity natively across processes. - Writing the session handoff log securely directly to disk via atomic locks. - Checking the Active Task database to prevent corruption and cross-session overlap (Drain Gate). - Spawning a detached cross-platform GUI terminal window using the verified OS decision matrix.

When to Use

Invoke this skill:

  • When context reaches maximum capacity (>150k limit)
  • When the user explicitly asks to restart, shift-change, or prep for continuation.
  • Before ending a long work session

How to Execute (MANDATORY)

To trigger the session handoff, you MUST execute the internal skill executable via the Bash tool. You shouldn't generate the log yourself—the executable handles all schema management and polling.

node .claude/skills/session-handoff/session-handoff.cjs
Drain-Complete Gate

If the executable fails and prints [session-handoff] ABORT: Cannot handoff session while tasks are active., you did not follow the drain rule! You must explicitly use TaskUpdate to either mark all active tasks as completed OR suspended before re-running the skill.

Required Setup (Context Preservation)

Before running the skill, ensure that .claude/context/memory/active_context.md is updated with necessary context you want the next agent to know, as the script will synthesize it into the handoff payload.

Comments

Markdown supported