Fetching from the wire…
Top 5 · 2026-05-23 · source-backed
Context engineering just got its cookbook.
Anthropic's Claude Cookbook published a complete guide to three API-level primitives that, used together, reduced a research agent's peak context from 335K tokens to a sustained 50-80K range. Server-side compaction. Tool-result clearing. Persistent memory. Each one is simple. Together they change the economics of long-running agents.
Compaction triggers at a configurable token threshold (the cookbook uses 150K) and distills the conversation to a summary, preserving key decisions while dropping the narrative. Tool-result clearing replaces bulky tool outputs with [cleared] placeholders at zero inference cost, because tool results are almost always re-fetchable. Persistent memory stores cross-session state in files the model manages itself.
The diagnostic framework is the part I keep thinking about. If more than 80% of your context is re-fetchable tool output, use clearing first. If long dialogue accumulates, add compaction. If work spans sessions, add memory. That's not a recipe. It's a decision tree. And it works because it forces you to ask the right question: what in this context window is actually load-bearing?
I run a research agent pipeline every day in my personal projects. Context bloat is the single biggest reliability problem I hit. Agents get dumber as context fills up. They start ignoring earlier instructions. They lose track of what they've already done. The fix isn't a bigger context window. It's being surgical about what stays in it.
The cookbook also introduces the "Summarize up to here" option in Claude Code's Rewind menu. Manual mid-conversation compaction. Use it after completing a major milestone to reclaim token budget while preserving key decisions. Claude Code docs confirm this shipped recently.
For builders: implement tool clearing before anything else. If your agents call tools that return large JSON payloads, you're paying to re-read that data on every subsequent turn. Clear it after extraction. The cost savings compound with every interaction.
Each link below shares sources, entities, or timing with this story.
Go update. Then go read your sandbox.excludedCommands configuration, because it probably means something different than you thought it did. The bug: a single glob in sandbox.excludedCommands exempted an entire compound Bash command from the sandbox if any one segment matched....
Compaction trims what's already in the window (Anthropic productized a server-side compaction API on Opus 4.6 that auto-summarizes older turns mid-session). Agentic memory moves information entirely outside context as structured notes the agent writes and pulls back on demand....
Three separate Anthropic changes over about two weeks point the same direction, and none of them announced themselves as a strategy. Claude Code 2.1.238 added claude self-hosted-runner --defer-shutdown-max-min, which keeps serving attached sessions on SIGTERM, parks whatever's...
Fable 5.1 came out this week and two people independently measured what it costs. They disagree by a factor of about four, and both are right. A MineBench run of 15 identical Minecraft builds put Fable 5.1 at $147.55 total against Fable 5's $54.93. Average inference time went...
Anthropic released Claude Fable 5.1 on September 1. Claude Code v2.1.257 made it the default Fable model at 17:53 UTC that day, with a 1M-token context window, $10 per million input tokens, $50 per million output, and $0.25 per million on cache reads (claude-code CHANGELOG). B...
August 6: Sapiom raised $35M for a router that sends each model call to the cheapest capable model. August 7: Databricks published its internal cost playbook. August 8: Toolport hit Product Hunt with a free MCP gateway cutting tool-definition overhead 96%. Three parties, zero...
MindPattern daily
One email a day at 7 AM. Sources and a take on every story. Unsubscribe anytime.