On your repository

4. Memory that earns trust

On this page

On your repository · 1. Find → 2. Before you push → 3. A rule that comes back → 4. Memory that earns trust → 5. Two weeks later

You want to: stop re-explaining the same non-obvious thing to every new session.

You leave with: one memory that the next session starts with, that demotes itself when the code it points at changes, and that gains or loses standing from what happens after it is used. Adds Engram.

Before you start

Have engram installed; see installation. Continue in the repository from the earlier steps. This step writes .engram/; keep it out of Git for now.

Record one thing a session learned

Think of the last time you told an agent, or a new teammate, something about this repository that is true, non-obvious and not written anywhere: a service that must be restarted after a config change, a fixture that only passes with a particular seed, a module whose name does not match what it does. Record it, anchored to the code it is about:

engram init --domain <your-domain>
engram record --key <slug> --kind invariant --ring M2 \
 --anchor <path/to/relevant/file> \
 --body '<one or two grounded sentences, with the reason>'

--ring M2 makes the memory repository-wide rather than personal. --anchor is what lets it notice when the code changes.

What you should notice: the thing you keep re-explaining now has a key, a scope and a hash of the code it is about.

Does not prove: that the memory is correct. Recording does not certify.

See the next session start with it

Wire the session-start hook so a shell-capable agent receives relevant memory before its first turn. For Claude Code, add a SessionStart hook that runs:

engram hook claude session-start --ote .engram/ote.toml || true

Codex, Gemini and Pi use engram hook codex|gemini|pi session-start; the Engram command reference lists them. Without a harness, see what the agent would see:

engram block --context '<the task you are about to start>'

What you should notice: the next session's first message already knows the thing. You did not say it.

Does not prove: that the agent used it well, or that the cue is still true. A recalled memory is a candidate for the agent to confirm.

Watch it notice it is stale

Change the anchored file in a way that matters to the memory, or move it, then probe:

engram probe --ote .engram/ote.toml

The result lists which memories are intact, which were re-anchored and which were invalidated. A memory whose anchored source has changed out from under it is demoted, not served as if nothing had happened. Add --reanchor only after you have read the changed source and decided the guidance still applies.

When the guidance is simply wrong now, record the corrected version with --refines; the old memory is retired and its history kept:

engram record --key <new-slug> --kind invariant --ring M2 \
 --refines <slug> --anchor <path/to/relevant/file> \
 --body '<the corrected guidance>'

What you should notice: the memory degraded on its own when the code moved under it. Wikis, CLAUDE.md files and vector stores all keep serving the old answer; this one flagged itself.

Does not prove: that surviving memories are still true. Probe checks anchors, not meaning.

Let it earn standing

If a PostToolUse hook for shell commands is in place (engram hook claude post-tool-use), gate and test outcomes that follow a memory's use are recorded as evidence. Over weeks, guidance that is followed by passing gates gains standing; guidance followed by failures loses it. Inspect it:

engram status --ote .engram/ote.toml

Promotion to trusted needs stronger, attested evidence; the Engram manual covers that when you want it.

What you should notice: this one lands weeks in, not today. A memory you recorded on a hunch has either accumulated passes behind it or has not, and the store tells you which.

Does not prove: causation. Outcomes are evidence that a gate passed after the memory was in play, not proof the memory caused it.

Keep it current

When you refresh the index, also run engram probe and engram sleep; sleep consolidates the evidence. With the cns wrapper, cns curate does this for all three organs at once.

What you have

Four tools, each added when a specific question needed it, on a repository you know. Axon finds the code and what an edit reaches. Soma brings your rules into the change. Engram carries what sessions learned, and knows when that has gone stale. Your tests still decide whether the code is right.

Next: come back in two weeks and read what the memory did while you were not looking →