DEV Community

Cover image for Should AI coding agents remember decisions, or just code?
Suraj Suradkar
Suraj Suradkar

Posted on

Should AI coding agents remember decisions, or just code?

I've been thinking about this while working with AI coding agents.

Most agent workflows are pretty good at remembering the current state of the codebase.

But that's not necessarily the same thing as remembering the context behind the code.

Imagine an agent encounters a problem and considers three approaches:

Approach A was rejected because it would create a performance problem.
Approach B was rejected because it conflicted with an existing architectural constraint.
Approach C was implemented and passed the tests.

A few weeks later, another agent sees the code and asks:

"Why don't we just use Approach A?"

If the only thing it can see is the final code, it may make the exact same mistake again.

So I'm wondering what an AI coding agent should actually retain after completing a task.

Should it remember:

  1. What changed
  2. Why it changed
  3. What alternatives were rejected
  4. What evidence supported the decision
  5. Which assumptions the decision depended on
  6. Who made the final call

And there's an uncomfortable second question:

If we keep everything, don't we eventually create another context-window problem?

Maybe the hard problem isn't giving agents more memory.

Maybe it's deciding what deserves to become durable knowledge, what should expire, and what should be retrieved when a future decision actually depends on it.

I'm curious how other people are handling this.

What information from an AI-assisted coding session do you actually want the next agent—or the next developer—to remember?

And what would you deliberately not preserve?

Top comments (0)