# Progressive Disclosure in Claude Code

Source: https://www.youtube.com/watch?v=DQHFow2NoQc
Recap page: https://rapidrecap.app/video/DQHFow2NoQc
Generated: 2026-01-12T15:05:25.036+00:00

---
## Quick Overview

The industry trend, confirmed by Cloudflare, Anthropic, and Cursor, is moving away from loading all Model Context Protocol (MCP) tool definitions upfront and towards progressive disclosure, where tools are loaded on-demand as files, resulting in massive context reduction and enabling agents to tackle much larger, more complex tasks.

**Key Points:**
- Cloudflare's 'Code Mode' achieved an 81% token saving by generating TypeScript code that runs in an isolated sandbox instead of JSON tool calls.
- Anthropic confirmed this pattern with three new features: Tool Search Tool (85% context reduction), Programmatic Tool Calling, and Memory Tool (file-based storage).
- Cursor's 'Dynamic Discovery' achieved a 46.9% reduction in context usage by dynamically loading only the necessary tools.
- The core insight is that agents need a filesystem and bash, allowing tools to be treated as files loaded on-demand, which keeps context small.
- The combination of MCP + Filesystem + Code Execution is presented as the definitive answer for effective AI agent tool use.
- Anthropic's new automatic clearing feature reduces token usage by 84% in 100-turn evaluations by dropping stale tool results.

![Screenshot at 1:25: The slide summarizing Cloudflare's 'Code Mode' breakthrough, which involves generating TypeScript code that runs in a sandbox instead of standard JSON tool calls, resulting in a 98.7% reduction in token usage \(from 150k to 2k tokens\).](https://ss.rapidrecap.app/screens/DQHFow2NoQc/00-01-25.jpg)

**Context:** This video discusses a significant shift in how AI agents manage the tools they use, moving away from loading all tool definitions (Model Context Protocol or MCP) directly into the prompt context. This initial approach led to context bloat, limiting the complexity of tasks agents could handle. The presentation traces this evolution from Cloudflare's initial work to Anthropic and Cursor implementing similar optimization strategies, all converging on the idea of progressive disclosure and treating tools as files managed via a filesystem.

## Detailed Analysis

The video argues that the industry is converging on a new pattern for AI agent tool use: progressive disclosure where tools are loaded on-demand as files, rather than loading all MCP tool schemas upfront into the context window. Cloudflare started this trend with 'Code Mode' (Sept 2025), which generated TypeScript code to run in an isolated sandbox, achieving an 81% token saving. Anthropic followed (Dec 2025) with its Tool Search Tool, achieving an 85% context reduction by searching tools on-demand. Cursor also implemented Dynamic Discovery (Jan 2026) with a 46.9% reduction. The key components agents need are a Filesystem (for reading/writing/searching files), Bash (for executing commands/scripts), and Code Execution (calling MCP via generated code). This mindset shifts tool management to files, discovery to search, and execution to code, keeping context small. Anthropic also introduced automatic context clearing for old tool results, leading to an 84% token reduction in 100-turn evaluations. The overall conclusion is that 'Context is no longer the bottleneck,' allowing agents to tackle multi-hour tasks, integrate 100+ tools, and run complex workflows overnight because the context window is no longer constrained by hundreds of thousands of context tokens used by unused tool definitions.

### Historical Context

- Cloudflare discovered it (Sept 2025, 81% token savings)
- Anthropic confirmed it (Dec 2025, 85% context reduction)
- Cursor shipped it (Jan 2026, 46.9% reduction)
- Everyone converging now on Filesystem First

### The MCP Context Problem

- MCP tools burn tokens just by existing; 55k tokens burned for 5 servers/58 tools in one test, 134k with many tools in Anthropic's testing, meaning 50% of context window is gone before work starts
- Every tool schema sits in context, whether used or not

### The Core Insight

- Filesystem First
- Old Way (Context-Heavy): Load all tool schemas upfront, burn tokens immediately, less room for actual work, frequent context resets
- New Way (Filesystem-First): Store tools as files, discover on-demand, load only what's needed, massive token savings

### Cloudflare

- Code Mode Breakthrough: Instead of generating JSON tool calls, generate TypeScript code that runs in a sandbox
- MCP servers become TypeScript APIs, code executes in an isolated sandbox, only access via RPC to MCP servers
- Resulted in 98.7% reduction in token usage (150k -> 2k tokens)

### Anthropic

- Advanced Tool Use: Tool Search Tool (85% context reduction, 191k -> 122k tokens preserved)
- Programmatic Tool Calling (invoke tools in code execution environment)
- Memory Tool (File-based storage using simple Markdown files, no vector DB needed, CLAUDE.md persistence)

### Agent Skills

- Progressive Disclosure: Design Principle: Skills are folders of instructions, agents load them only as needed
- How it Works: Agent sees skill names in static context, task requires 'web research', agent searches/reads skill folder, loads only what's needed
- Scales to 100+ skills without context bloat

### The New Consensus

- Filesystem + Bash + Sandbox
- Tools become files, Discovery becomes search, Execution becomes code, Context stays small
- MCP isn't dead. It just learned to stay out of context.

![Screenshot at 0:04: Title slide introducing the topic: Claude Code and Progressive Disclosure.](https://ss.rapidrecap.app/screens/DQHFow2NoQc/00-00-04.jpg)
![Screenshot at 0:39: A web browser view of the Cloudflare blog post titled 'Code Mode: the better way to use MCP'.](https://ss.rapidrecap.app/screens/DQHFow2NoQc/00-00-39.jpg)
![Screenshot at 4:23: Slide detailing the shift from 'Old Way: Context-Heavy' to 'New Way: Filesystem-First' by asking 'What if tools lived in the filesystem instead of context?'](https://ss.rapidrecap.app/screens/DQHFow2NoQc/00-04-23.jpg)
![Screenshot at 7:19: Slide detailing how to enable Claude Code via an experimental CLI flag, showing token savings of 31.7k burned tokens without the flag vs. 0 for MCP with the flag.](https://ss.rapidrecap.app/screens/DQHFow2NoQc/00-07-19.jpg)
![Screenshot at 10:31: Slide outlining 'The Pattern' agents actually need: 1. Filesystem, 2. Bash, 3. Code Execution, leading to the mindset: 'Give the agent a filesystem and get out of the way.'](https://ss.rapidrecap.app/screens/DQHFow2NoQc/00-10-31.jpg)
