Context

Clearing

Also called: clear, reset

Clearing is deliberately wiping the context to start fresh. It is often the cleanest fix for a bloated or confused window.

James Phoenix
Understanding Data Updated July 2, 2026

Clearing is deliberately wiping the context window and starting from nothing. No history, no old files, no leftover conversation. You are back to a blank agent with only its system prompt. It sounds drastic, but it is often the single most effective thing you can do when a session has gone sideways.

When to reach for it

A window full of finished, unrelated work does not just waste space, it actively degrades the agent. Old tangents pull attention, stale file contents mislead, and a wrong turn from twenty messages ago keeps colouring the model's answers. Once a session is in that state, coaxing it back on track is usually slower than a reset. Clearing is the reset.

Good moments to clear:

  • You have finished one task and are starting an unrelated one. Do not make the new work compete with the old.
  • The agent is stuck in a loop or keeps repeating a mistake you have already corrected.
  • The window is bloated with output you no longer need.

Clearing versus compaction

Compaction tries to preserve the gist while freeing space. Clearing keeps nothing. That is the point: when the existing context is more hindrance than help, summarising it just carries the mess forward in compressed form. The cost is that you have to re-establish what you are doing, so clear when the context is genuinely spent, not mid-task.

Tip
Pair a clear with a crisp restatement. The best fresh session opens with a tight description of the task and pointers to the few files that matter, not the debris of the last one.

Related terms

Building with AI agents?

This dictionary is part of how I think about agentic engineering. If you want the same thinking applied to your codebase, that is what I do.

See how I can help