
mnema: decision records for AI coding agents
io.github.felipesauer由 GitHub 账号 felipesauer 发布v0.1.5更新于 Nov 5, 2026
Signed, append-only decision records for AI coding agents, over MCP. Verify them offline.
概览
在代码仓库中保存带签名、只追加的决策记录,AI 编码代理通过 MCP 写入,并可离线校验。
- 可以做什么
- 在仓库内的共享、本机私有或全局记录树中记录决策与任务,每条事实签名后追加。
- 让工作通过关卡流转,记录带简报和备注的交接,并查看每个任务由谁在处理。
- 无需密钥和网络即可校验记录,并显示每次判定达到的覆盖级别。
- 查询对某个路径生效的规则,包括从其他仓库继承并按提交固定的规则。
- 初始化记录与代理指令文件,并检查会改写记录的配置。
- 适用场景
- 适合多个代理和人员共同维护一个仓库、希望把改动背后的理由保存为可签名、可核查条目而不是散落在对话中的场景。也适合需要留下可审计的决策与任务交接轨迹、并让外部人员无需你的密钥即可校验的团队。
- 运行要求
- 以本地 stdio 进程运行,从 npm 包 @mnema/code 安装,需要 Node 24.15.0 或更高的 24 版本,或 26.0.0 及以上;该包仅支持 ESM。需要一个用于建立记录的仓库,以及代表本机身份的签名密钥。未声明认证、环境变量或请求头。
安装
在 SourceWeft 中
- 打开 控制台中的 mnema: decision records for AI coding agents,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
@mnema/code
[CI] [npm: @mnema/code] [License: Apache-2.0] [Node 24.15.0 or a later 24, or 26.0.0 or later]
Your decisions, handed to your agents' sessions and held at the edits they govern: append-only and signed in the repository, and checkable by anyone.
Tamper-evident, not tamper-proof: what is still in the record has not changed since it was signed, and a stranger can check that without your keys and without installing this.
This is the package you install: the mnema command line and the MCP server of
mnema, two surfaces over one record. The agent writes
through MCP while it works, and the plugin in plugin/ hands the record to a
session as it opens; you read, audit and verify from the terminal. It holds no domain logic of
its own: the workflow rules and the proof live in @mnema/core and @mnema/chain.
What it gives you
- A record of decisions in the repository that agents and people write to, each fact signed and appended, in a committed tree the team shares, a private one for this machine and a global one.
- A command line to record, read, move work through its gates and verify, and an MCP server
over stdio for the agent to do the same: both ask the same gate. At a terminal,
mnema decision reviewgoes through the decisions awaiting a judgement one by one (accept, reject, skip or quit), with no id to copy, and signs each verdict with your own key. mnema init, which founds the record and leaves in.mnema/aREADME.mdthat says what the folder is and an.editorconfigthat unsets what an outer one could impose on its bytes; where the repository has a.prettierignoreor declares prettier, it adds the line.mnema/to it and says so. It writes the mnema instructions (when to call the mnema tools, and what never goes in the record) intoAGENTS.md, into aCLAUDE.mdorGEMINI.mdthat exists, and into a rule file of its own for Claude Code, Copilot and Cursor, and names each file. At a terminal it first shows what it found around the folder, asks which agent hosts to write them for (arrows and space; the hosts found are checked; Esc founds nothing) and whether an agent may accept what you choose, and shows everything it will write, once, before it writes any of it; with no terminal, or with--all-hostsor--yes, it asks nothing and writes all four (an agent whose shell is a pseudo-terminal passes--all-hostsor--yes, or it waits at the question). Run again in a project founded before, it adds only what that project lacks beside the record;mnema instructions, with--checkor--remove, writes, checks or removes the instructions.mnema doctorpoints at a missing README,.prettierignoreline or instructions block, names a pre-commit hook, Biome, dprint or lint-staged configuration that would rewrite the record, and edits none of those files.- Tasks that carry their words. The
--descriptionoftask createand the--briefoftask handoff(and the same two arguments of thecreate_taskandrecord_handofftools) record up to 64 KiB of text beside the task, as a note about it;mnema show <task>serves the description, the last handoff with its brief and the notes, and the opening read says who has each task in flight and what happened last. A handoff that names no tree is recorded where its task lives. The format does not change. mnema verify, which reads the record with no key and no network and prints the level it reached. A record a formatter rewrote is refused, and one line beside the refusal names the files, when reading them back in canonical form proves that is all that happened. An agent key one tree of the project retired is retired in the others it reads: what the key signed there after the retirement is refused, and not counted as attested.- A brief and a plugin that hand the decisions in force to an agent's session, and the rules
addressed at a file beside a write to it (in Claude Code, Codex, Copilot CLI, Gemini CLI, Qwen Code and OpenCode). In Claude Code the plugin also hands the brief to a
subagent as it starts, and, after a question the agent asked the person is answered, names the
tool that records the choice. After a write there, a note of Claude Code's own memory for this
project is copied into this machine's private tree, once per content (never the index
MEMORY.md, never a note about the person, never the public tree; on untilmnema switch off host-memory-mirror), and a file that holds decisions the record cites nowhere gets one line naming the command that imports it, which records nothing. When themnemaon thePATHis older than the plugin, the opening of the session says so and gives the command that fixes it;mnema doctorsays it in either direction. - A record inherited from another repository (
mnema inherit set), pinned at one commit and read only when it verifies there: its rules in force reach the paths they address, inmnema rules,mnema why,governing_rulesand the gate before a write, each naming its origin and commit. mnema usage --tools, which counts how many times each MCP tool was called, from a file this machine keeps in its home and never in the repository;mnema switch off tool-call-countstops it.- A session journal, which the
Stophook keeps on this machine, outside the record: ids and counts of what a session did with it (never its words), so the nextStopreads only what the host wrote since and the run the MCP server closes ends with an outcome that theresumeandstatusreadings print, and the notes the next session opens with say where this one stopped; a conversation that was compacted is handed back what entered the record while its session ran.mnema switch off session-journal,last-sessionandafter-a-compactionstop them. - A task for the work a session hands to other agents, in the Claude Code plugin: the first dispatch of a session records
one private task, each dispatch a private handoff on it (its short description and the path of a brief file, never the
prompt), and the end of the session closes it;
mnema switch off agent-mirrorstops it. Every switch says where it begins and what it carries.
The reference has every verb and tool, and what each one leaves unproven.
What it proves, and what it does not
The record is tamper-evident, not tamper-proof: it does not stop an edit, and mnema verify
shows when what is in the record has changed since it was signed, and a cut that leaves the last
checkpoint in place; by default it does not catch a cut off the end that takes the last checkpoint with it, or one tail deleted whole while another remains (a key left without a tail is noted, not failed). A record in which no tail holds anything any more exits 1, by name, at every --require; --since <rev> exits 1 when files the revision held are gone. It reads the events and public keys of the project's trees, with
no private key and no network, and prints each verdict verbatim.
- It does not say every event is signed: the verdict names the level it reached, and only
verified (T1/T2/T4)means every event is covered. - It does not catch someone holding the signing key who rewrites and signs again; a witness
outside the machine (
mnema witness stamp) dates the record, and the history a git remote keeps is what shows a cut. - It does not prove nothing was deleted: a tail removed together with its key, while another remains, leaves nothing on disk to cross.
- It does not make the agent named on a fact the one that did the work, and it is not access control: anyone who can run the command line writes as this machine's identity.
- It does not count every use of a tool:
mnema usage --toolscounts only the calls this machine's MCP server answered, nothing of it is signed, andverifydoes not read it.
The whole table, claim by claim, is in What it proves, and the long form of each row is in the reference.
Install
Then mnema doctor says whether the mnema your shell runs is the one you meant. Where the package came from says how to check the published version against its npm provenance.
The install page has the steps for a Node installed by the system. Requires Node 24.15.0 or a later 24, or 26.0.0 or later; the package is ESM-only.
Your first record
Your first record shows what each of them prints, line by line.
Where to go next
The reference · Each host · How it works · The plugin · Where it fits · Evidence
License
Apache-2.0. See LICENSE and NOTICE, which this package carries.
来源:packages/code/README.md,提交 a6ceea2
工具
0版本历史
1- v0.1.5最新Nov 5, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分