|
| 1 | +# Team memory — `.agents/memory/` |
| 2 | + |
| 3 | +Validated patterns, durable project context, and pointers to external |
| 4 | +systems. Checked into git so the whole team — and any agent working in |
| 5 | +this repo — benefits from accumulated knowledge. |
| 6 | + |
| 7 | +This complements Claude Code's built-in per-developer auto-memory: |
| 8 | +team-shareable knowledge lives here; personal preferences and ephemeral |
| 9 | +state live in the auto-memory. |
| 10 | + |
| 11 | +## Layout |
| 12 | + |
| 13 | + .agents/memory/ |
| 14 | + ├── MEMORY.md # Index — scan at start of every session |
| 15 | + ├── README.md # This file — read when adding/updating memories |
| 16 | + ├── feedback/ # Validated patterns & corrections |
| 17 | + ├── project/ # Durable project context & rationale |
| 18 | + └── reference/ # External systems & resources |
| 19 | + |
| 20 | +One file per memory. Filename = the memory's kebab-case slug. |
| 21 | + |
| 22 | +## File format |
| 23 | + |
| 24 | + --- |
| 25 | + name: tests-no-db-mocks |
| 26 | + description: One-line summary — used to surface relevance, so be specific. |
| 27 | + metadata: |
| 28 | + type: feedback # feedback | project | reference |
| 29 | + since: 2026-05-19 # date added (ISO) |
| 30 | + --- |
| 31 | + |
| 32 | + <one-paragraph rule or fact> |
| 33 | + |
| 34 | + **Why:** <reason — incident, constraint, team convention> |
| 35 | + |
| 36 | + **How to apply:** <when this kicks in; what to do or avoid> |
| 37 | + |
| 38 | + Related: [[other-memory-slug]] |
| 39 | + |
| 40 | +`Why:` and `How to apply:` are required for `feedback` and `project` |
| 41 | +memories — they let future readers judge edge cases. `reference` |
| 42 | +memories may be shorter (link + one-line purpose). |
| 43 | + |
| 44 | +Link related memories with `[[slug]]` (the target file's `name:`). |
| 45 | + |
| 46 | +## Routing — repo vs. auto-memory |
| 47 | + |
| 48 | +| Kind of fact | Goes to | |
| 49 | +|---|---| |
| 50 | +| Personal preference, role, style | auto-memory (`user`) | |
| 51 | +| Personal habit feedback | auto-memory (`feedback`) | |
| 52 | +| Team coding/test/PR rule | **`feedback/`** | |
| 53 | +| Durable project rationale | **`project/`** | |
| 54 | +| Ephemeral project state (freezes, OOO, deadlines) | auto-memory (`project`) — would rot in git | |
| 55 | +| Team-shared external resource | **`reference/`** | |
| 56 | +| Personal external resource | auto-memory (`reference`) | |
| 57 | + |
| 58 | +**Litmus test:** *would a teammate joining the project next month benefit |
| 59 | +from knowing this?* If no, it belongs in auto-memory. |
| 60 | + |
| 61 | +## Write protocol |
| 62 | + |
| 63 | +1. Write the file **uncommitted** in the working tree. |
| 64 | +2. **Surface the change** in the same turn so the human can review. |
| 65 | +3. **Do not auto-commit** memory edits as part of an unrelated PR — memory |
| 66 | + changes should be reviewable on their own. |
| 67 | +4. **Correct in place** when an existing memory turns out wrong; `git blame` |
| 68 | + carries the history. |
| 69 | +5. **Propose deletion explicitly** when a memory has gone stale, rather |
| 70 | + than silently editing it out. |
| 71 | + |
| 72 | +## Updating the index |
| 73 | + |
| 74 | +After adding or removing a memory file, update `MEMORY.md`. One line under |
| 75 | +the matching section: |
| 76 | + |
| 77 | + - [slug](category/slug.md) — description from frontmatter |
| 78 | + |
| 79 | +Keep the index short — long descriptions belong in the file body. |
| 80 | + |
| 81 | +## Anti-patterns — do not store |
| 82 | + |
| 83 | +- Anything derivable from the code (module structure, paths, conventions |
| 84 | + visible in source). Use `grep` / `Read`. |
| 85 | +- Recent-activity summaries or PR lists — `git log` is authoritative. |
| 86 | +- Fix recipes for specific bugs — the commit message belongs in the commit. |
| 87 | +- Anything already documented in `.agents/` reference docs — keep one |
| 88 | + source of truth. |
| 89 | +- Personal preferences (see routing). |
0 commit comments