Skip to main content
Glama

Save an assignment or hand unfinished work to another session

brain_handoff

Saves session handoffs and delegated assignments as project brain cards, letting another agent read, claim, and continue the work without copying context.

Instructions

Save delegated work immediately with {action:"write", reason:"assignment", for:"Codex", instructions:"", title, task, next, files, verify}, even while continuing your own work. Use the actual recipient client or role. Verify the returned card id, then notify a known recipient with brain_message; saving does not wake or launch agents. When asked for an assigned task, brain_sync the same project, list/read the addressed card and take it; never ask the human to copy the prompt. Assignments preserve the sender's separate task and use their saved brief, not the entire sender conversation. The session handoff. On hosts without native transcript access, call {action:"capture", turns:[{id,role,at,text}]} as user requests and replies arrive, before writing a handoff. Capture only observed text with stable ids and known timestamps; never reconstruct missing history. Captured evidence is local and does not establish full conversation coverage. Call {action:"write"} when you are stopping before the work is done — the human asked for a handoff, your context or usage limit is near, the day ends, you are blocked or switching tool — with the task, what is done, what is NEXT in order, the files and how to verify: it becomes a 🤝 card in the project brain that the human can see and correct, and the next session on this project (any agent — Codex, Claude Code, Cursor) sees it at its first brain_sync / session start. Call {action:"take", id} (a card) or {action:"take", session} (unfinished work a session left without a card — KLYPIX records every session's last reply, files and commits automatically) before continuing it, so peers see it is taken; {action:"done"} when it is finished (the card is archived); {action:"list"} shows every open handoff and every unfinished session. Never ask the human to paste a summary into the next session — write a handoff. Machine-local for the automatic layer; the card travels with the brain.

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": "brain_handoff"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoread / take / done / review: the handoff card id from brain_sync or list.
forNowrite: recipient client or role, such as Codex, Claude Code or reviewer; required for assignment. Matching clients or roles see it first. list: filter to that recipient. A hint, not authorization, a reservation or an agent launcher.
areaNowrite: the brain area (titled box) the card goes into. Defaults to "Handoff".
doneNowrite: what is already finished (so it is not redone).
nextNowrite: the remaining steps IN ORDER, as the next session should do them. Required.
openNowrite: questions still open, or decisions the human has to make.
taskNowrite: one or two sentences — what the work is and why.
filesNowrite: project-relative files the work touches (recorded as evidence anchors).
titleNowrite: the work, in a few words ("Drive upload: the Place-it-now chooser").
turnsNocapture: observed turns only, stable ids for retries and original timestamps in milliseconds. Never invent missing history. Stored locally outside the brain; full coverage remains unknown.
actionNowrite: save an assignment or session handoff. read: retrieve its complete saved brief by id. take/done: claim or finish that card. For ordinary session handoffs, review checks the source conversation; explicit assignments use their saved instructions. list: open cards, optionally filtered by for. capture: preserve observed turns without claiming full history coverage.
canvasNoBrain canvas filename/path. Defaults to the project brain ("brain").
cursorNoreview: nextCursor from the preceding page; omit to start.
reasonNowrite: assignment delegates only the saved brief while the sender may continue other work; the other reasons hand off the session's unfinished work.
verifyNowrite: how to check the state — a command or a visible result.
projectNoAbsolute project root containing brain.klypix. Defaults to this connection's project.
sessionNotake / done / review: the session id (or a unique prefix of 8+ characters) from the unfinished-work list, when the work has no card. Review creates a reviewable draft if needed.
summaryNodone: what was finished. take: optional note. review acknowledgement: required account of completed and still-pending requests after reading all conversation pages.
revisionNoreview: exact transcript revision from the preceding page.
continuesNowrite: the id of an earlier handoff card this one continues — it is closed as "continued by" this one.
reviewTokenNoreview: acknowledge only AFTER reading every conversation page; supply the final token and a summary including outstanding requests. New source activity invalidates this token.
instructionsNowrite with reason assignment: the complete brief, including requirements, constraints, output paths and acceptance criteria. Required for assignments; preserves Unicode and newlines exactly. read/take returns it in full.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv1.111.0
    • changedInput schema / properties / action / description
      Previous value: -"capture: preserve observed user/assistant turns for this connected session on any MCP host; never marks full history covered. write: record a handoff. take: claim it and check conversation freshness. review: read source conversation pages, then acknowledge the final reviewToken with a summary of pending requests. done: mark finished. list: open handoffs and unfinished sessions."New value: +"write: save an assignment or session handoff. read: retrieve its complete saved brief by id. take/done: claim or finish that card. For ordinary session handoffs, review checks the source conversation; explicit assignments use their saved instructions. list: open cards, optionally filtered by for. capture: preserve observed turns without claiming full history coverage."
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "write",
      -  "take",
      -  "done",
      -  "list",
      -  "review",
      -  "capture"
      -]New value: +[
      +  "write",
      +  "read",
      +  "take",
      +  "done",
      +  "list",
      +  "review",
      +  "capture"
      +]
    • changedInput schema / properties / for / description
      Previous value: -"write: optional role this handoff is addressed to, such as \"reviewer\". A session that declares that role in brain_sync sees it first; every other session still sees it. A label only: it does not reserve the work."New value: +"write: recipient client or role, such as Codex, Claude Code or reviewer; required for assignment. Matching clients or roles see it first. list: filter to that recipient. A hint, not authorization, a reservation or an agent launcher."
    • changedInput schema / properties / id / description
      Previous value: -"take / done / review: the handoff card id (from brain_sync, the session-start brief, or list)."New value: +"read / take / done / review: the handoff card id from brain_sync or list."
    • addedInput schema / properties / instructions
      Added value: +{
      +  "description": "write with reason assignment: the complete brief, including requirements, constraints, output paths and acceptance criteria. Required for assignments; preserves Unicode and newlines exactly. read/take returns it in full.",
      +  "maxLength": 24000,
      +  "minLength": 1,
      +  "type": "string"
      +}
    • changedInput schema / properties / reason / description
      Previous value: -"write: why the work stops here."New value: +"write: assignment delegates only the saved brief while the sender may continue other work; the other reasons hand off the session's unfinished work."
    • changedInput schema / properties / reason / enum
      Previous value: -[
      -  "context_limit",
      -  "usage_limit",
      -  "end_of_session",
      -  "blocked",
      -  "switching_tool",
      -  "other"
      -]New value: +[
      +  "context_limit",
      +  "usage_limit",
      +  "end_of_session",
      +  "blocked",
      +  "switching_tool",
      +  "other",
      +  "assignment"
      +]
  2. Changed1 schema field changedv1.110.0
    • addedInput schema / properties / for
      Added value: +{
      +  "description": "write: optional role this handoff is addressed to, such as \"reviewer\". A session that declares that role in brain_sync sees it first; every other session still sees it. A label only: it does not reserve the work.",
      +  "maxLength": 40,
      +  "type": "string"
      +}
  3. Changed9 schema fields changedv1.108.1
    • changedInput schema / properties / action / description
      Previous value: -"write (default): record a handoff card. take: claim a handoff card (id) or unfinished work (session) before continuing it. done: mark it finished. list: every open handoff card and every unfinished session on this project."New value: +"capture: preserve observed user/assistant turns for this connected session on any MCP host; never marks full history covered. write: record a handoff. take: claim it and check conversation freshness. review: read source conversation pages, then acknowledge the final reviewToken with a summary of pending requests. done: mark finished. list: open handoffs and unfinished sessions."
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "write",
      -  "take",
      -  "done",
      -  "list"
      -]New value: +[
      +  "write",
      +  "take",
      +  "done",
      +  "list",
      +  "review",
      +  "capture"
      +]
    • addedInput schema / properties / cursor
      Added value: +{
      +  "description": "review: nextCursor from the preceding page; omit to start.",
      +  "maximum": 9007199254740991,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • changedInput schema / properties / id / description
      Previous value: -"take / done: the handoff card id (from brain_sync, the session-start brief, or list)."New value: +"take / done / review: the handoff card id (from brain_sync, the session-start brief, or list)."
    • addedInput schema / properties / reviewToken
      Added value: +{
      +  "description": "review: acknowledge only AFTER reading every conversation page; supply the final token and a summary including outstanding requests. New source activity invalidates this token.",
      +  "maxLength": 64,
      +  "type": "string"
      +}
    • addedInput schema / properties / revision
      Added value: +{
      +  "description": "review: exact transcript revision from the preceding page.",
      +  "maxLength": 64,
      +  "type": "string"
      +}
    • changedInput schema / properties / session / description
      Previous value: -"take / done: the session id (or a unique prefix of 8+ characters) from the unfinished-work list, when the work has no card."New value: +"take / done / review: the session id (or a unique prefix of 8+ characters) from the unfinished-work list, when the work has no card. Review creates a reviewable draft if needed."
    • changedInput schema / properties / summary / description
      Previous value: -"done: what was finished, in one or two sentences. take: an optional note."New value: +"done: what was finished. take: optional note. review acknowledgement: required account of completed and still-pending requests after reading all conversation pages."
    • addedInput schema / properties / turns
      Added value: +{
      +  "description": "capture: observed turns only, stable ids for retries and original timestamps in milliseconds. Never invent missing history. Stored locally outside the brain; full coverage remains unknown.",
      +  "items": {
      +    "properties": {
      +      "at": {
      +        "exclusiveMinimum": 0,
      +        "maximum": 8640000000000000,
      +        "type": "integer"
      +      },
      +      "id": {
      +        "maxLength": 160,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "role": {
      +        "enum": [
      +          "user",
      +          "assistant"
      +        ],
      +        "type": "string"
      +      },
      +      "text": {
      +        "maxLength": 24000,
      +        "minLength": 1,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "role",
      +      "at",
      +      "text"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 30,
      +  "minItems": 1,
      +  "type": "array"
      +}
  4. Addedv1.102.0

TDQS

A4.2/5.0
Behavior5/5

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

Beyond the annotations it discloses non-obvious behavior: writes are inert and do not wake or launch anyone, the 'for' field is only a hint and not authorization or a reservation, done archives the card, capture data stays local and never establishes full conversation coverage. It also states the persistence boundary ('machine-local for the automatic layer; the card travels with the brain') and warns that it will not reconstruct missing history. None of this is contradicted by the supplied hints.

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

Conciseness2/5

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

The text is a single dense block that mixes example payloads, sibling routing, per-action semantics, host limitations and behavioral caveats with no ordering or headings, so an agent must parse the whole thing to extract any one action. Several points repeat ('never ask the human to copy/paste a summary into the next session'), and an inline JSON snippet competes with the actual purpose statement in the lead position. It is informative but poorly front-loaded for a 22-parameter, seven-action tool.

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

Completeness5/5

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

For a multi-action tool with no output schema and 22 optional parameters, the description covers every action, the assignment-versus-session distinction, the capture fallback on hosts without transcript access, and the follow-up notification path. It states the verification step and the peer-visibility consequence of take. Nothing an agent needs in order to choose an action and call it correctly appears to be missing.

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 coverage is 100% and the enum values for action and reason are already documented field-by-field, so the schema does most of the work. The description adds some framing that the schema does not, notably preferring the actual recipient client or role in 'for', having the writing session verify the returned card id, and the distinction that assignments preserve the sender's own task. That is real added meaning but it is scattered rather than organized per parameter.

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

Purpose4/5

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

The opening states a specific verb and resource (saving delegated work as a handoff card) and the later sentences distinguish the tool from siblings by name (brain_message for notifying, brain_sync for consuming a card). It is clearly not interchangeable with brain_review or brain_note. The main deduction is that the purpose is delivered through an inline example payload rather than a plain statement of what the tool does, and the seven enumerated actions spread the core idea thin.

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?

It gives explicit triggers for the write action ('you are stopping before the work is done — the human asked for a handoff, your context or usage limit is near, the day ends, you are blocked or switching tool') and separate guidance for take, done, list, capture and review. It also names alternatives and hands off to them concretely: notify with brain_message, consume with brain_sync, never ask the human to copy the prompt. The when-not is equally explicit ('saving does not wake or launch agents').

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