Agent Memory Has a Sweet Spot: 10 Lines Optimal, Code Beats Rules for Tracking
rohanpaul_ai · x · 2026-10-05
Hands-on experiments on personal agent memory show that more notes stop helping past a point — extra memory lines make agents miss rules.
Key findings:
- Rules vs code: written rules work for style preferences (e.g., signing with a first name), but for anything the agent must count or track, a stated rule failed 44% of the time while code keeping the total failed 0%.
- Memory sweet spot: with Claude Haiku 4.5, violations dropped from 77% (no memory) to 20% at 10 lines, then rose back to 25% with longer memories.
- Self-rewriting memory stalls: agents rewriting their own memory from user complaints improved early but plateaued near 48% violations, versus 7.1% when every preference was simply stated upfront.
Takeaway: use code for anything the agent must count or track, and keep memory short.
More from coding & agent
- Dev ships throwaway Postgres for agents: pg19 via pglite on Cloudflare DO over raw TCP — ritakozlov · 2026-11-29
- Product idea: cloud Android VMs and home WiFi proxies to make agents look human — Darpinian · 2026-11-29
- 38 free agent skills distilled from shipping three live AI products — PawelHuryn · 2026-11-29
- Step 5: run evals on synthetic data pre-launch, watch real traces after — PawelHuryn · 2026-11-29
- Break your agent before attackers do: 6 tests mapped to OWASP LLM Top 10 — PawelHuryn · 2026-11-29
- PM shares playbook for shipping 4 customer-facing Claude agents into production — PawelHuryn · 2026-11-29