manage-tool-context changedagents-and-tools/tool-use/manage-tool-context
Nearest release: v2.1.307, published an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+5added
Lines−5removed
From line
1
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits2to this page, all time
The whole hunk
from line 1, old and new numbered
/
from line 1
11---
22title: Manage tool context
33url: https://platform.claude.com/docs/en/agents-and-tools/tool-use/manage-tool-context
4description: Choose between tool search, programmatic tool calling, prompt caching, and context editing to manage context bloat.
4description: Choose among tool search, programmatic tool calling, prompt caching, and context editing to manage context bloat.
55---
66
7Tool definitions and accumulated `tool_result` blocks consume your context window. Long-running agents with many tools or many turns can exhaust available context before the task is finished. Four approaches address this at different points in the pipeline.
7Tool definitions and accumulated `tool_result` blocks consume your context window. Long-running agents with many tools or many turns can exhaust available context before the task is complete. Four approaches address this at different points in the pipeline.
88
99## The four approaches
1010
from line 13
1313| Approach | What it reduces | When it fits | Learn more |
1414| ------------------------- | --------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
1515| Tool search | Tool definitions loaded upfront | Large toolsets (20+ tools) where most tools aren't needed every turn | [Tool search tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool) |
16| Programmatic tool calling | `tool_result` roundtrips | Chains of tool calls that can execute as a single script | [Programmatic tool calling](https://platform.claude.com/docs/en/agents-and-tools/tool-use/programmatic-tool-calling) |
16| Programmatic tool calling | `tool_result` roundtrips | Chains of tool calls that can run as a single script | [Programmatic tool calling](https://platform.claude.com/docs/en/agents-and-tools/tool-use/programmatic-tool-calling) |
1717| Prompt caching | Token cost of repeated tool definitions | Stable toolsets across many requests | [Tool use with prompt caching](https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-use-with-prompt-caching) |
1818| Context editing | Old `tool_result` blocks in history | Long conversations where early results are no longer relevant | [Context editing](https://platform.claude.com/docs/en/build-with-claude/context-editing) |
1919
from line 31
3131
3232### Context editing
3333
34Context editing removes old `tool_result` blocks from the conversation history once they've served their purpose. A long agent loop might produce hundreds of intermediate results that were useful at the time but are now dead weight. Context editing lets you trim them without restarting the conversation.
34Context editing removes old `tool_result` blocks from the conversation history once they've served their purpose. A long agent loop might produce hundreds of intermediate results that were useful at the time but are no longer needed. Context editing lets you trim them without restarting the conversation.
3535
3636## Combining approaches
3737
from line 39
3939
4040A reasonable starting point for a high-volume agent:
4141
421. Enable prompt caching on your tool definitions from day one. Cache writes carry a 25% markup over base input pricing, which pays back on the second request that hits the cache.
421. Enable prompt caching on your tool definitions from the start. Cache writes carry a 25 percent markup over base input pricing, which pays back on the second request that hits the cache.
43432. Add tool search once your toolset grows past roughly 20 tools or your baseline context usage becomes noticeable.
44443. Add context editing once individual conversations start running long enough that early results become irrelevant.
45454. Consider programmatic tool calling if you notice repetitive chains of small tool calls that could run as a single batch.
No line in this hunk matches that.