Skip to main content
Glama

为长期 AI 工作提供可移植、由 git 支撑的项目状态——适用于 Claude Code、Cursor 或任何支持 MCP 的工具。

不是记忆工具。记忆工具回答的是"我们聊过什么?" Continuity 回答的是另一个问题:*"这个项目现在**的真实状态是什么,哪些东西不能动?"*

为什么这样构建

  • 状态以纯 markdown 文件形式存在,并由 git 跟踪。 Git 就是事件日志:历史 = git log,回滚 = git revert,审计 = git blame。每条 claim 都是人类可读、可 diff、可手工编辑的。你可以像审查生成的代码一样审查 AI 捕获的内容——以 diff 的形式,随时都可以。捕获时没有审批关卡

  • 两种存储模式,一个 API。 仓库模式<repo>/.continuity/,从工作目录向上查找)适合像 Claude Code 这样有项目 cwd 的编辑器/代理工具。集中模式~/.continuity/projects/<name>/,命名项目)适合像 Claude Desktop 这样没有项目 cwd 的工具——你只需按名称引用项目。

  • 恢复上下文是这些文件的确定性投影(读取路径中没有 LLM)——冻结的约束、有效的决策以及它们取代旧决策的原因、你不应重新提出的被否决路径、未解决的问题和下一步。

  • 信任来自诚实,而非盲目相信。 每条 claim 都带有 confidence + provenance,因此新会话能知道哪些是已确认的、哪些是 AI 推断的,并据此校准,而不是全盘信任。

完整架构见 DESIGN.md,驱动其诞生的验证见 poc/

Related MCP server: KeepGoing MCP Server

安装(作为 Claude 插件)

Continuity 是一个 Claude Code 插件,以独立的插件市场形式分发——本仓库就是该市场。它可以在 Claude Code 运行的所有地方运行:终端、桌面应用和 Web。在 Claude Code 中:

/plugin marketplace add vikcena01/ai-continuity-plugin
/plugin install continuity@continuity-marketplace

就这样——捆绑的 MCP 服务器、continuity 技能(自动恢复 + 自动捕获)、SessionStart 钩子以及 /resume /freeze /why 命令都会一起安装。dist/ 已提交且无依赖,因此安装时无需构建步骤。

本地开发

npm install
npm run build   # typecheck + bundle to dist/
npm test        # build + 69 assertions across four suites

循环(CLI)

continuity init "Build Snip, an internal URL shortener"
continuity record-decision "PostgreSQL is the source of truth" --body "ops knows it; volume is modest"
continuity reject "DynamoDB as primary store" --reason "KV overhead unjustified at our volume"
continuity record-constraint "Short codes are exactly 7-char base62" --body "printed in marketing + partner contract"
continuity freeze "7-char base62"     # lock an invariant — fuzzy: id OR title substring
continuity resume                     # <- the compact state a new session gets
continuity why "301"                  # <- what a decision replaced, and why
continuity resolve "8-char codes" --reject --reason "separate namespace"
continuity list                       # ids are short: d1k3, c2m9, x1p4, ...
continuity log                        # the git-backed event log

Claim 有简短、可输入的 id——一个类型前缀、一个序号和一个两字符后缀:d1k3c2m9x1p4。后缀是并发工作安全的关键:没有它,两个各自记录第 16 条决策的开发者都会写入 claims/d16.md,并在合并时冲突。freeze / why / supersede / resolve 接受 id 标题子串。状态写入 claims/ 下,并在每次变更时自动提交到 git——但从不自动推送,因此当捕获的提交未推送时,resume 会发出警告。

关闭 claim

resolve 是 claim 达到终态的唯一方式,且原因必填——一个凭空消失的 claim 不会给下一个会话留下任何教训:

continuity resolve <id-or-text> --accept --reason "..."   # a parked conflict wins
continuity resolve <id-or-text> --reject --reason "..."   # it becomes a guardrail
continuity resolve <id-or-text> --close  --reason "..."   # a settled risk/question

接受一条与冻结 claim 冲突而被搁置的 claim 还需要 --unfreeze。冻结是模型中唯一的人类行为,因此覆盖它必须是第二次有意的行为。

在 Claude Desktop 中使用(MCP)

任何支持 MCP 但没有项目 cwd 的主机都可以使用带命名项目MCP 服务器。(注意:Claude 桌面应用内部运行 Claude Code,因此完整插件——钩子、命令、技能——在那里可用;此路径适用于纯 MCP 主机。)构建(npm run build),然后添加到 claude_desktop_config.json

{
  "mcpServers": {
    "continuity": {
      "command": "node",
      "args": ["/absolute/path/to/ai-continuity-plugin/dist/mcp.js"],
      "env": { "CONTINUITY_HOME": "/Users/you/.continuity/projects" }
    }
  }
}

然后在聊天中:"创建一个名为 snip 的 continuity 项目"create_project"恢复 snip"resume_context;模型会随进度记录决策/约束/否决。用户可调用的 resume prompt 是 Claude Code 自动恢复钩子在 Desktop 上的替代品。工具:list_projectscreate_projectresume_contextrecord_decisionrecord_constraintrecord_rejectionrecord_opencaptureresolve_claimfreeze_claimwhy

作为 Claude Code 插件(额外功能)

