Feature Request: Add tool response diffing/delta for MCP tools to reduce context window usage

Status Closed — not planned
Maintainer reply None cached
Activity 6 comments · opened Jun 16, 2026 · closed Sep 18, 2026

When Claude Code uses MCP tools like browser_snapshot or read, the full tool response is always included in the context. For browser automation especially, these responses can be very large (thousands of lines of YAML for the accessibility tree).

I built an MCP browser automation tool and found that implementing a 'delta mode' - where repeated calls return only what changed since the last call - reduced token consumption by about 65% in typical sessions.

The same principle could apply to other MCP tools used by Claude Code:

  • file reads: return only the portion that changed (for files being actively edited)
  • search results: return only new results
  • browser snapshots: return only DOM changes

A general pattern where MCP tool responses can optionally include only deltas would let Claude Code sustain much longer autonomous work sessions before hitting context limits.

Implementation could be:

  1. Add a --response-mode full|delta flag to claude code's MCP client configuration
  2. In delta mode, the client sends a context hash/token with each tool call
  3. The MCP server responds with only the diff when the hash matches a previous response
  4. This is transparent to the LLM - it just sees smaller responses

This would be especially valuable for browser automation tasks where context limits are the primary bottleneck.

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