Your coding agent keeps stepping on the same rake: how to make lessons persist across sessions

madsthines · reddit · 2026-08-18

A developer asks how to stop coding agents from repeating the same mistakes: mid-task the agent works out a gotcha (tests need a local DB, the build wants a specific flag, use the shared client not a raw query), then the next session forgets everything — fresh context, same 20 minutes rediscovering it.

Tried and failed: piling rules into CLAUDE.md grows into a wall nobody reads; longer system prompts eat context; re-explaining each time isn't a strategy. None of it truly learns.

They ask the community: how do you maintain notes/rules without bloat? Is anyone doing something automatic — capturing the lesson when a command fails and feeding it back on the next run? Do you scope notes per repo/branch, and does any of it survive across machines or teams, or stay trapped on one laptop?

Original post →

More from coding & agent

coding & agent channel →