← all entries
S-TIER technique

primer.md + memory.sh — live-updating CLAUDE.md companion

keshavsuki · 2026-03-13T03:02:41.000Z · in AI Saves, Vol. 2
Open post ↗

100k ft — What is this?

primer.md + memory.sh — live-updating CLAUDE.md companion
techniqueS-tier

50k ft — Why care?

@keshavsuki on fixing CLAUDE.md staleness: add a primer.md that Claude rewrites at end of every session (current state, next step, blockers), plus a memory.sh launch hook that injects last 5 commits and modified files, plus a git hook logging commits. Four-layer always-current context.
agents

10k ft — Key takeaways

• Add primer.md + end-of-session rewrite rule to Victor's Claude Code projects

5k ft — Tools & techniques

Claude, Claude Code end-of-session hook, hooks/automation, primer.md live session state

1k ft — Deep-dive / try it

Comment “claude” for the full setup... CLAUDE.md is static. It describes your project as it was when you wrote it, not as it is now. Here’s the fix. primer.md is a second file that Claude Code rewrites completely at the end of every session. Current project, what just got done, exact next step, open blockers. Always current. One rule in your CLAUDE.md: at the end of every session, rewrite primer.md completely. After the first session, it handles itself. memory.sh injects live git state every time you launch. Last five commits, modified files, current branch. Claude already knows what changed before you say a word. Git hook logs every commit to a project memory file automatically. Four layers. Every session Claude Code knows exactly where you are. (max context) Comment “claude” for…
primer-md-pattern
Transcript excerpt
Your cloud.md file is just static. You write it once and it just sits there. But that's the problem. Your project changes every session. Cloud.md doesn't. Here's the fix. A file called primer.md. It's a separate file that cloud could rewrite at the end of every session. Current project will just got done, next steps, and open blockers. Tight, current, and always accurate. You just have to add one rule to your cloud.md file. At the end of every session, rewrite primer.md completely. That's it. And after the first session, it handles itself. But there's a second layer. Memory.sh. A shell script that injects live git state at launch. S5 commits, modified files, recent errors, and current branch. All of it pulled fresh every time you open a new session. So when you run memory.sh, cloud already knows what's changed from last time without even saying a word. And then there's a git hook. One line in every commit automatically logs itself to a project memory file. That's a zero effort audit trail. Odmd holds your rules and preferences static and always there. Primer.md holds your current state, dynamic, written every session. Memory.sh injects live code-based contacts at launch. Git hook keeps a running log of every commit automatically. Four layers in every session cloud code will know exactly where you are. Comment cloud and I'll send you the full memory stack.

Appears in

More from @keshavsuki

Collection: AI Saves, Vol. 2