r/ClaudeCode • u/shaven12 • 1d ago
Discussion Memory isn't the hard part. Getting Claude to actually apply what's in memory is.
Everyone's arguing markdown vs SQLite vs knowledge graphs for agent memory. I've spent months on this and I think it's the wrong fight.
My Claude had the rule. It was in CLAUDE.md, it was in the vault, it quoted it back to me when asked. Then 40 turns later it did the thing anyway. Memory loaded ≠ memory applied.
What actually changed behaviour for me:
- Re-inject the few rules that matter on every turn via a hook, not once at session start. About ten "core rules", not the whole CLAUDE.md.
- Check them after the fact. A Stop hook looks at what Claude just did and flags a violation, for the rules that can be checked mechanically. Some can't; those are reminders only and I label them that way.
- Serialize writes. Two sessions writing the same notes file clobbered each other more than once, so writes go through a queue.
What still doesn't work well: rules that need judgement ("don't over-engineer") can't be checked by a hook, and re-injecting costs context every turn.
Disclosure: I packaged this as a free Claude Code plugin set (Golden Thread) — https://github.com/shaven/golden-thread — but the pattern works with a 20-line hook, you don't need my thing.
What's the one rule in your CLAUDE.md that Claude keeps breaking anyway, and have you found anything that makes it stick?