Skip to main content
Glama

OpenHandoff

面向 AI 编码代理的可移植、本地优先的上下文交接。

CI License: MIT Python

OpenHandoff 将持久的项目事实保存在两个小文件中:

  • CONTEXT.md 供人类和 Obsidian 使用;

  • context.json 供代理、MCP 适配器和自动化使用。

首个 MVP 刻意保持简单且可检查:无需云账户,没有隐藏数据库,脱敏在交接写入之前完成。未来的适配器可以读取 Codex、Claude Code、Cursor 和 Windsurf 的转录记录,而无需强制使用特定供应商的记忆格式。

OpenHandoff 专为公共仓库和团队交接而设计:文件为纯文本,MCP 服务器零依赖,类密钥的值在持久化之前会被脱敏。

技能包

该仓库在 skills/ 下包含三个可移植技能:

  • openhandoff-context — 在代理之间捕获、恢复和打包上下文。

  • openhandoff-privacy — 在共享之前审计交接和转录记录。

  • openhandoff-release — 准备经过测试、有文档、可复现的发布。

将技能目录复制到你的 Codex 技能目录中,或使用此 GitHub 仓库通过 Codex 技能安装器安装。这些技能刻意保持范围狭窄,以便可以独立使用。

Related MCP server: Memory Fabric

快速开始

python -m venv .venv
source .venv/bin/activate
pip install -e .
openhandoff init .context --title "My project"
openhandoff capture .context \
  --title "My project" \
  --decision "Use SQLite" \
  --todo "Add the MCP adapter" \
  --notes "The next agent should run the test suite first."
openhandoff show .context

对于普通用户安装,请在发布后使用 pipx install openhandoff。开发依赖和检查记录在 CONTRIBUTING.md 中。

为特定任务构建紧凑的上下文切片。匹配的决策、TODO 和注释行会优先保留,然后结果会被确定性地裁剪到请求的预算范围内:

openhandoff pack .context --task "MCP adapter" --max-chars 4000

MCP 服务器

零依赖的 MCP 服务器通过 stdio 暴露 load_handoff、save_checkpoint、search_handoff 和 pack_context:

openhandoff-mcp

对于本地代理配置,使用 openhandoff-mcp 命令,无需网络访问。服务器只读写代理提供的交接路径。

Codex 配置示例:

[mcp_servers.openhandoff]
command = "openhandoff-mcp"
args = []

Claude Desktop 配置示例:

{
  "mcpServers": {
    "openhandoff": {
      "command": "openhandoff-mcp",
      "args": []
    }
  }
}

捕获代理事件

openhandoff-hook 接受 stdin 上的 JSON 事件(或纯文本),对类凭据的值进行脱敏,并将结果追加到 .context/events.jsonl:

printf '%s\n' '{"type":"agent_message","message":"finished"}' \
  | openhandoff-hook --path .context

Codex 可以直接将其 notify 负载发送到该钩子。将此添加到你的 Codex 配置中(该命令在 stdin 上接收 JSON 负载):

notify = ["openhandoff-hook", "--path", ".context"]

对于 Claude Code,将相同的可执行文件接入你设置中的命令钩子。确切的设置文件可能因 Claude Code 版本而异;以下是一个示例:

{
  "hooks": {
    "afterTurn": [
      {"command": "openhandoff-hook --path .context"}
    ]
  }
}

导入转录记录

Codex 和 Claude Code 的 JSONL 事件流可以导入为相同的格式:

openhandoff import-transcript ./rollout.jsonl .context --title "Project handoff"

路线图

  1. Cursor 和 Windsurf 转录适配器。

  2. 任务特定上下文包中的文件和提交引用。

  3. Obsidian 和 GitHub 同步,带密钥扫描和审查门禁。

项目状态

该项目处于早期阶段,欢迎真实世界的反馈、集成和文档改进。请勿提交聊天转录记录、凭据或私有 Obsidian 数据。

Available Tools

