← ClaudeAtlas

debug-memorylisted

Reproduce observational-memory bugs (reflection, recall, observer, freshness, eviction) by dumping the live `~/.duet/memory.db` into a fixture and driving an eval against it. Use whenever the agent's memory misbehaves — wrong observations, bad reflections, missing recall, runaway tokens — or whenever the user asks to debug, repro, audit, or tune memory.
dzhng/duet-agent · ★ 29 · Code & Development · score 85
Install: claude install-skill dzhng/duet-agent
# Debug Memory The standard operating procedure when memory misbehaves is: dump the live store, narrow to the smallest reproducing slice, seed it into a `MemorySession` fixture, write the failing eval, then iterate on the prompt or code until it goes green. Never tune against the user's running database — every dump is a fixture. ## 1. Dump the live store `scripts/dump-memory.ts` reads any PGlite memory store and writes JSON. Default source is `~/.duet/memory.db`, default destination is stdout. ```bash # Everything bun run scripts/dump-memory.ts --pretty --stats --out /tmp/memory.json # Only raw observations from the last 7 days bun run scripts/dump-memory.ts --kind observation --since 7d --pretty \ --out evals/fixtures/global-reflect/recent-pool.json --stats # Only reflection rows (to inspect what global prune produced) bun run scripts/dump-memory.ts --kind reflection --pretty --stats # A specific session's tail bun run scripts/dump-memory.ts --session <session_id> --limit 50 --pretty # High-priority cross-session reflections older than 30 days bun run scripts/dump-memory.ts --kind reflection --priority high --until 30d --pretty ``` Filters compose with AND. Repeat `--session`, `--priority`, and `--tag` for OR-within / AND-across semantics. `--limit` keeps the newest N rows. ## 2. Place the dump as a fixture - Eval fixtures live under `evals/fixtures/`. The global-reflect set is the model: `recent-pool.json` (raw dump) + `recent-pool.ts` (typed `SeedObservation[