Clear Context
To clear context is to wipe an AI agent's conversation history so the next request starts from an empty context window. The model keeps its system prompt, tools and project instructions, but forgets every message, file and tool result from the session before it.
What Clear Context Means
An LLM has no memory between requests. Every turn, the agent resends the whole conversation, and that conversation is all the model knows about what has happened. Clearing context throws that conversation away. The agent does not lose its configuration, but it no longer remembers the last task.
In Claude Code you clear context by typing /clear at the prompt. Other agents have their own command, often /clear or /new.
Clear vs. Compact
| Clear | Compact | |
|---|---|---|
| What it keeps | Nothing from the conversation | A short summary of it |
| When to use it | The next task is unrelated | The same task continues, but the history is long |
| Cost of the next turn | Lowest | Low |
| Risk | The agent loses details it still needed | The summary drops a detail |
Why Clear Context Between Tasks
- → Cost. Every token left in context is sent again, and paid for, on every turn of the next task.
- → Focus. Files and errors from the last task compete for the model's attention with the current one.
- → Predictability. A task that starts from a clean context behaves the same whether it runs first thing in the morning or after ten other tasks.
The trade-off is real: anything the agent learned that the next task needs has to live somewhere other than the conversation, such as a file, a project instructions file, or workspace memory.
Clear Context in AgentRQ
An always-on agent never restarts between tasks, so its context only grows. AgentRQ's clear context option sends /clear to the agent's terminal before it picks up a task, then waits a moment and hands the task over. Every task starts clean, and no one has to remember to type it. The blog post on clearing context before every task works through the token savings.
Related Terms
- → Context Window
- → Token
- → Task
- → Claude Code