← Back to context

Comment by CuriouslyC

3 days ago

Yup, this is the killer. Subagents SEEM good when you use them on greenfield projects, you can grind out a whole first pass without burning through much of your main context, it seems magical. But when you have a complex project that handoff is the kiss of death.

I'm wondering if in large projects, you want subagents to avoid having tasks flush out the main context?

If you're working with large source files, you might want to do each piece of work in an independent context with the information discarded afterwards?

Is the context a sliding window, or are there tiers of importance?

  • No the context going out of control is overblow. Lemme example why. First you need to work at feature level. It shouldn't be too large of a feature in one go.

    Let's say in my workflow, first agent must know where it needs to make changes? So it greps bunch of files and reads them. We do not need these read calls or grep calls to be part of history, the knowledge gained by doing these is what needs to be part of context

    Finally, we do some risk analysis and then just code it right away.

    No sliding window needed for this

    After this you reset context /reset and u start on new feature.

    • > No the context going out of control is overblow. Lemme example why. First you need to work at feature level. It shouldn't be too large of a feature in one go.

      As a meta point, why write ' Lemme example why.' ?

      If someone is still with you at this sentence, that person was ready to understand why.

      Otherwise, it delays (and thus endangers the visibility of) whatever your explanation was going to be.

So maybe the solution is to make all subproblems greenfield products?

By this I mean treat features as isolated plugins. I get that there are cross-cutting features that touch multiple pieces of functionality, and those probably need special treatment, but a large class of functionality can be developed in an isolated way with a common set of design tokens and APIs to tie them all together.

This might play better to coding agent strengths.

Full disclosure: this is very much an armchair view. I have all of 2 weeks of experience coding via agents (vs manually), but this thread is nerd sniping me into trying it myself.

  • I do try to do this, from an architectural standpoint it starts with modular monoliths to avoid coupling, then I try to decompose problems in a way that is very sandboxed so the blast radius of an agent going of the rails is contained.

    • So the things people hate Java for will make a big comeback then? Hexagonal architecture with domain driven design,a big fetish for inversion of control, so the LLM never needs to figure out how the system works, it just magically does. And errors have just the right amount of stack trace, this being 500++ lines

      1 reply →