Set up Mneme

Mneme checks code changes against the architecture decisions your team has recorded. It works in three layers: an optional lookup server so agents can find decisions, a hook that checks your coding agent’s edits, and a required check in CI before merge.

We recommend starting with Claude Code + CI: an agent hook that blocks bad edits, plus a required check before merge.

Choose your setup

Pick what you want, then where your code gets written. Every tool in the integration catalogue is here, with the status the catalogue gives it.

Coding agents and harnesses

Editors and hosts without a Mneme hook

Agent orchestrators

Software factories

CI only

Runtime and policy environments

Other / not listed

The three layers

Each layer does one job. Two of them enforce your decisions; the third helps an agent find them. You can start with any one, and the guides add the others.

  • DiscoverOptional

    Decision MCP server

    A local server that speaks the Model Context Protocol (MCP), so an agent can search decisions, ask which ones apply to a file, and propose new ones for people to review. It blocks nothing.

  • EnforceCore

    Mneme command-line interface (CLI) and agent hook

    The mneme command runs the checks. A hook is a command your coding agent runs before it edits a file; Mneme’s hook blocks an edit that breaks an active rule. Coverage differs by agent.

  • VerifyCore

    CI check before merge

    A job in your pipeline runs mneme check on each file a pull request adds or modifies. It catches changes the hook missed, and changes from agents and people with no hook.

What you install

Your decisions live in the repository as architecture decision records (ADRs), short Markdown files in docs/adr/. Mneme compiles them into one memory file, .mneme/project_memory.json, and every layer reads that file. A decision blocks changes only once it has an active rule. You get one in two ways: write a directive such as FORBID_LITERAL under ## Constraints in the ADR, which is enforced as soon as you import it, or let Mneme propose a rule, test it with mneme protect validate and switch it on with mneme protect activate.

The guides follow the second path: mneme setup creates the memory file and blocks nothing, mneme adr import adds your decisions, mneme protect validate tests a proposed rule without changing anything, and mneme protect activate switches it on. Hooks and CI enforce only active rules.

ComponentNeededHow
Mneme CLI, mneme-hq 0.11.0Requiredpipx install "mneme-hq==0.11.0". Add the [mcp] extra for the lookup server.
Memory file, committedRequiredmneme setup creates .mneme/project_memory.json; mneme adr import fills it from your ADRs.
At least one active ruleRequiredA ## Constraints directive in an ADR, or mneme protect validate then mneme protect activate for a rule Mneme proposes. Setup on its own blocks nothing.
Agent hookRequired for agent-side checksThe Claude Code plugin, the Codex CLI hook, or your agent’s entry in the catalogue. Some agents have none.
CI checkRequired for the full setupA GitHub Actions workflow or GitLab CI job you own, made a required check.
Decision MCP serverOptionalmneme decision-mcp, registered with your agent as a local server.

The commands and the recorded output for each step are in the guides below. A first install takes one decision from setup to an active rule, as Install Mneme and activate your first protection shows.

Command
pipx install "mneme-hq==0.11.0"

Setup guides

Each guide uses the same example decision, so you can follow one and then add the next layer from another.

What no setup guarantees

Check one allowed change and one blocked change in your own repository before you rely on any layer. Every guide shows both. Three limits apply everywhere:

  • Hooks fail open by default: when a check can’t run, the change goes through rather than being blocked. Claude Code also has an opt-in mode that refuses direct file writes when the check can’t run, enabled by a reviewed change on your default branch. If a check crashes or times out, the Claude Code hook allows the edit, and the Codex CLI hook marks it unevaluated without blocking.
  • Some writes are not intercepted before they land. Most shell commands and scripts reach disk first; Claude Code and Codex CLI check them when the agent ends its turn, and other agents rely on CI.
  • CI covers only what your pipeline runs on: the files a change adds or modifies, in the repositories and branches where the job is required.

Not sure which decisions can be enforced yet?

The Architecture Audit reads your repository’s decision records and reports which ones Mneme can protect today.