Skip to main content
Glama

handoff

Package the current session's state into a compact continuation document so a fresh session can resume without losing decisions or context.

Instructions

Package the current (or a given) session's state into a compact continuation document for starting a fresh session, without losing decisions/context already established.

Use when the current session has grown long (many turns, large context) and continuing it is getting expensive, or when the user explicitly asks to "hand off", "continue this in a new session", or "start fresh but keep context" — and no different AI coding tool is named. If the user names a specific other tool ("move this to Cursor", "open in Codex"), use transfer_session instead — it preserves full captured history losslessly, where this tool summarizes. If session_id is omitted, resolves the current session from the CLAUDE_SESSION_ID environment variable; if that isn't set, pass session_id explicitly. Returns a markdown document to paste as the first message of a new session — this does not end the current session for you.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "handoff"
  }
}

Input Schema

NameRequiredDescriptionDefault
session_idNo
include_diffsNo
max_diff_linesNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden and mostly succeeds: it discloses that output is a lossy summary (vs transfer_session's lossless capture), that it returns a markdown document, and that it does not end the current session. It omits any note on cost/latency or how include_diffs affects output size, which keeps it from a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core action is front-loaded before the routing guidance, and every sentence carries information. It is somewhat dense with em-dash clauses and could tighten the user-phrase examples, but nothing is clearly wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so the return value need not be explained further, and the description still characterizes it as a pasteable markdown document. The main gap is that the two diff-related parameters are unaddressed, which matters for a tool whose output size they control.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It explains session_id resolution (env var CLAUDE_SESSION_ID, else pass explicitly) but says nothing about include_diffs or max_diff_lines, leaving two of three parameters to be inferred from their names and defaults.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: packaging session state into a compact continuation document. It explicitly distinguishes itself from transfer_session ('it preserves full captured history losslessly, where this tool summarizes'), so an agent can pick between the two without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete when-to-use triggers (long session, expensive context, explicit user phrasing like 'hand off' or 'start fresh but keep context') and an explicit when-not with the named alternative (transfer_session for a specific other tool). The env-var fallback for session_id resolution is also spelled out.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.