Support dynamic filtering for web search/fetch in Claude Code
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Dynamic filtering — the feature that uses code execution to post-process web search and fetch
results before they enter the context window — is currently available on the Claude API but not in
Claude Code.
This seems like a natural fit for Claude Code, especially on the Max subscription tier where long
coding sessions routinely hit context limits and trigger compression. Web searches and page
fetches can load substantial amounts of irrelevant content into the window, accelerating context
exhaustion.
The API implementation reports an 11% accuracy improvement and 24% fewer input tokens consumed.
Those token savings would translate directly into longer, more productive Claude Code sessions
before compression kicks in.
Is there a technical reason this hasn't been brought to Claude Code, or is it on the roadmap?
Proposed Solution
Dynamic filtering should work transparently — no user-facing commands or settings needed. When Claude Code makes a web search or web fetch call, the underlying API should apply dynamic filtering automatically (as it already does for direct API users). The results that enter the context window would already be filtered for relevance, reducing token consumption without any change to the user experience.
Alternative Solutions
Currently the only workaround is manually managing context — using /compact more frequently, being selective about when to trigger web searches, or switching to the API directly for research-heavy tasks. None of these are ideal. The filtering logic already exists on the API side; it just needs to be wired through to Claude Code sessions.
Priority
Critical - Blocking my work
Feature Category
CLI commands and flags
Use Case Example
_No response_
Additional Context
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