Skip to content
mnema: a signed, append-only record of the decisions behind AI coding agents' workmnema: a signed, append-only record of the decisions behind AI coding agents' work

mnema is the decision record for AI coding agents.

Who decided this, and why? What was turned down? Has it changed since? When an agent settles a choice in a chat that ends, nothing answers. mnema keeps the answer in the repository.
Terminal window
npm i -g @mnema/code

Remember

With the plugin, each agent session opens with the decisions in force, by name and id.

Enforce

A rule addressed at a path can refuse an agent's write there, or hold it for a person where the host allows.

Prove

Every write the product makes ends in a signed checkpoint and is hash-chained; anyone can verify it, even in a browser, and a reader's guarantee runs up to the last checkpoint.
mnema verify
public: local integrity verified (T1/T2/T4); 1 tail(s); all events are signature-covered; 1 backup key(s), which sign nothing until restored (informational, not a break; --verbose names the key); external witness (T3): not covered, nothing outside this machine attests this record
What mnema verify prints on this repository's own record, at the commit this site was built from: cebc4e8da68c
One word of a recorded decision changed by hand in the record's file, and mnema verify failing with entry hash mismatch
A changed word caught: one word of an accepted decision is changed by hand in its file, and mnema verify names the event whose hash no longer matches and exits 1. A cut that takes the newest events together with their checkpoint is not caught: a hash chain shows what changed, never what is gone (what it proves). Recorded from the built binary by recordings/a-tamper-caught.sh.

How it works

Record

An agent over MCP, or you at the command line, writes a decision with its reasoning and the options turned down, and a task with its description and a handoff with its brief.

Rule

A person accepts it, or an agent where agent-accepts is on (the default; an agent's acceptance is marked as its own), and mnema link addresses it at a path. The rule can govern that path, ask for a person there, or refuse a write.

Hand over

With the plugin, each session opens with what is in force (in Claude Code, so does each subagent), and each edit meets the rules for its file. In Claude Code, a note of the host's own memory is also copied into this machine's private tree, until you switch that off.

Verify

Every write ends in a signed checkpoint and is hash-chained; a reader's guarantee runs up to the last checkpoint. mnema verify, a second reader in Python, or the page mnema site writes checks it.

Your agents settle choices all day: a library, an approach, an option turned down. Those choices usually live in a chat that ends, in one tool’s memory or in somebody’s head, where nobody can check who decided them or whether they were changed since. mnema writes them down in the repository, next to the code, with their reasons and what was turned down. The record is signed and only grows: a change of mind is a new entry that supersedes the old one, never an edit. Where the host runs hooks, each session opens with the decisions in force, and anyone can check offline that what it holds was not changed since it was signed. What is measured, and what is not, is on the evidence page.

Terminal window
npm i -g @mnema/code # the binary
cd your-repository
mnema init # founds the record in .mnema/
mnema decision record "Keep money as integer cents" "Float sums drift; cents are exact."
mnema decision move accept ADR-1 --note "Agreed in review." # a decision enters proposed; accepting puts it in force
mnema link ADR-1 src/billing --rel refuses-a-write # the rule, addressed at a path
mnema verify # reads the signed record; one line saying it is intact is the green

No agent has run yet: that is the record, a rule in force, and the proof. ADR-1 names the first decision of a new record. To hand the record to an agent, install the plugin for your host; in Claude Code:

Terminal window
claude plugin marketplace add felipesauer/mnema
claude plugin install mnema@mnema

Every other host is in Hosts. mnema init also writes the mnema instructions into AGENTS.md and the other files agent hosts read, naming each; at a terminal it first asks which of them, and mnema instructions --remove takes them out. The first record, step by step, is Your first record.

Each of these is a choice with a reason, and the reasons are in Where it fits.

  • Not a semantic memory. Search is by the words written in a record; there are no embeddings.
  • Not an agent runner. It calls no model and runs no tool for the agent.
  • Not a copy somewhere else. The committed record travels with the repository, and what you record privately stays on this machine, apart from the notes your agent’s host receives, when a session opens through the plugin and when the agent asks for them, which the host sends to its model; the witness verbs send a digest out, and with Sigstore the identity too, only when you run them.
  • Not access control. The gate refuses an illegal move; it does not decide who may write.

mnema verify reads the events and the committed public keys of a project’s trees (no private key, no network) and prints each verdict verbatim, naming the level it reached.

  • What holds. A changed or reordered event breaks the hash chain, and an edit made without the signing key is caught where the signed checkpoints remain; verify --require=signed fails when they were taken out.
  • What does not hold. Nothing proves that nothing was removed: a hash chain shows what changed, never what is gone, and the history a git remote keeps is what covers omission. A record forged whole under a fresh key verifies clean, a key is not proven to be the person a name says, and the agent named on a fact is the name its client announced, unless an agent key signed it (then the name the record enrolled the key under). An agent key’s role and its retirement are facts of the record that holds them: verify crosses a project’s trees for a retirement, and a reader of one tree does not. A refusal of a write covers a host’s editing tools, not its shell: sed -i on a protected file goes round it.
  • What a green verify means. That nothing verifiable is broken, not that the record is honest, and the gate protects the shape of a change, not who may make it.

The whole table, claim by claim, is in docs/what-it-proves.md; how each claim about the agent hosts is held, and which are not held yet, is in docs/evidence.md.

mnema 0.1.4 · commit cebc4e8da68c