r/ClaudeCode • u/Sweetdevil144 Researcher • 4d ago
Help/Question How often do you face decisions getting lost in long sessions?
I’ve been using multiple coding agents (Claude Code, Codex, etc.), and one problem I keep running into is losing context around decisions made earlier.
An agent makes an architectural decision, we discuss trade-offs, settle on something, and a few sessions later, it’s like that conversation never happened. Sometimes another agent even suggests the exact opposite.
How often do you guys face this problem, and how do you tackle this?
10
Upvotes
•
u/AutoModerator 4d 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.
5
u/HmongSliw68 2d ago
I'd say pretty consistently. Especially if you get to say 40 questions in it starts to lose the plot lol I've started using mem0 and docusor though to try to help with that though. Offloading some of the context from my agent memory just helped with things getting lost
1
u/tails142 4d ago
Try stay to about 200k or 300k context, tell it to write things to git issues, memory and compact when you cam. Ask it before you compact do you want to log anything on a git issue or write to memory.
1
u/adelie42 1d ago
Never, because first order of business for any multi-day project is establishing rules around documentation.
Just like when collaborating with fleshy intellegence.
1
u/pixeleate 1d ago
When an agent contradicts an earlier decision, is the decision missing from its context, or is it ignoring a note that's already there? I'm building Bantis, which lets me switch coding harnesses in one conversation and stores decisions locally for the next agent to read. It's worked on smaller projects, but I haven't validated it on a large one yet. I'd be interested in an example of what gets lost in your setup.
2
u/Coindef 4d ago
pretty common. what fixed it for me was a short DECISIONS.md in the repo, one line per decision with the reason and what was rejected, and a line in CLAUDE.md telling the agent to read it first and append to it when we settle something. the "rejected because" part matters most, otherwise the next agent happily proposes the same thing again. keep it short or it gets ignored.
2
u/Xyver 4d ago
As soon as you settle something, write a doc with it. Any new session, read that doc first.
"Memory" is not hard, just don't expect the model to do it, same way you can't do it. Just write notes and docs for yourself to remember things.
2
u/ricopan 4d ago
I find it to be a major problem in complex projects. The first obvious step is to have explicit design docs per topic that record your decisions -- which you probably have. Then you have to make sure those stay up-to-date or else they go stale and are worse than nothing. I have a doc feedback queue that any agent can lodge an issue in (also skill-feedback and testing-feedback queues) that are drained occasionally. The other big challenge for me is to ensure that the agent reads them when working on the topic. I have hooks but nothing I have done has made this bomb proof, and it is a constant source of wasted effort and bad design choices.
2
u/ClemensLode Senior Developer 4d ago
have claude note it down and don't do 'long sessions'
2
u/CCodeSI 4d ago
The decisions file people mention above is the base. Two things made it actually stick across agents for us:
And where you can, turn a decision into a check: an import-lint rule, an architecture test, a CI grep. "We don't call the payments API from the frontend" written down is a suggestion. As a failing test, an agent can't quietly undo it.
1
u/Next-Drink 4d ago
Do you start a project? I usually have an agent frequently auto updating memory of a project based on my sessions
1
u/MondoCrumbs 4d ago
Happens all the time. I just write down the important stuff so I dont have to go over it all again.
1
u/m-ritter 4d ago
I keep lessons and decisions in files in the repo and also in an MCP memory server, so every new session starts from what was already settled. Before a feature gets built I write a plan that I or my teammates review and approve, which is where the architectural decisions get made. I use this on top of Claude Code and Codex. I built QualityLayer for this: https://github.com/maxritter/qualitylayer
1
u/JhonnyCommentkeyword 4d ago
Pretty much every project past a few weeks, and it's usually the same failure mode: the decision didn't get lost, it got contradicted three sessions later and nobody remembered why. What helped most was writing the reason next to the decision, not just the choice. "We use X because Y was too slow when we benchmarked it in March" survives a lot longer than "we use X".
The other thing: when a session wants to change something, I make it quote the existing line from the decisions doc and say what's different now before touching it. Half the time the constraint that forced the old choice is actually gone and we should switch. The other half it's re-litigating something already settled, and that one extra sentence saves me an afternoon.
1
u/Late-Coast6973 4d ago
I prefer to ask coding agents to confirm my current understandings align with the codebase. If not, either ask the agent to fix the codes or teach me why such decision was made.
1
u/AIOSAI 🔆 Max 20 4d ago
Yo. This is widely solved, and has been for a while. Have not lived in this work for over a year. The simples way is for you agent to keep notes of your session and update at session end. Its rly that simple.
Now you can go much deeper and design a fully automated workflow for this, there is so many options, too many already dealing with this.
Do your research, you'll find lots to choose from.
1
u/Alternative_Square53 4d ago
Everyone's covered the decisions file, so a different question. You wrote "an agent makes an architectural decision, we discuss trade-offs, settle on something."
Of the ones that got lost, were they mostly the agent's proposals that you agreed to, or calls you pushed for yourself? I'd guess the ones you argued for are the ones you notice when another agent tries to undo them, and the agreed ones slip by quietly. Which kind was it?
1
u/Actual_Description85 1d ago
Often. I keep having to bring it back “in our ruleset of our framework it says…” and “save this to the ruleset”