15One agent

Tool result clearing

Replace old tool results in the history with a short placeholder once the agent has used them.

Also called Observation masking

Yang et al., Lindenbauer et al., Manus, LangChain, Anthropic

once usedleavesContextTool resultsCodeTool resultclearingContextPlaceholder
How to read this

The problem

Old tool results, such as file contents or search results, keep filling the context after the agent has used them.

Older tool results (such as file contents or search results) are no longer needed once Claude has processed them.
AnthropicContext editing
Observations can be huge, especially when agents interact with unstructured data like web pages or PDFs.
ManusContext Engineering for AI Agents: Lessons from Building Manus

Therefore

the structure and order of the agent’s interaction history is preserved, but the content of old observations are replaced with a one-line placeholder.
Yang et al.SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering
A natural baseline approach directly targets verbose environment observations through observation masking strategies that explicitly omit tool outputs.
Lindenbauer et al.The Complexity Trap: Simple Observation Masking Is as Efficient as LLM Summarization for Agent Context Management

In use

LangChain Deep Agents

As the session context crosses 85% of the model’s available window, Deep Agents will truncate older tool calls, replacing them with a pointer to the file on disk and reducing the size of the active context.
LangChainContext Management for Deep AgentsJan 28, 2026

Manus

the content of a web page can be dropped from the context as long as the URL is preserved, and a document's contents can be omitted if its path remains available in the sandbox. This allows Manus to shrink context length without permanently losing information.
ManusContext Engineering for AI Agents: Lessons from Building Manus

Where it breaks

Clearing breaks the prompt cache, and a fixed rule ignores which results the agent still needs.

Tool result clearing: Invalidates cached prompt prefixes when content is cleared.
AnthropicContext editing
Observation Masking employs a fixed-size rolling window that is agnostic to the relevance or staleness of past observations (e.g., retaining a file’s content after it was modified).
Lindenbauer et al.The Complexity Trap: Simple Observation Masking Is as Efficient as LLM Summarization for Agent Context Management
From a logical standpoint, any irreversible compression carries risk.
ManusContext Engineering for AI Agents: Lessons from Building Manus

Sources

  1. SWE-agent: Agent-Computer Interfaces Enable Automated Software EngineeringYang et al.
  2. The Complexity Trap: Simple Observation Masking Is as Efficient as LLM Summarization for Agent Context ManagementLindenbauer et al.
  3. Context Engineering for AI Agents: Lessons from Building ManusYichao 'Peak' Ji, Manus
  4. Context Management for Deep AgentsLangChain, Jan 28, 2026
  5. Context editingAnthropic

Added Nov 14, 2026