本仓库本身也是一个 Claude Code 插件(清单位于 .claude-plugin/plugin.json)。在那里,除了 MCP 服务器之外,你还能获得 Claude Desktop 无法提供的能力:

  • 一个 SessionStart 钩子hooks/hooks.json),会在新会话/恢复的会话/压缩后的会话中自动注入 resume_context——你无需主动要求;

  • 一个 Stop 钩子,在每轮结束时运行捕获检查,因此决策无需任何人记得要求就会被记录。两个独立的防护(stop_hook_active 加时间节流)使循环不可能发生;

  • 斜杠命令 /resume/freeze/why

仓库还附带 .claude/settings.json,它针对自己已提交的 dist/ 注册了相同的钩子。因此,只运行 git clone 的协作者无需安装任何东西就能获得自动恢复和自动捕获。两个钩子都会按会话去重,所以既安装插件克隆仓库是无害的。

Claim 格式

每个 .continuity/claims/<id>.md

---
id: d4k7
type: decision            # decision | constraint | rejected_alternative | mission | milestone | question | next_action | ...
status: accepted          # accepted | frozen | superseded | rejected | open | needs_review | resolved | done
resolution:               # set by `resolve`: why this claim was closed
confidence: confirmed     # confirmed | tentative | unverified
provenance:
  origin: manual
  created: 2026-08-04T00:00:00.000Z
supersedes: []
superseded_by: null
depends_on: []
tags: []
---
Postgres is the primary datastore; a Redis read cache may come later.

Claim 格式(一份契约)

一旦其他人的仓库持有 claim,文件格式就成了一份契约——因此它带有版本号:

---
schema: 1              # absent means 1
id: d16k3              # <type prefix><n><2-char suffix>; the suffix keeps concurrent clones from colliding
type: decision         # mission requirement decision constraint architecture milestone
                       # hypothesis experiment risk question next_action rejected_alternative
title: One crisp fact
status: accepted       # accepted active frozen open superseded invalidated rejected
                       # needs_review completed done resolved
confidence: confirmed  # unverified tentative confirmed
provenance: { origin: auto, created: ... }
supersedes: []
superseded_by: null
superseded_reason: ""  # why the replacement happened — travels with the claim
resolution: ""         # why it was closed, set by `continuity resolve`
---

Prose body. The reason, the context, whatever a future session needs.

稳定性承诺。 由旧版 Continuity 写入的 claim 始终可读:缺少 schema 即表示 1,旧格式会在内存中向前迁移,而不会重写你的文件。由更新版 Continuity 写入的 claim 会被按名称明确拒绝,并大声报错,而不是被半解析——猜测我们不理解的格式正是状态悄然劣化的方式。当你希望磁盘上明确显示版本时,continuity migrate 会按当前 schema 重写文件。

审查已捕获的内容

捕获是自主的,因此保障措施是你可以看到它写了什么:

continuity review            # semantic diff: what appeared, changed status, or was edited — and why
continuity review --accept   # mark it reviewed

它既能捕获手工编辑,也能捕获工具写入,恢复上下文会告诉你何时有变更在等待。

状态

v1.0 — 确定性核心 + CLI + MCP 服务器 + Claude Code 插件。 带版本的 claim 文件、防冲突 id、模糊查找、有预算的恢复投影、git 支撑的事件日志,以及七个测试套件中的 124 条断言(npm test)。

当前可用:

  • 自主捕获,由每轮结束时的 Stop 钩子驱动——而不是靠模型记得去做。

  • 一个协调器,位于每次批量捕获之后:去重、保留谱系的取代,以及一个冻结守卫,将任何与冻结 claim 矛盾的内容搁置为 needs_review 而不是直接应用。

  • 一个 resolve 动词,用于关闭协调器搁置的内容,以及在风险/问题解决后将其关闭。

已知限制,以 claim 形式记录在本仓库自己的 .continuity/ 中:Stop 钩子的捕获检查被限制为最多每 10 秒一次,因此在极快的交流中达成的决策仍可能被遗漏(q3);从混乱会话中可靠提取状态仍是未解决的技术风险(q2)。

标志

一个 C 被绘制成一条不间断的弧线——在会话之间存续的线索——终止于一个节点,即一条被捕获的 claim。assets/icon.svg 是同一标记放在圆角方块上,用作头像或 favicon;assets/logo-light.svgassets/logo-dark.svg 是字标组合,由 prefers-color-scheme 选择,因此两种 GitHub 主题都能正常工作。

许可证

MIT — 见 LICENSE。版权所有 (c) 2026 Vikash。

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Gives AI coding assistants persistent memory, safety controls, and project awareness by tracking coding sessions, protecting critical files from modifications, and managing approval workflows with automatic changelog generation.
    19
    13
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    Provides AI coding assistants with persistent project memory by capturing development checkpoints during git commits, branch switches, and inactivity. It enables seamless task resumption through tools that retrieve session history, momentum, and synthesized re-entry briefings.
    93
    3
    MIT

View all related MCP servers

Related MCP Connectors

  • Give your AI agent a persistent map of your project's structure, dependencies, and bugs.

  • Git-backed platform for skills, tools, and context for AI agents

  • The project brain for AI coding agents — memory, decisions, sprints, knowledge base via MCP.

View all MCP Connectors

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/vikcena01/ai-continuity-plugin'

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