handoff

handoff is a command for coding agents from lugassawan/swe-workbench. It costs 29 tokens per session (1,664 once invoked), scanned A, original, MIT.

A checkpoint system for handing work between Claude Code and Pi, two coding-agent tools, in the same Git worktree. It can create, resume, recover, inspect, and close handoffs.

In plain words
What is it for?
Use it to transfer an unfinished coding task, continue from a checkpoint, recover deterministic changes after a failure, or close completed work.
Why use it?
It preserves a clear next action and workspace state when switching agents or recovering after one stops unexpectedly.

Command

Part of the swe-workbench plugin — 1 skill, 24 commands, 32 agents, 4 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/lugassawan/swe-workbench/handoff
Clone the repo
git clone --depth 1 https://github.com/lugassawan/swe-workbench

Or install swe-workbench, the plugin that ships this one along with the rest of its 1 skill, 24 commands, 32 agents, 4 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for handoff

README.md
[![agentmods](https://agentmods.dev/badge/commands/lugassawan/swe-workbench/handoff.svg)](https://agentmods.dev/commands/lugassawan/swe-workbench/handoff)
Your own site
<a href="https://agentmods.dev/commands/lugassawan/swe-workbench/handoff"><img src="https://agentmods.dev/badge/commands/lugassawan/swe-workbench/handoff.svg" alt="Measured on agentmods" height="20"></a>
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,664 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00029 $0.01664
Opus 5 $0.00015 $0.00832
Sonnet 5 $0.00006 $0.00333
Haiku 4.5 $0.00003 $0.00166

Measured 3d ago against content hash 198fc3bd5754, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

handoff scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/handoff.md · 128 lines

How it starts

The opening of the file, as written. The whole thing — 128 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Manage a Claude Code ↔ Pi handoff in the current git worktree. Parse $ARGUMENTS as exactly one of:

  • pi [--next "<exact next action>"] or claude [--next "<exact next action>"] — create a planned handoff to that harness.
  • resume <checkpoint-id> [--acknowledge-degraded] — acquire and continue a checkpoint in the current harness.
  • recover --from <claude|pi> --source-stopped — salvage deterministic workspace state after the source harness has stopped unexpectedly.
  • close <checkpoint-id> — end the lease and retain the closed checkpoint for normal cleanup.

Reject any other arguments with a short usage message.

Preflight

Run once before planned checkpoint creation. Resume, recovery, and close use the exact single-pipeline forms below because the ownership hook permits only those lifecycle commands through an active or released lease:

command -v swe-workbench-handoff >/dev/null 2>&1 || {
  echo "swe-workbench handoff runtime is not on PATH — reinstall or update the plugin." >&2
  exit 1
}
command -v swe-workbench-result-check >/dev/null 2>&1 || {
  echo "swe-workbench result checker is not on PATH — reinstall or update the plugin." >&2
  exit 1
}

Never export, copy, summarize from, or persist a native Claude/Pi transcript. Never include environment values, credentials, arbitrary messages, raw tool output, patches, or file bodies in handoff state.

Planned handoff: pi or claude

  1. Build one JSON object with this exact top-level shape:

    {
      "operation_id": "new UUID",
      "source_harness": "claude or pi",
      "target_harness": "pi or claude",
      "source_session_ref": "current session reference when known",
      "semantic": {
        "goal": "bounded summary",
        "constraints": ["bounded strings"],
        "decisions": ["bounded strings"],
        "progress": {"done": ["bounded strings"], "in_progress": ["bounded strings"]},
        "changed_path_intents": {"relative/path": "intent only, never content"},
        "verification": [{"command": "bounded command", "label": "bounded label", "exit_status": 0, "timestamp": "ISO-8601 timestamp", "result": "bounded status"}],
        "blockers": ["bounded strings"],
        "risks": ["bounded strings"],
        "exact_next_action": "one executable next action"
      }
    }
    

Read the full file on GitHub · 128 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 128 lines · 29 tokens per session scan A 198fc3bd5754

Subscribe to this mod's changes

handoff is a command published in the GitHub repository lugassawan/swe-workbench (2 stars, last pushed yesterday), licensed MIT. It adds 29 tokens to every session and 1,664 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.