manage-tool-context changedagents-and-tools/tool-use/manage-tool-context
Nearest release: v2.1.319, 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+10added
Lines−10removed
From line
10
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits5to this page, all time
The whole hunk
from line 10, old and new numbered
/
from line 10
1010
1111Each approach targets a different source of context pressure. Pick the one that matches where your tokens are going.
1212
13| Approach | What it reduces | When it fits | Learn more |
14| ------------------------- | --------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
15| 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 run as a single script | [Programmatic tool calling](https://platform.claude.com/docs/en/agents-and-tools/tool-use/programmatic-tool-calling) |
17| 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) |
18| 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) |
13| Approach | What it reduces | When it fits | Learn more |
14| ------------------------- | --------------------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
15| Tool search | Tool definitions loaded upfront | Many tools (10+), most of which 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 run as a single script | [Programmatic tool calling](https://platform.claude.com/docs/en/agents-and-tools/tool-use/programmatic-tool-calling) |
17| Prompt caching | Token cost of repeated tool definitions | Stable tool definitions across many requests | [Tool use with prompt caching](https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-use-with-prompt-caching) |
18| 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
2020### Tool search
2121
22Tool search keeps tool definitions out of the context window until Claude asks for them. Instead of sending 50 tool schemas upfront, you send a single `tool_search` tool and let Claude discover the rest on demand. This trades a small amount of latency (one extra turn to look up a tool) for a large reduction in baseline context usage.
22Tool search keeps tool definitions out of the context window until Claude asks for them. Instead of loading 50 tool schemas into context upfront, you mark them with `defer_loading: true`, add a tool search tool, and let Claude discover them on demand. This trades a small amount of latency (one extra turn to look up a tool) for a large reduction in baseline context usage.
2323
2424### Programmatic tool calling
2525
from line 27
2727
2828### Prompt caching
2929
30Prompt caching doesn’t reduce the number of tokens in context, but it reduces what you pay for them on subsequent requests. If your tool definitions are stable, cache them once and reuse the cached prefix across thousands of requests. This is the right choice when the toolset is large but fixed.
30Prompt caching doesn’t reduce the number of tokens in context, but it reduces what you pay for them on subsequent requests. If your tool definitions are stable, cache them once and reuse the cached prefix across thousands of requests. This is the right choice when your list of tools is large but fixed.
3131
3232### Context editing
3333
from line 35
3535
3636## Combining approaches
3737
38These approaches compose. A long-running agent might use tool search to keep the toolset lean, prompt caching to amortize the cost of the remaining definitions, and context editing to trim stale results as the conversation grows. Each solves a different part of the problem, so there’s no conflict in using them together.
38You can use these approaches together, because each solves a different part of the problem. A long-running agent might use tool search to load fewer tool definitions, prompt caching to amortize the cost of the remaining definitions, and context editing to trim stale results as the conversation grows.
3939
4040A reasonable starting point for a high-volume agent:
4141
42421. 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.
432. Add tool search once your toolset grows past roughly 20 tools or your baseline context usage becomes noticeable.
432. Add tool search once you have 10 or more 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.
4646
No line in this hunk matches that.