Reliability · By Vrittara
What happens when an AI agent runs out of context?
An AI agent that runs out of context starts losing the earliest parts of the task: the original brief, the first sources it read, and the directions people gave before it went quiet. The fix is structure rather than a larger window, keeping a short brief, a written plan and the current state where the agent reads them at every step.
Published November 17, 2026 · 2 min read · Part of Reliability
What falls out first
Context fills from the front, and what goes is not random. The earliest material goes first, which is usually the brief and the first research, and the most recent tool output stays. The task then continues with a detailed view of where it is and no view of why.
That produces a characteristic failure: the agent keeps working correctly on the wrong goal. It is not confused about the step, it has lost the instruction that made the step matter.
Structure beats a bigger window
A larger window delays the problem and does not remove it. Long tasks generate more material than any window holds, and the parts that matter most are the oldest, so buying space only moves the cliff.
What helps is keeping the durable parts small and repeated: a brief of a few lines, the plan as a checklist, and a short state note that says where the work is. Those can be re-read at every step without competing with the step itself.
Write the state down
A state note is not a transcript. It is five lines: the goal, the steps done, the step in progress, the decisions made and anything waiting on a person. Written by the run and kept outside it, it survives whatever happens to the conversation.
This is also what makes a handoff possible. The next person or agent reads the note instead of reconstructing three days of history.
Design the handoff around it
If context loss is likely, plan for it rather than being surprised: finish a step, write the state, and start the next phase from that note. The handoff is then ordinary operation rather than an emergency.
Keep reading
- Running long AI agent tasks as a team
Long-running AI agents work on tasks for hours or days. What they need to survive failures, keep the team informed and let people catch up.
- How to run an AI agent on a task that takes days
A multi-day agent run needs a readable plan, checkpoints, one owner and a safe pause. How to keep the work understandable to anyone who joins late.
- How to hand off an AI agent session to a teammate
AI agent handoff means passing a running agent session to a teammate or another agent with a brief of where it stands. Here is what a good one needs.
- What context an AI agent needs, and what to leave out
Context changes the answer or it is noise. Give an AI agent the decision, the current source, your definitions and one good example, and leave the rest out.
Vrittara is the workspace a team and its AI agents share: one agent, a plan anyone can read, and a person who approves the result.
Common questions
- How can you tell an agent has lost context?
- It repeats work it already finished, asks for something the brief contained, or contradicts a decision made earlier in the run. Each is a symptom of the oldest material dropping out.
- Does a bigger context window solve this?
- It postpones it. Long tasks keep producing material, and the most important part, the original intent, is always the oldest and so the first to go.
- Should the whole history be summarised?
- Only the parts that still change a decision. A summary of completed work is useful, a summary of everything is a second, worse transcript competing for the same space.