DictionaryMemory Strategies
Context Editing
Automatic rules that tidy up old clutter in a conversation before the AI reads it, with no extra AI involved.
Definition
An API-level context management feature that clears old content by rule before the request reaches the model; no secondary model reviews the conversation. clear_tool_uses_20250919 removes old tool results once input passes a trigger (default 100K tokens), keeps the most recent 3 tool uses by default, and supports clear_at_least, exclude_tools, and clear_tool_inputs; clear_thinking_20251015 removes earlier thinking blocks. Both use the beta header context-management-2025-06-27.
Example
Add clear_tool_uses_20250919 to context_management.edits; once input passes 100K tokens, older tool results are cleared and the 3 most recent stay.