Procedural memory for coding agents: only trust a fix after tests pass, cuts tool calls 30%

maa____z · reddit · 2026-10-15

The author built MuscleMemory (Apache-2.0), procedural memory for coding agents that remembers how tasks were fixed so agents don't re-derive solutions. Key lesson: memory storing a wrong fix is worse than none, because agents trust it and stop searching.

Six rules: (1) only learn from sessions where tests passed after the final code change; (2) the source session doesn't count as proof — the fix must pass in 2 more independent sessions; (3) a human approves files, edits, and tests first; (4) one failed check pulls the recipe; (5) failed attempts are saved only as "watch out" notes, never as fixes; (6) recall uses no model calls — exact file/command matching plus local search, 13ms.

Small-sample measurements (cost, not success rate): across 18 sessions on 3 repair tasks, 30% fewer tool calls, 28% faster, 25% fewer input tokens; a different agent reusing learned skills saw 30% fewer tool calls and 18% lower cost at 3% slower. Open question: skills aren't rechecked when their dependency files change until a failed check triggers a pull.

Related event: MuscleMemory: Open-Source Procedural Memory for Coding Agents(3 posts)→

Original post →

More from coding & agent

coding & agent channel →