r/aipromptprogramming • • Oct 24 '26

How do you work with AI on large codebases without losing context all the time?

Hi, I need some help with my workflow, because right now it doesn't scale.

My situation: I work on several big projects at the same time, and they're large codebases spread across multiple repos. I'm a terminal guy, so CLI tools are where I feel at home. I also pay for Claude Code, Codex, Kiro and Antigravity (some are private, some for work).

The real problem: I keep losing context. Every time I come back to a project, or start a new session, the agent has forgotten everything, the architecture, the decisions we made, what's done and what's left. I spend a lot of time re-explaining things, and on big codebases the agent often loses track even within the same task. Switching between projects all day makes it even worse.

What I'm looking for:

  • A way of working How do you structure your work with AI on large codebases so context survives between sessions and projects?
  • One CLI harness to use every day
  • A way to use all my subscriptions from that one setup, and to switch model mid-task (e.g. when I hit a limit) without starting from scratch.

Some logic for which model handles which job, even if it's simple.

Questions:

  • How do you keep project memory? AGENTS.md, plan/decision files in the repo, docs, something else? What actually works long term?
  • How do you split big tasks so the agent doesn't get lost in a huge codebase?
  • How do you handle jumping between multiple projects in the same day?
  • What's your actual daily setup, the one you kept once the hype wore off?
  • Anyone running multiple subscriptions behind a single tool?

Thanks in advance

2 Upvotes

12 comments sorted by

•

u/endofthread-bot Oct 24 '26

Writing prompts that actually work is easier when you can compare notes with people who have tested them across real tasks. Trade techniques, get feedback on your approach, and see what is working for others in our Discord.

Self-promotion is now allowed on Sundays with the appropriate flair, for all regular contributing members. Contribute during the week, and promote on Sunday.

1

u/jackorjek Oct 24 '26

Orca IDE individual worktree and agent orchestration, graphify for context and pi for multiple subscriptions

1

u/just_damz Oct 27 '26

this is something i will try very soon.

1

u/onitsoga Oct 24 '26

keep a lightweight AGENTS md or decisions file in each repo as the system of record, and treat chat sessions as disposable. when you jump back into a project, the agent reads that file to catch up instead of you re-explaining everything. what's stopping you from just standardizing one doc per repo and pointing every tool at it?

1

u/Successful-Seesaw525 Oct 24 '26 edited Oct 24 '26

A use a product like glyphh ada to encode the source tree, or any kind of semantic repo, don’t use prompt stuffing it is horrible.

The LLM is stateless!! Every forward pass is as if it has no idea what the last pass, session, or the mile long history history is / was. Hence the promptvstuffing of md files. The context window had to fit your current request, with enough history, and enough head room to respond. Making an instruction you gave relevant is very very difficult. The LLMs have gotten much much better but no where near good enough.

The answer, well an answer, not “the” answer. Is to use ada re: and hdc lattice that can encode precedence and associate each request with whatu specifically instructed. That is then of course “prompt stuffed” into the LLM. The difference is you can start clean on every single turn, and “rover” every turn, if you want to level out quality, to another provider and model. The result is insanely good.

Happy to do a video on this, doesn’t need glyphh you can do it with Jev and other classifiers.glyphh is just a thousandth of the cost.

1

u/RealSharpNinja Oct 25 '26

Https://github.com/sharpninja/mcpserver

1

u/hcmzero Oct 26 '26

I use Taiga.ai to keep track of every project. Everything is a story under a particular epic. I star the day by asking Claude what are we doing today and it goes to Taiga a tells me. You can do the same with GitHub issues or Jira.

1

u/amulie Oct 26 '26

Light weight md files in each repo, specifically have a "handoff.md" that the last agent working on the code base uses to add context about what you did in that session. Treat chats as disposable. 

1

u/just_damz Oct 27 '26

Handoff is my practice, along with 3 agentic layers: agents, base and overlay.

i usually change overlays only cause the first is an index, the second has generic rules.

then, i have an handoff procedure to pass the “point” to fresh sessions. it includes authoritative documents references and then just the next steps. you could turn it in a small history if you like, but be careful :)

then memories: how it has to behave, especially on prose in anthropic frontier, where the ==true or false could easily become a 30 word description.

i ablate them frequently as i leave cc write them in the different projects, but the baseline is the same. This needs to be checked periodically as incoherence is part of it usually. working on an “memory-cleaning” skill.

1

u/torvalds75 Oct 27 '26

The thing that made it scale for me: stop trying to preserve the session and start preserving the decision record. The architecture and conventions go in AGENTS.md / CLAUDE.md (short, always true). What changes, meaning what was decided, what was rejected and why, and what’s next, goes somewhere outside the chat that every tool can read.

I keep it on GitHub Issues: one issue per open decision, worked one at a time (discuss, plan, implement, verify), with the outcome written back to the issue. Switching from Claude Code to Codex mid-task is then just “read issue #42 and continue”, because nothing lived in the chat. Same for jumping between projects: each repo’s open issues are its state.

For splitting big tasks: if a ticket can’t be planned in one session, split it into child tickets before touching code.

1

u/MaxRamas Oct 30 '26

RMS Memory MCP