Configuration options for tool result clearing
| Configuration option | Default | Description |
|---|---|---|
trigger | 100,000 input tokens | Defines when the context editing strategy activates. Once the prompt exceeds this threshold, clearing begins. You can specify this value in either input_tokens or tool_uses. |
keep | 3 tool uses | Defines how many recent tool use/result pairs to keep after clearing occurs. The API removes the oldest tool interactions first, preserving the most recent ones. |
clear_at_least | None | Ensures a minimum number of tokens is cleared each time the strategy activates. If the API can't clear at least the specified amount, the strategy will not be applied. This helps determine if context clearing is worth breaking your prompt cache. |
exclude_tools | None | List of tool names whose tool uses and results should never be cleared. Useful for preserving important context. |
clear_tool_inputs | false | Controls whether the tool call parameters are cleared along with the tool results. By default, only the tool results are cleared while keeping Claude's original tool calls visible. |