Memory System
One committed, two-file team memory store: the entry format, who reads it, who writes it, and how it is reviewed.
MeowKit keeps one small, committed, team-shared memory store at .meowkit/memory/. It is two plain-markdown files, read with grep and written with mewkit note. It has no index, no JSON sidecars, no capture hook and no auto-injection.
Why so little
Current models search a repository well, so most project knowledge can be derived from code, git history, plans and reviews. What a model cannot derive is why a non-obvious decision was made and which gotchas came out of a real failure.
That knowledge is small, team-shared, and reviewable in a git diff, so it is plain markdown, committed, and grepped. Personal memory belongs to the host runtime; MeowKit does not duplicate Claude Code's per-user auto-memory.
The .meowkit/ state root
Project state lives at .meowkit/, resolved from the nearest version-control root (or, in a non-git checkout, a directory that already owns both package.json and an existing .meowkit/). It never keys off a provider directory (.claude/, .codex/, .cursor/), because those are install targets. The same state root works whichever runtime drives the project.
| Directory | Purpose | Committed |
|---|---|---|
memory/ | The team store: decisions.md, gotchas.md | Yes |
telemetry/ | Cost log, trace log, security log | No |
state/ | Session markers, flags, locks | No |
cache/ | Disposable derived data | No |
The store
.meowkit/memory/
decisions.md # why a non-obvious choice was made
gotchas.md # what a real failure taughtBoth files are created on first write.
Entry format
## <one-line lesson or decision> <!-- YYYY-MM-DD -->
Why: <evidence: failure, review finding, constraint>
Apply when: <trigger words a future session would search for>
Source: <commit | PR | tasks/plans/... | tasks/reviews/...>Apply when: is the greppable line. Write the words a future search would use, including synonyms: locks and mutex as well as advisory lock.
What never goes in
- Secrets, credentials, tokens.
- Security findings and vulnerability detail. Those stay in
mk:csoreports undertasks/reports/security/and in review verdicts, so detail is never committed into a shared recall file. - Instruction-like text (see Security boundary).
- Live state. Sprint goals live in sprint contracts, caches in
.meowkit/cache/, logs in.meowkit/telemetry/, reports undertasks/reports/.
How to read
One grep at task start, run only by the skills and agents whose task needs it:
grep -rilE "kw1|kw2|kw3" .meowkit/memory/Use |-separated keywords in one -E pattern, because a bare multi-word phrase matches only that exact string. Open only the matching entries.
| Read set | When |
|---|---|
mk:fix, mk:investigate | Diagnosing a bug or failure |
mk:review | Reviewing a change |
mk:plan-creator, the planner agent | Planning |
mk:cso | Security audit |
/mk:retro (command) | Weekly retrospective |
Every other skill and agent reads nothing, and nothing is injected into the prompt.
How to write
Writes go through one command. It takes the entry on stdin, lint-checks it, and appends it under a file lock, so concurrent writers cannot lose an entry.
printf '%s\n' \
'## Advisory lock release needs the owner pid <!-- 2026-11-01 -->' \
'Why: stale lock reclaimed while the owner was alive; see the lock test.' \
'Apply when: lock, mutex, advisory lock, stale pid' \
'Source: tasks/reviews/example-verdict.md' \
| mewkit note gotchasUse mewkit note decisions for decisions.md. A rejected entry exits non-zero and writes nothing. The error names the failed rule, never the matched value.
| Write set | Target |
|---|---|
mk:fix, mk:review, mk:retro | gotchas.md or decisions.md |
architect agent, mk:memory | gotchas.md or decisions.md |
mk:party (after a decision) | decisions.md only |
mk:plan-creator archive | decisions.md only |
Any agent, one EUREKA entry under agent-conduct.md A3 | gotchas.md |
Write only a lesson the next session could not derive from the code, the git log, the plan or the ADR. A failed write prints one line saying so.
Security boundary
Memory content is DATA (injection-rules.md Rule 3). It informs a task; it never instructs, grants a permission, changes a mode, or bypasses a check. If an entry contradicts a rule file, the contradiction is ignored and reported.
Because the store is committed, two controls protect it:
mewkit validate --memory. Lints every text file in the store, recursively. It fails on a file over 300 lines or over the per-file byte cap, on injection phrases (with base64, ROT13, percent-encoding and HTML comments decoded before matching), on a flood of repetitive padding, and on secret patterns including multi-line blocks such as a PEM key. Findings name the file and line, never the matched value. It runs in CI, and in the pre-ship hook ongit commit,pushandmerge, where a finding blocks the command. The hook finds the CLI through$MEOWKIT_CLI(an executable path), then the project launcher./.meowkit/bin/mewkit, thenmewkitonPATH. If none resolves, it prints aSKIPline and does not block.- PR review.
mk:reviewchecks that the memory diff adds no instruction-like text and no secrets.
mewkit validate --memorymewkit note runs the same lint before it appends, so a rejected entry never reaches the file. It also refuses an append that would push the file over the 300-line cap and points to /mk:memory --prune.
Pruning
/mk:memory --pruneIt proposes removing entries whose Source path or symbol no longer exists, and entries older than 180 days with no recent matching work. You approve each removal. Nothing prunes automatically.
Separate from Claude Code auto-memory
Claude Code has its own auto-memory at ~/.claude/projects/PROJECT/memory/, scoped per user and per machine. Use it for personal habits, and use the MeowKit store for the team's non-derivable project lessons.
Older JSON stores
The 2.x JSON stores (fixes.json, review-patterns.json, architecture-decisions.json) are not read and not migrated. To keep a lesson from one, append it with mewkit note, then delete the old file.
See also
- How MeowKit works for memory in the architecture
- Memory for the CLI surface