4 tools
load_handoffC

Load the current project handoff shared between coding agents.

NameRequiredDescriptionDefault
pathNo.context

TDQS

C2.6/5.0
Behavior1/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 of behavioral disclosure. It merely states the action without indicating whether the operation is read-only, what it returns, whether it modifies any state, or if there are any side effects. The description offers no behavioral context beyond the verb.

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 description is a single, concise sentence with no redundancy. It is appropriately short for a simple tool, though it lacks any structural formatting or additional clarity that could elevate it to a 5.

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?

For a tool with no output schema and no annotations, the description is incomplete. It doesn't state what the loaded handoff looks like, whether it returns structured data or a raw string, or how the 'path' parameter interacts with the concept of 'current project'. The simplicity of the tool (one optional param) lowers the bar, but the description still misses essential operational details.

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

Parameters1/5

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

The only parameter 'path' has a default but no description, and schema description coverage is 0%. The description does not explain what 'path' refers to (e.g., directory or file path, default location). With zero parameter documentation in both schema and description, the agent is left to infer meaning solely from the tool name.

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 ('load') and resource ('current project handoff'), and the context of sharing between coding agents. This distinguishes it from sibling tools like save_checkpoint (save), search_handoff (search), and pack_context (pack), even though the siblings' behaviors are inferred from names.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention conditions (e.g., 'use when you need the latest handoff; use search_handoff for querying historical ones') or any exclusions. An agent receives no routing help beyond the tool name.

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

pack_contextC

Build a compact, task-focused context slice for the next agent.

NameRequiredDescriptionDefault
pathNo.context
taskYes
maxCharsNo

TDQS

C2/5.0
Behavior2/5

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

With no annotations, the description must disclose all behavioral traits. It only says it 'builds' a context slice, but doesn't explain side effects (e.g., whether it reads/writes files, creates a file at the path, or truncates context based on maxChars). It offers no detail on permissions, reversibility, or data handling, leaving the agent with little understanding of what will happen.

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 description is a single vague sentence. While concise, it's under-specified and doesn't earn its place by conveying substantive information. It's not a tautology, but it's closer to a label than a useful explanation. A concise description should still be informative.

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

Completeness1/5

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

For a tool with three parameters, no output schema, and no annotations, the description is drastically incomplete. It doesn't explain the function's behavior, parameters, return value, or when to use it. An agent cannot reliably invoke this tool correctly based on the provided information.

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

Parameters1/5

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

Schema coverage is 0%, and the description mentions none of the three parameters (task, path, maxChars). It provides no meaning beyond the bare type/default in the schema. The agent gets no explanation of what 'task' is, what default path '.context' means, or how maxChars is used. This is a critical gap.

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

Purpose3/5

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

The description provides a clear verb ('build') and a resource ('context slice'), but it's vague about what a 'context slice' actually is. It doesn't name specific actions or fields, and it doesn't differentiate from sibling tools like load_handoff or save_checkpoint. While it's not a tautology, it lacks the specificity to distinguish it from alternatives.

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 given on when to use this tool versus siblings. It doesn't mention prerequisites, scenarios, or exclusion conditions. The description only states what it does, not when to use it, leaving the agent to infer appropriateness.

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

save_checkpointB

Save durable project decisions, TODOs, and notes for the next agent.

NameRequiredDescriptionDefault
pathNo.context
notesNo
titleYes
todosNo
decisionsNo

TDQS

B3.1/5.0
Behavior2/5

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

With no annotations provided, the description must carry the full behavioral burden. It only says 'durable', implying persistence, but does not disclose side effects like overwriting behavior, file creation, directory handling, or error conditions. This is insufficient for a write operation.

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. It immediately states the action and the content type, making it efficient and easy to parse.

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?

