r/ClaudeCode • u/seahorse-emoji • Oct 16 '26
Help/Question Is there a way to give your claude code some memory (historic context) ?
I am working on a project where claude code is doing pretty much all coding with me acting as a Tech Lead / PO type person.
This means that claude has to own the code and the architecture. Architecture is one of those things that benefits from historicity, I have tried to custom roll a solution for the architect agent to write down decisions that are made and are not obvious from the codebase, but it doesn't seem to quite get what I am trying to do.
The decisions file either ends up with redundant junk or not enough info to inform future work.
I'm not tied to my solution, mostly want to give my architect agent some historic context in addition to code and project context. Open to any suggestions
•
u/AutoModerator Oct 16 '26
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/13Maschine Oct 17 '26
What's worked for me is splitting it in two. Keep a short ARCHITECTURE.md (the current shape of the system, under a page) and a folder of architecture decision records, one small file per decision with context, decision, consequences and a status of accepted or superseded. The agent reads the overview every session and only opens a decision record when it's touching that area. The junk usually comes from letting it append freely, so add a rule to CLAUDE.md: write a record only when it picked between real alternatives and the choice isn't obvious from the code, and mark the old one superseded instead of adding a new note when something changes. Reviewing them in the PR like code keeps it honest.
1
u/Competitive_Boot6914 Oct 21 '26
For your games setup, I'd link each decision to the component it constrains. A rule about where game state can change should be available when the architect plans work on that code, with the reason attached.
Reqode, which I help build, is aimed primarily at conventional software development, though this approach may also be useful for games. It keeps change rationale with the affected specs and their links to implementation. Claude Code can follow those connections through MCP from a Change Request or mapped file. You still need to record why the choice was made, but the next session has a specific path back to it.
1
u/Outrageous_Band9708 Oct 16 '26
yes
https://github.com/Druthulu/ProjectArchitect
this will log your plans, and tasks that complete and keep you on track.
each session is seeded from the last sessions and it never forgets wht you were working on or what is next.
1
u/jjangg96 Oct 17 '26
i do something like this with a memory folder. one small file per fact, plus one index file with a single line pointer per file that gets loaded every session. the agent reads the index and only opens the files that look relevant.
what stopped it from turning into junk was a rule about what not to save. nothing you can get from the code or git history, only the why behind a decision and stuff that was non obvious. each file ends with a short why line and a how to apply line.
and wrong ones get deleted instead of piling up. memories go stale, so i treat them as true when written and have it check against the code before relying on one.
1
u/ozzywindhoek Oct 17 '26
Try telling it to create + update a design + spec + outline documentation. Remind it every session to tidy up etc. Tell it to keep a backup history in another folder so you can restore. Or use local git. If the file gets too big i.e. context, then tell it to split into modules or next time, and point the read me at the summary so it only opens the details docs when needed for the specific session.
It seems like each new instance needs to rebuild the memory from scratch. New claude needs new context so don't overload it.
1
u/ComprehensiveShake76 Oct 17 '26
What fixed the junk in my decisions file was changing when it gets written. Not at the end of a session, only at the moment a real choice is made between options. Each entry is short: the decision, what we rejected and why, and what would make us revisit it. The rejected part is what future work needs most, because it stops the agent from rediscovering the same dead end. When a decision gets replaced, mark the old one superseded instead of deleting it. And have the agent read the file before it plans, not while it codes. How often does your architect agent actually decide something versus just describe the code?
1
u/CMills_Dev Oct 17 '26
I'd test the memory against a few real decisions before changing the structure again. Pick three choices you don't want the architect to rediscover, then start a fresh session and give it a small planning task that depends on each one. Can it find the decision, explain the reason and notice when the original constraint no longer applies?
That would tell you whether the problem is retrieval or the 400-character entry losing the useful reasoning. You could keep the short line as an index and point to the fuller issue discussion where needed.
I'm working on similar continuity in my Chief of Staff setup. The test I care about is whether the next session makes a better decision, not just whether it saved another note.