Skip to main content
Glama

TaskHandoff

DeepSeek-friendly long-task project memory & cross-session handoff for coding agents.

长任务做到一半换会话 / 上下文被压掉 / 换模型 —— Agent 忘了目标、决策和下一步。
TaskHandoff 把状态写进仓库 .handoff/:任何能读项目文件的 Harness 都能恢复任务状态,并拿到结构化的下一步上下文。
「能恢复」有自动化测试证据;「LLM 一定把活干完」仍需 harness 级评测。

License: MIT Python 3.9+ CI GitHub

Repo

https://github.com/sutongwuyanzu/TaskHandoff

Skill name

task-handoff

CLI

handoffpip install -e . 后)

MCP

handoff-mcp(纯 stdlib,无额外依赖)见 references/mcp.md

Harness

Skill + CLI + MCP 同一 .handoff/ 契约;DSH 适配计划见 references/deepseek-notes.md

TaskHandoff terminal demo

initsave --autorecall --briefdoctor
怎么录 / 怎么重渲:examples/how-to-record-gif.md

Continuity evidence(跨会话可恢复)

命令 / 材料

角色

pytest tests/test_continuity.py -q

完整 CI 证据(hooks 闭环、save --auto、brief→完成 next#1 toy、强断言)

python scripts/continuity_proof.py

约 15 秒 smoke demo(显式 save → recall only;不覆盖 hooks/--auto/toy)

examples/dogfood-20260813.md

真人跨会话:Session A save --auto → 关聊天 → Session B 只 recall --brief

# Full evidence (what CI runs via pytest -q):
pytest tests/test_continuity.py -q

# Quick human-readable smoke (not a substitute for the suite):
python scripts/continuity_proof.py

The suite proves disk-level continuity across independent processes.
LLM execution quality still requires harness-level evaluation.
Details: examples/continuity-proof.md


30 秒心智模型

会话 A 干到一半  →  handoff save [--auto]  →  写入 .handoff/
新开会话 / 换模型 →  handoff recall --brief →  恢复 goal + next 1..3
                         (Agent 可据此继续;执行成败取决于模型/harness)

文件

作用

.handoff/MEMORY.md

长期记忆(偏好、架构、坑)

.handoff/handoffs/LATEST.md

上一会话状态 + 下一步 3 条

.handoff/todos.json / decisions.jsonl

结构化待办与决策日志


Related MCP server: Graph

安装(推荐最低完整版)

需要 Python 3.9+零第三方运行时依赖

git clone https://github.com/sutongwuyanzu/TaskHandoff.git
cd TaskHandoff
pip install -e .

# 验证
handoff --version
# 或
python -m taskhandoff --version

MCP(stdio,零额外依赖)

pip install -e .
handoff-mcp
# 或
python -m taskhandoff.mcp_server

把 stdio server 配进 Claude Desktop / Cursor 等(示例:examples/mcp-config.sample.json,说明:references/mcp.md)。

不装包也可以用 CLI:

python scripts/handoff_cli.py init --root /path/to/project

装成 Agent Skill

# 一键脚本(推荐)— 在仓库根目录执行
# Windows PowerShell:
powershell -ExecutionPolicy Bypass -File scripts/install-skill.ps1

# macOS / Linux:
bash scripts/install-skill.sh

# 或手动
cp -r TaskHandoff ~/.claude/skills/task-handoff

装好后对 Agent 说:交接 / 接着做 / handoff。
SKILL.md 是剧本;handoff CLI / MCP 是执行层。


快速演示:init → save → recall

在任意项目里:

cd /path/to/your-app

# 1) 初始化(每个仓库一次)
handoff init --root .

# 2) 会话结束前交接(推荐 --auto:自动带上 git 变更/最近 commit)
handoff save --root . --auto \
  --goal "Ship JWT auth" \
  --done "Middleware scaffolded" \
  --decision "Refresh token in httpOnly cookie" \
  --next "Finish refresh endpoint" \
  --next "Add 401/403 tests" \
  --next "Document env vars" \
  --memory-delta "Auth: access token memory-only; refresh httpOnly cookie"

# 3) 新会话只读 brief(短、稳、给 Agent 直接开干)
handoff recall --root . --brief

# 4) 需要全文时
handoff recall --root . --budget 2500

# 5) 健康检查(含密钥扫描)
handoff doctor --root .
handoff status --root .

自然语言(Agent 读 SKILL.md

你说

Agent 应做

交接 / handoff

handoff save(能加 --auto 就加)

接着做 / continue / resume

handoff recall --brief → 执行 Next #1

记住我们用 pnpm

handoff memory --append "..."

handoff 状态

handoff status / doctor

示例交接包

完整样例见 examples/filled-LATEST.md

recall --brief 输出形态:

# Resume brief (TaskHandoff)
- project: `your-app`
- goal: Ship JWT auth
- next:
  1. Finish refresh endpoint
  2. Add 401/403 tests
  3. Document env vars
- instruction: Execute next action #1 now. ...

安全

  • 默认拒绝把疑似密钥写进 handoff(GitHub PAT、JWT、私钥块、常见 api_key= 等)

  • 误报时才用:handoff save ... --allow-secrets(不推荐)

  • handoff doctor 会扫描已有 LATEST.md


目录结构

TaskHandoff/
  SKILL.md                 # Agent skill 剧本
  taskhandoff/             # 可安装 Python 包(CLI)
  scripts/handoff_cli.py   # 兼容入口
  templates/               # MEMORY / handoff 模板
  references/              # schema + DSH 接入说明
  examples/                # 示例流程、filled handoff、真人 dogfood
  docs/                    # 非产品文档(含 DSH 沟通笔记)
  tests/                   # pytest 契约测试
  pyproject.toml

项目内生成:

your-app/.handoff/
  config.json
  MEMORY.md
  todos.json
  decisions.jsonl
  handoffs/LATEST.md
  handoffs/LATEST.json

契约说明:references/schema.md


DeepSeek Harness (DSH)

  • 类型:Skill + CLI + MCP(同一 .handoff/ 契约)

  • 无私有二进制格式:纯 Markdown + JSON

  • Token 预算:recall --budget / --brief

  • 发布后接入计划:references/deepseek-notes.md(公开 API 落地后再接,不自称 DSH-ready)


更多示例

开发与测试

pip install -e ".[dev]"
pytest -q
handoff info --root .

CI:GitHub Actions 在 main 上跑 Python 3.9 / 3.12。


设计原则

  1. Portable — 状态在仓库里,不绑云

  2. Token-thrifty — 固定章节 + brief

  3. Harness-agnostic — Claude Code / Codex / 未来 DSH

  4. Safe by default — 密钥扫描

Roadmap

  • 可安装 CLI(handoff

  • save --auto(git + 上次 handoff)

  • recall --brief 固定复述

  • 密钥拒绝写入 + doctor

  • pytest 契约测试

  • 纯 stdlib MCP server(同一 .handoff/ 契约)

  • GitHub Actions CI + skill 安装脚本 + 仓库 dogfood

  • 会话 hook 样例(Claude Code / generic / DSH 映射)

  • README 终端 GIF(assets/terminal-demo.gif + 可重渲脚本)

  • 真人跨会话 dogfood(2026-08-13:save → 关聊天 → recall --brief)

License

MIT

Available Tools

6 tools
handoff_doctorB

Health-check .handoff/ and scan LATEST.md for possible secrets.

ParametersJSON Schema
NameRequiredDescriptionDefault
rootNo.

TDQS

B3.4/5.0
Behavior2/5

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

With no annotations, the description must fully convey behavioral traits. It only states what it checks ('health-check', 'scan for secrets') but does not disclose whether it is read-only, whether it modifies files, what it returns, or any side effects. For a diagnostic tool, this is insufficient transparency.

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

Conciseness5/5

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

The description is a single, short sentence that effectively communicates the core function. It is front-loaded and contains no filler words; every word contributes to understanding.

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

Completeness3/5

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

The tool is simple (one optional param, no output schema), and the description covers the basic purpose. However, it lacks information about expected output/return value, side effects, or what a 'health-check' entails beyond secret scanning. For a low-complexity tool this is borderline adequate.

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

Parameters2/5

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

There is one parameter, 'root', with 0% schema description coverage. The description never mentions 'root', so the agent has no guidance on what to pass or what the default behavior is. The description should have explained that 'root' likely sets the base directory for the scan.

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?

The description clearly states the tool's function: health-check .handoff/ and scan LATEST.md for secrets. This is a specific verb-resource pair ('health-check' and 'scan') that distinguishes it from siblings like handoff_init or handoff_save, which have different purposes.

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

Usage Guidelines3/5

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

Usage is implied: one would run this to check health/secret leakage of handoff files. However, there is no explicit guidance on when to prefer this over other tools, and no mention of alternatives or exclusions. The sibling context shows different functions, but the description itself doesn't say 'use when...'.

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

handoff_initA

Initialize .handoff/ memory layout in a project (once per repo).

ParametersJSON Schema
NameRequiredDescriptionDefault
rootNoProject root path.
languageNozh-CN

TDQS

A3.6/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It does not disclose whether the tool overwrites existing files, requires permissions, or creates specific structures. 'Memory layout' is vague and lacks behavioral detail.

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

Conciseness5/5

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

The description is a single, front-loaded sentence with no wasted words. It communicates the core action immediately.

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

Completeness3/5

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

For a simple init tool with optional params and no output schema, the description is somewhat adequate but omits important details like idempotency, what files/directories are created, and potential side effects. It leaves room for ambiguity.

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

Parameters2/5

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

The description does not mention parameters. Schema covers root with a description and default, but language lacks any description. The description adds no value beyond the schema, and schema coverage is only 50%.

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?

The description clearly states 'Initialize .handoff/ memory layout' with a specific verb and resource, and 'once per repo' distinguishes it from sibling tools like handoff_save, handoff_recall, etc.

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

Usage Guidelines4/5

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

The phrase 'once per repo' provides clear setup-time context, implying this is for initial project setup rather than routine use. It does not explicitly name alternatives, but the usage context is clear.

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

handoff_memory_appendA

Append durable project memory, or show MEMORY.md if text is empty.

ParametersJSON Schema
NameRequiredDescriptionDefault
rootNo.
textNoMarkdown fragment to append

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations provided, the description carries the burden of behavioral disclosure. It reveals the durable append and the empty-text trigger to show MEMORY.md, but omits details like file creation, path resolution, or error handling. This is minimal but not absent.

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

Conciseness5/5

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

The description is a single sentence that front-loads the main action and includes the conditional empty-text behavior with no wasted words.

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?

For a simple append operation, the description covers the primary behavior and the important special case. However, with no annotations and no output schema, it omits any mention of the root parameter's role or what the tool returns, which could be ambiguous in a multi-tool handoff workflow. Still, it is reasonably complete for the core function.

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

Parameters2/5

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

The input schema describes 'text' as a 'Markdown fragment to append', but 'root' has no description. The tool description adds no parameter semantics, leaving 50% of parameters (root) under-specified. It does not explain how root relates to MEMORY.md or the append operation.

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?

The description clearly states a specific verb ('append') and a resource ('durable project memory'), and it adds a conditional behavior for empty text that differentiates it from sibling tools like handoff_save or handoff_recall.

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

Usage Guidelines4/5

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

The description implies when to use this tool: when you need to append to existing project memory, and if text is empty, it serves to display MEMORY.md. However, it does not explicitly contrast with alternatives like handoff_save or handoff_init, so it stops short of full guidance.

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

handoff_recallA

Load handoff context for a new session. Default brief=true returns a short resume brief (token-thrifty).

ParametersJSON Schema
NameRequiredDescriptionDefault
rootNo.
briefNo
budgetNo

TDQS

A3.7/5.0
Behavior3/5

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

No annotations are present, so the description carries the burden of behavioral disclosure. It reveals a key behavior: 'Default brief=true returns a short resume brief (token-thrifty),' which explains the default response style. However, it doesn't state whether the operation is read-only, has side effects, or requires certain prerequisites.

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

Conciseness5/5

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

The description is a single sentence that directly conveys purpose and key behavior without filler. It is concise and front-loaded.

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

Completeness2/5

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

With three parameters, no annotations, and no output schema, the description should explain return values and remaining parameters. It only mentions 'brief' and the general notion of a resume brief, not 'root' or 'budget', and does not describe the full output structure, leaving an incomplete picture.

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

Parameters2/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 the 'brief' parameter (default true, token-thrifty) but leaves 'root' and 'budget' unexplained. This partial compensation is insufficient for three parameters.

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?

The description clearly states the tool loads handoff context for a new session, using a specific verb and resource. It distinguishes itself from siblings like handoff_save or handoff_status by focusing on the loading operation at session start.

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

Usage Guidelines4/5

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

The description explicitly says 'for a new session,' providing a clear context for when to use the tool. However, it doesn't mention when not to use it or reference alternative sibling tools, so it lacks exclusions.

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

handoff_saveA

Save a long-task handoff pack into .handoff/. Prefer auto=true. Provide goal and up to 3 next_actions when possible. Never include API keys or tokens.

ParametersJSON Schema
NameRequiredDescriptionDefault
autoNo
bodyNo
doneNo
fileNo
goalNo
linkNo
rootNo.
doingNo
blockedNo
commandNo
summaryNo
decisionNo
questionNo
memory_deltaNo
next_actionsNoUp to 3 next steps for the following session
allow_secretsNo

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the behavioral burden. It discloses the destination (.handoff/), the preference for auto=true, and a security constraint. However, it does not explain whether the save overwrites existing files, what happens with the 'auto' flag, or if any special permissions are needed. Some useful context is provided, but significant behavioral details are missing.

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

Conciseness5/5

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

The description is two concise sentences. The first sentence states the primary purpose, and the second packs in actionable guidance. No filler or repetition; every word earns its place.

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

Completeness2/5

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

This tool has 16 parameters, no annotations, no output schema, and very low schema description coverage. The description only scratches the surface by mentioning goal, next_actions, auto, and security. It does not explain the full handoff pack structure, the meaning of the many array fields, the behavior of allow_secrets, or what the tool returns. For such a complex tool, the description is inadequate for reliable agent use.

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

Parameters2/5

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

The input schema has 16 parameters but only 6% have descriptions (only next_actions has a schema description). The description adds semantics for goal and next_actions, and implies something about auto and secrets, but it does not clarify many parameters like done, doing, blocked, command, decision, question, memory_delta, file, link, root, and allow_secrets. Given the low coverage, the description does not compensate enough for the many undocumented parameters.

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?

The description clearly states 'Save a long-task handoff pack into .handoff/' with a specific verb and resource. It is easily distinguished from sibling tools like handoff_init, handoff_recall, and handoff_status, which have different actions (initialize, recall, status).

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

Usage Guidelines4/5

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

The description gives practical usage guidance: 'Prefer auto=true' and 'Provide goal and up to 3 next_actions when possible.' It also includes a security rule: 'Never include API keys or tokens.' However, it does not explicitly mention when to use this tool versus alternatives, but the context of saving a long-task handoff pack implies when it should be used.

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

handoff_statusB

Show .handoff/ status, goal, and next actions.

ParametersJSON Schema
NameRequiredDescriptionDefault
rootNo.

TDQS

B3.2/5.0
Behavior2/5

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

With no annotations, the description must fully disclose behavior. It only says 'Show' and does not mention side effects (read-only nature), prerequisites (existence of .handoff'), error behavior, or output details. This is a minimal description that leaves important behavioral traits undisclosed.

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

Conciseness5/5

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

The description is a single, front-loaded sentence with no filler or repetition. Every word contributes to understanding the tool's core purpose.

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

Completeness3/5

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

For a simple status tool with one optional parameter, the description conveys the basic output (status, goal, next actions). However, it lacks details about the output format, how 'root' affects behavior, and how this tool relates to or differs from the sibling tools. The absence of annotations and output schema increases the need for more context.

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

Parameters2/5

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

The schema has a single 'root' parameter with 0% schema description coverage, and the tool description does not mention it. The parameter's name and default value (' . ') imply it is the project root, but no explicit semantics or usage guidance is provided.

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?

The description uses the specific verb 'Show' and clearly identifies the resource ('.handoff/') and content ('status, goal, and next actions'). This clearly distinguishes it from sibling tools like handoff_save or handoff_doctor.

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

Usage Guidelines2/5

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

No guidance is provided for when to use this tool versus the sibling tools. The description implies an inspection use case but does not explicitly state when it should be preferred over handoff_recall or handoff_doctor.

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

TDQS

A3.7/5.0
Disambiguation4/5

Each tool targets a distinct operation (init, save, recall, status, memory append, doctor), but recall and status both read project state, and memory_append has dual read/write behavior. Descriptions help clarify, but a minor overlap exists.

Naming Consistency4/5

All tools share the handoff_ prefix and use snake_case, but the command words vary in type: init/save/recall are verbs, while status and doctor are nouns, and memory_append is a compound. The style is consistent overall with minor deviations.

Tool Count5/5

Six tools is well-scoped for a handoff management server, covering setup, save, load, status, memory, and health check without being excessive or too thin.

Completeness4/5

The core lifecycle of handoff management is covered: init, save, recall, status, and health check. Missing operations like explicit delete or list of prior handoffs are minor and agents can work around them.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides operational continuity for AI coding agents, preserving task state, decisions, checkpoints, and project context across sessions and model switches via MCP.
    1
    Apache 2.0
  • F
    license
    Not graded
    quality
    A
    maintenance
    Local MCP server that lets your AI coding agent query its own cross-tool project history - file/command freshness, past test failures, cost & token spend, cache status, and session handoff - over stdio, 100% local, no telemetry.
    40
  • A
    license
    A
    quality
    A
    maintenance
    A local-first MCP server that snapshots project working state into a structured context object, enabling agents to share and resume sessions seamlessly without leaving your machine.
    5
    4
    Apache 2.0

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sutongwuyanzu/TaskHandoff'

If you have feedback or need assistance with the MCP directory API, please join our Discord server