For a tool with 5 parameters, no annotations, and no output schema, the description is inadequate. It does not explain the purpose of 'title' and 'path', how todos/decisions are used, or what happens on invocation. An agent would lack critical context to use the tool correctly.

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 hints at 'decisions', 'TODOs', and 'notes' which map to the 'decisions', 'todos', and 'notes' parameters, but it does not explain the required 'title' or the 'path' default, nor the format of TODOs/decisions arrays. The meaning of parameters is largely left to inference.

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 a specific verb ('Save') and identifies the resource ('durable project decisions, TODOs, notes'), clearly distinguishing it from siblings like load_handoff, search_handoff, and pack_context. It conveys a persist-for-later purpose without ambiguity.

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?

The description gives no guidance on when to use this tool versus alternatives. It mentions saving for the next agent but does not indicate when to choose save_checkpoint over load_handoff or search_handoff, nor does it state any prerequisites or exclusions.

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

search_handoffB

Search decisions, TODOs, and notes in the current handoff.

NameRequiredDescriptionDefault
pathNo.context
queryYes

TDQS

B3.2/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 of behavioral disclosure. It conveys that this is a search/read operation and scopes it to 'the current handoff,' but it does not disclose what happens on no matches, how results are shaped, whether the path parameter changes the search target, or whether 'current' is tied to the path default. These are material gaps for an unannotated tool.

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?

A single sentence that opens with the action verb and packs in the scope and target content. It is efficient and front-loaded, though its brevity borders on under-specification given the missing parameter context.

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 two parameters, no output schema, and zero annotations, the description leaves an agent without the semantics of 'path' and 'query,' the meaning of 'current handoff,' and expectations for return values or empty-result behavior. This is insufficient for an agent to call the tool correctly with confidence.

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—but it never mentions either parameter. It does not clarify that 'query' is the search term or explain what 'path' (defaulting to '.context') controls, nor what 'current handoff' means relative to that path. The description adds essentially no meaning beyond the bare schema property names.

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 states a specific verb ('Search'), a resource ('the current handoff'), and the objects of the search ('decisions, TODOs, and notes'). This clearly distinguishes it from its siblings load_handoff, save_checkpoint, and pack_context, which cover different operations on the same artifact.

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?

The phrase 'in the current handoff' provides useful scoping context, implying this searches the active handoff rather than historical ones. However, it gives no explicit guidance on when to prefer this over load_handoff for finding content, and does not name alternatives or call out exclusions—an agent must infer the division of labor.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv0.1.0
    • First observedload_handoff
    • First observedpack_context
    • First observedsave_checkpoint
    • First observedsearch_handoff

TDQS

B3/5.0

Scored across 4 tools

Disambiguation5/5

Each tool targets a distinct action: loading the handoff, saving new checkpoint data, searching within it, and packing a context slice. There is no overlap or ambiguity between these four operations.

Naming Consistency4/5

All tools follow a clear verb_noun pattern (load_handoff, save_checkpoint, search_handoff, pack_context). The only minor inconsistency is the use of different nouns (handoff, checkpoint, context) when referring to related concepts, but the pattern remains uniform and predictable.

Tool Count5/5

With only 4 tools, the server is tightly scoped for its purpose of managing agent handoffs. Every tool serves a distinct, necessary function and none feel superfluous.

Completeness4/5

The set covers core lifecycle operations: load, save, search, and context packing, which likely handles most workflows. A minor gap is the lack of a clear delete/reset operation for the handoff, but this may not be needed in the intended use case.

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides AI coding assistants with persistent project memory to retain architectural decisions, code patterns, and domain knowledge across sessions. It stores data locally in a SQLite database, allowing agents to remember, recall, and manage project-specific context using full-text search.
    0
    Apache 2.0
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI coding assistants to store and retrieve project-aware context as plain Markdown files locally, with no cloud or vector database required.
    1
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI coding assistants to persistently save, search, and restore project context across sessions, including decisions, progress, file caches, checkpoints, and channel-based memory. It supports git-aware organization, batch operations, and shared memory across parallel sessions.
    250 npm
    MIT