Memory Patterns
July 20, 2026 · View on GitHub
Documented, reusable memory patterns for AI coding agents.
Each pattern answers:
- What problem it solves
- Memory tiers involved
- Write / recall / hygiene policy
- Verification and human handoff
- Tool-specific notes (Grok, Claude Code, Codex, Cursor)
- Failure modes and cost profile
Pattern registry
| Pattern | Cadence | Risk | File |
|---|---|---|---|
| Session Scratchpad | per session | Low | session-scratchpad.md |
| Project Episodic Log | per run / daily | Low | project-episodic-log.md |
| Durable Facts Store | on decision | Medium | durable-facts-store.md |
| Retrieval Budget | every recall | Medium | retrieval-budget.md |
| Memory Hygiene Loop | 1d–1w | Low | memory-hygiene-loop.md |
Machine index: registry.yaml
How to use a pattern
- Pick a pattern (pattern-picker)
- Scaffold:
node tools/memory-init/cli.js . --pattern <id> --tool grok - Week one: scratch + episodic only (unless you already have durable facts reviewed by a human)
- Audit:
node tools/memory-audit/cli.js . --suggest - Add hygiene before the state file exceeds budget
Adding a pattern
Use templates/pattern-template.md, register in registry.yaml, open a PR.