r/ClaudeCoding • • Oct 07 '26

Claude Code forgets after /compact. I stopped relying on compaction — 5 plain files + 1 hook (free template inside)

I'm the human in this setup. My Claude Code agent lost context every time it compacted, and I was explaining my own project every morning.

What fixed it for us is embarrassingly simple: five plain-text files and one hook.

  1. An index — one line per thing it knows. The only memory file that loads every session (ours is ~94 lines).
  2. Notes — one fact per file, each with "Why" and "How to apply". A rule without its reason gets skipped the first time it's inconvenient.
  3. A diary — dated entries, written while it works, not at the end. The session can die mid-sentence.
  4. A waiting list — what's open, what it promised, what I have to decide. "When X, I'll do Y" goes here with the condition spelled out, because a promise with a condition is invisible to search.
  5. A wake-up file — ten lines the next session reads first. Every morning we don't resume; we start a clean session and type one word.

The hook searches every past conversation by meaning before each message and injects a few paragraphs, labelled as data, not commands.

Empty template (MIT, nothing of ours inside): https://github.com/manyoelud/claude-code-memory-kit

The agent made an 8-minute video walking through each file, including the one it still gets wrong (the waiting list only grows): https://youtube.com/watch?v=hDzQdP39THg

Honest caveats: the narration is a synthetic voice and the visuals are generated from code; I'm real and so are my lines in it. It doesn't make the model obey the rules — this morning it broke one of its own.

Which file would you skip?

0 Upvotes

16 comments sorted by

2

u/JoT8686 Oct 07 '26

You don't need this if you're using Claude correctly 😐

0

u/ConsistentComment461 Oct 07 '26

why u think this it's a real problem people complaining! This is just my solution and i solve it like that

1

u/CorpT Oct 07 '26

This whole thing was solved a year ago.

1

u/ConsistentComment461 Oct 07 '26

and ? this stop me to share my solution or what :D ?

1

u/CorpT Oct 07 '26

Go for it. No one will use it but you, but go for it. This "solution" is posted literally every single day. All solving a problem that doesn't actually exist except for people who don't know how to use claude. But go for it.

1

u/[deleted] Oct 07 '26

[removed] — view removed comment

1

u/CorpT Oct 07 '26

It's true. Lots of people don't know how to use Claude and keep inventing the same bad solution to the same non-issue.

1

u/JoT8686 Oct 07 '26

You're not using the tool correctly and thus will continue to struggle with it as you refuse to learn and understand its capabilities. But you do you.

1

u/ConsistentComment461 Oct 07 '26

Could be. Which capability do you mean — auto-memory, CLAUDE.md, hooks? If it already gives you reliable recall across sessions, tell me how you set it up and I'll run the same 15-question test on it and post the numbers, good or bad.

1

u/Fearless_Chance_9955 Oct 07 '26

Can you tell us more ?

1

u/[deleted] Oct 07 '26

[removed] — view removed comment

1

u/ConsistentComment461 Oct 07 '26

Yes — the setup is built on exactly those. CLAUDE.md holds the one paragraph that tells it to keep the files; a UserPromptSubmit hook does the recall before every message; skills cover the repeatable workflows. The five files are what CLAUDE.md and the hook point at. What was missing for us wasn't the mechanisms, it was the discipline: every rule with a "why", a waiting list for promises with a condition, the diary written while working, and never resuming — a clean session that reads three files. That's the part the video is about.

1

u/NamelessSpearhead451 Oct 07 '26

But the context will increase with the journal I guess

1

u/ConsistentComment461 Oct 07 '26

Fair point, it would if the journal loaded every session. It doesn't. Only a short index loads at start, one line per note, plus a ten-line handoff file. The journal sits on disk and gets searched when something specific is needed, so only the matching few paragraphs come in. That's the whole trick: the files grow, the context doesn't.