RepoOps
Open the app
07 / Memory and the brain

Keep a fixed defect, and find the rule that keeps failing

Errors renders one markdown file, .claude/brain/errors.md, and measures it. Each entry is a defect you fixed and the rule you wrote to stop it. RepoOps traces each entry back to the session that caused it, counts entries per week, and groups entries whose prevention rule is the same, which is the sign that the rule did not hold.

Last updated

Watch it

30.1 s, captions on. Narration: Microsoft Zira Desktop (provisional voice; an approved narration source is pending).Transcript
Read the narration
  1. 0:00 A defect gets fixed.
  2. 0:02 The reason leaves with the branch.
  3. 0:06 RepoOps hashes the prevention rule you wrote.
  4. 0:09 Two entries, one hash, means the rule failed.
  5. 0:13 The tab traces each entry to the commit, the session and the prompt.
  6. 0:17 A weaker match says possibly, and never counts toward attribution.
  7. 0:23 Question the rule, not the person.
  8. 0:26 Nothing reaches the manual without you.

Synthetic example. Read the guide

1

How to

A tracked repository with a .claude/brain/ directory, on a machine that captures sessions and holds the git history the blame walk needs.

  1. Write the entry under a dated heading.

    Add an h2 of the form YYYY-MM-DD and a title to .claude/brain/errors.md, newest first: what broke, the root cause, the fix. Every reader of the file treats one dated h2 as one defect and skips a heading it cannot date.

  2. Give it a Prevention rule paragraph.

    Start one paragraph with the words Prevention rule in bold. Its text is the entry's fingerprint. With no such paragraph the title is hashed instead, so two entries that share a rule but not a title will not group.

  3. Open the file in the app.

    Memory, then Brain library, where errors.md is listed under Known errors. The page renders the markdown on each request; there is nothing to rebuild.

  4. Read the trail under each heading.

    When a captured session overlaps the commit that blame walks to, a Caused by block names the commit, the session and a prompt excerpt with its band. Possibly caused by marks a weak match, which never counts toward attribution. Save as lesson opens the Lessons form with the trigger filled in.

  5. Backfill after importing history.

    POST /api/causal-link/correlate scans every heading in errors.md, security.md and anti-patterns.md against the last 30 days of sessions. It is the same scan the nightly pass runs.

  6. Watch Brain pulse on Today.

    Today's Brain pulse panel shows this week's entries against the prior three-week mean, and a recurring class line whenever a fingerprint repeats. The numbers come from GET /api/brain/metrics.

2

Use cases

You fixed something and want the reason to survive

Situation
A lock with no timeout hung a CI run. You found it, fixed it, and the branch is about to merge.
You do
Add a dated entry with a Prevention rule paragraph to errors.md and open it from the Brain library.
You see
The entry renders at the top with a Caused by block under it. The next session's briefing can carry it: it reads up to three open entries, an entry counting as open when its body has a Status line reading open, unresolved, in progress or pending.

The same rule keeps coming back

Situation
Brain pulse on Today shows a recurring class line naming a rule and the number of entries that share it.
You do
Read the entries behind that fingerprint and decide whether the rule was wrong, too vague, or right but unenforced. Rewrite it, or turn it into a lint rule, a CI check or a lesson guard.
You see
Recurrence is measured rather than assumed. The count is the number of entries sharing a fingerprint: a claim about what you wrote down, not about how often the defect happened.
3

Expected outcome

WorkedRecent headings carry a Caused by or Possibly caused by block with the band beside the label.
WorkedGET /api/brain/metrics returns four weeks of counts, the trend and each recurring class with its fingerprint, occurrences, first and last seen.
WorkedA defect the nightly pass traced exactly or strongly appears on Lessons as an inactive lesson.
Did not workThe page says Nothing here yet.

Next step: The repository has no .claude/brain/errors.md. Create it and write one dated entry.

Did not workNo Caused by block on any heading.

Next step: No captured session overlapped the commit blame walked to. Check that sessions are captured, then POST /api/causal-link/correlate.

Did not workA recurring class groups unrelated entries.

Next step: Neither entry has a Prevention rule paragraph, so both were fingerprinted by title. Add one to each.

Did not workA promoted lesson is not in CLAUDE.md.

Next step: Promoted lessons land inactive. Refine it on Lessons and activate it.

4

What else to consider

An entry is not prevention

An entry in errors.md never reaches CLAUDE.md on its own. The managed block renders active lessons only, and the nightly pass promotes a traced defect as an inactive lesson, at most 10 a run, that a person has to activate. A recurring class has no time window: it is the same fingerprint anywhere in the file, however old.

The nightly pass

Around 02:00 the pass correlates headings with sessions, promotes exact and strong matches, and, with an ANTHROPIC_API_KEY, proposes new entries on Brain reflection. Accept appends to errors.md; Reject writes the body to proposed/rejected/. High-confidence proposals can drain without you, up to 20 a run; REPOOPS_BRAIN_AUTO_DRAIN_OFF=1 stops that. REPOOPS_BRAIN_AUTO_LESSONS=0 stops promotion, and REPOOPS_BRAIN_DREAM=0 stops the whole pass.

What leaves the machine

Local by default. On a bound device the hourly brain pulse sends counts and 8-character fingerprints, never the prose; the weekly team digest email rolls them up across devices. The Brain snapshot switch in Settings, off by default, sends the text of errors.md redacted at the edge, and repoops.ai/team/docs/errors.md renders it. A file over 1 MB is cut and the hosted page leads with a Partial file notice.

Cost and retention

The fingerprint, the trend, the correlation and the trail are local and make no model call. The model cost is the nightly reflection and the short promotion drafts, both on your own key. Nothing trims errors.md and no route deletes an entry: it is a file in your repository, edited and reverted in git.