Anthropic shows agents cutting tool context from 150K to 2K tokens by writing code
blaizedsouza · x · 2026-11-22
Anthropic demonstrated how to make AI agents dramatically more efficient without changing the model: stop making the agent read every tool definition upfront and let it write code to use tools instead. Same tools, same task — context dropped from 150,000 tokens to 2,000.
Key techniques:
- Tools become files: convert MCP tools into TypeScript files the agent opens on demand
- Load on demand: keep context lean, loading tool definitions only when required
- Filter with code: instead of dumping 10,000 rows into context, filter in the sandbox and return only the relevant results
Related event: Anthropic's Code Mode Cuts Agent Tool Context from 150K to 2K Tokens(2 posts)→
More from coding & agent
- AnyS1: a 4B System-1 model cuts agent workflow costs by 75–91% without losing accuracy — kalyan_kpl · 2026-11-22
- Anthropic doc: one 'you own this codebase' line lifts Claude's code consolidation from 10% to 75% — lxfater · 2026-11-22
- voxCAT shares a halftone-poster prompt template that fits two action beats of a character in one image — Promptmethus · 2026-11-22
- Late-2026 agent checklist: A2A payments, 50-branch inference, self-building RAG — blaizedsouza · 2026-11-22
- Tip: convert Grok MCP routines to script-first jobs to stop wasting tokens — intellectronica · 2026-11-22
- Lovable x Paper MCP workflow: explore designs visually, then ship components — damienghader · 2026-11-22