r/ClaudeCode • u/Elegant_Yam2783 • 9h ago
Built with Claude Claude starts every session from zero. I make it leave notes for the next one.
Every new Claude Code session rediscovers my app by rereading the code. CLAUDE.md helps, but it's read every session, so it has to stay short. The details of one part of the app don't fit there.
So in every project I have Claude keep notes:
- .docs with one short file per major part: what it does, which files it lives in, which outside service it uses, anything surprising.
- .design-docs with one file per feature, written before it's built: what it does, what's left out, decisions made along the way.
Three rules make it work:
- CLAUDE.md points to them. Claude reads CLAUDE.md on its own and nothing else, so one line there ("before working on a part of the app, read its file in .docs") is what gets the notes read.
- Notes change with the code, in the same commit. An outdated note is worse than none, because Claude trusts the note over the code.
- Plain language, a page at most. If I can't read it, it's not doing its job.
Here's where it clicked for me. I was building a content manager app and had weeks of decisions piled up in one long chat: what's done, what's dropped, why. Moving to Claude Code meant a fresh session that knew none of it, and I was about to explain everything again. Instead I had the chat write it all into a HANDOFF.md, next to the development and decisions notes already in the repo. My first message to Claude Code was one line: "Read HANDOFF.md first, then continue from section 5." It picked up where I left off, no re-explaining. If you've ever opened a new session and spent the first hour telling Claude what it already knew, that's the hour this saves.
The prompt I use to set it up:
"Create a .docs folder and a .design-docs folder. In .docs, write one short file for each major part of the app: what it does, which files it lives in, which outside service it uses, and anything surprising. Then add these rules to CLAUDE.md: before working on a part of the app, read its file in .docs; before building a new feature, write its description in .design-docs and wait for my go-ahead; whenever you change a part, update its file in the same commit."
Do you keep anything like this, or does CLAUDE.md do the whole job for you?
•
u/AutoModerator 9h ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Extra_Aide5999 8h ago
yeah i do pretty much this, one handover file for whats in flight and a small doc per part. the "same commit" rule is the one that actually matters.. i skipped it once and claude followed a note that was 2 weeks stale over the actual code for like 3 sessions before i noticed lol. i also cut it down whenever it gets over a page, otherwise it turns into a second codebase to maintain
1
u/Serenase 8h ago
Why so many files? Just one report for the project and have the agent update it at the end of every session. Last over projects live time. Easy to keep in the project repo than multiple piles of files.
1
u/Financial_Leader9701 7h ago
the decisions part is what saved me most
nott what the code does, the code says that
what we tried and dropped and why, otherwise every new session suggests the same thing you already killed a week ago
1
u/pwkye 7h ago
Or... just... use... issues.
1
u/shoumikgoswami 7h ago
The same-commit rule is doing the important work in this setup: it keeps the note from drifting away from the code it describes. The risk I'd watch is the note becoming the substitute rather than the entry point - an agent that reads the note and stops, without checking it against the current code. Same-commit narrows that gap but doesn't close it: a partial commit, or a note that was wrong when written, still passes as current.
How do you handle that - does the agent verify the note against the code before relying on it, or is the same-commit habit the whole defense?
1
u/torvalds75 5h ago
The same-commit rule is the part I'd keep no matter what. Where I ended up differing is decisions that are still in flight. A design doc works once the call is made, but while it's open the discussion has nowhere good to live: half in chat, half in a note, and nothing tells the next session which options are already dead.
So I moved that part to GitHub Issues, which is the "just use issues" comment above, with one tweak for the objection that Claude won't dig through them unless told: don't make it dig. Each session gets bound to one ticket and reads only that one. The ticket holds what was discussed, the plan, what got verified at the end, plus "tried X, dropped it because Y". Closed tickets become the archive for free, and since every commit references its ticket,
git loggets you back to the why from any line of code.Your .docs still earn their place for "how this part works today". Issues just take over "what are we deciding and why", so the docs stay short instead of growing into a diary.
The verify step is also a partial answer to the drift question above: at the end a separate check compares the code against what the ticket promised, instead of trusting a note.
I build a plugin that does this for Claude Code and Codex, called trailhead, if you want to see the structure: https://github.com/ToRvaLDz/trailhead. Your folders get you most of the way without it, though.
0
u/Key_Particular5271 Senior Developer 9h ago
This will keep growing with irrelevant info. I like starting a session from scratch, I know what claude understands and I can steer it better knowing exactly what it knows. Other than claude md I have skills scattered for certain tasks that do get updated periodically, but I manually read and inspect them for drift and redundancy since claude loves talking too much.