As the context grows you must decide what MUST always stay in the window.
- AEvery raw tool output, verbatim, forever.
- BThe system prompt and the current goal/state - summarising or dropping the rest.
- COnly the latest user message and the last tool result - everything older has already been acted on and can go.
- DThe full chat history, always, with no compression.
Answer: B
The system prompt and the current goal/state - summarising or dropping the rest.
Why
The system prompt (who the agent is + rules) and the live task state/goal are load-bearing and must persist; raw logs and old turns can be summarised. Keeping only the last message loses the goal; keeping everything just overflows.
- ContextThe agent might need facts from a 200-page manual to answer some questions.
- ContextYou enabled prompt caching, the system prompt is huge and identical every time - and the savings are zero.
- ContextInstructions placed in the middle of a very long prompt are followed far less often than the same words at the start or end.
- ContextYour agent resends a long system prompt on every step, yet DeepSeek’s usage shows almost no cache hits.
More on Way of the Agent
- Course programThe first three modules are free: start in the browser or the app, no card needed.
- Library: guides, skills and promptsReady prompt templates, grouped into collections.
- AI ChroniclesSourced stories from the history of AI.
- ConceptsPlain-language explainers of agent engineering.
- Learn AI agentsApps and courses for learning AI agents, compared honestly.
Real situations from building agents - with the answer and why.
Solve a new one every day on the Path