My Coding Agent Remembered Sessions, Not Work
A coding agent can keep a thread alive and still feel forgetful.
I ran into this issue while building CliGate. I fixed session continuity, but repeated tasks were still too slow.
The agent remembered the conversation, but it did not remember the work.
Session continuity solves one problem. It helps with follow-up commands like:
- continue
- do the same for this file
- retry that
That is useful. But it does not help when you repeat a workflow days later.
An agent needs to recall what made the last run succeed. It needs to know:
- which button works
- which step is a dead end
- which field needs special handling
- which rule you always want applied
The first run is the most expensive. That is when the agent explores and finds details that are not in your prompt.
Before my fix, these details lived only in raw logs. The agent had history, but it had no reusable memory. It had to rediscover everything every time.
That is not intelligence. That is paying the same debugging cost twice.
The wrong approach is to save more history and hope the model uses it. That creates noise.
I built a smaller, reusable memory layer instead. I focused on:
- procedures
- facts
- directives
- references
I stopped trying to save everything that happened. I started saving what should be remembered.
Now, the assistant uses a file-based memory layer to recall:
- a procedure: the best steps and known dead ends
- a fact: a URL or a specific setting
- a directive: how you want things done
- a reference: where the documentation lives
This is how people work.
I do not want a perfect replay of the past because interfaces change and buttons move. I want the agent to:
- Recall the best known procedure
- Try it first
- Verify each step
- Fall back to exploration if it fails
- Update the memory after success
This turns brittle automation into useful operational memory.
I also separated standing rules from conversation history. Rules like "always reply in Chinese" or "do not touch production data" are not session context. They are operating rules.
Once I separated these, the assistant became predictable. It no longer has to rediscover your preferences in the middle of a task.
Repeat tasks are now shorter. The assistant moves faster because it does not start with an empty model every time.
Do not confuse a continuous thread with a system that learns.
A session keeps the conversation alive. Memory keeps the useful lessons alive.
If you build coding agents, ask yourself: Is your system remembering the thread, or is it remembering the successful procedure?
Source: https://dev.to/codekingai/my-coding-agent-remembered-sessions-not-work-that-was-the-bug-2fig
