CLAUDE LABJP
TOOLSWAP — Mid-conversation tool changes are in beta: add or remove tools between turns while keeping the prompt cache intact, on Fable 5, Mythos 5, Opus 4.8, and Opus 5FALLBACK — The fallbacks parameter gained a default mode that applies Anthropic's recommended fallback models per refusal category, with server-side fallback also in betaADDDIR — A new DirectoryAdded hook fires right after /add-dir or the SDK register_repo_root request registers a working directory mid-sessionMCPERR — Entries skipped by --mcp-config validation now surface as mcp_server_errors in the headless stream-json init event, and terminal runs print a startup warningFANOUT — Concurrently running subagents are now capped at 20 by default, and hitting --max-budget-usd denies new spawns while halting the background agents already runningOPUS5 — Claude Opus 5 ships with a 1M-token context window, 128K max output, thinking on by default, and the same pricing as Opus 4.8TOOLSWAP — Mid-conversation tool changes are in beta: add or remove tools between turns while keeping the prompt cache intact, on Fable 5, Mythos 5, Opus 4.8, and Opus 5FALLBACK — The fallbacks parameter gained a default mode that applies Anthropic's recommended fallback models per refusal category, with server-side fallback also in betaADDDIR — A new DirectoryAdded hook fires right after /add-dir or the SDK register_repo_root request registers a working directory mid-sessionMCPERR — Entries skipped by --mcp-config validation now surface as mcp_server_errors in the headless stream-json init event, and terminal runs print a startup warningFANOUT — Concurrently running subagents are now capped at 20 by default, and hitting --max-budget-usd denies new spawns while halting the background agents already runningOPUS5 — Claude Opus 5 ships with a 1M-token context window, 128K max output, thinking on by default, and the same pricing as Opus 4.8
Articles/API & SDK
API & SDK/2026-07-28Advanced

The Line That Disappears at 100K: Measuring What Tool-Output Spill Actually Keeps

When agent tool output passes 100,000 characters, the full text spills to a file and the model sees only a head-truncated preview. Here are measured survival rates from a real repository, and the output envelope I built to push decision-relevant lines to the front.

agent-sdk4mcp19tool-use23context9operations17

Premium Article

I asked an agent a plain question about my own content repository: which MDX file here is the largest?

The answer it gave was wrong.

Checking by hand with find and wc -c, the real answer is a 53,595-byte article. The agent named something noticeably smaller. The tool call itself had succeeded. No error, no warning, no retry.

It took me a while to find the cause. The tool output had crossed the 100,000-character boundary.

What happens past 100,000 characters

In Managed Agents, output from agent_toolset and MCP tools that exceeds 100,000 characters — roughly 25K tokens — is automatically written to a file inside the sandbox. What reaches the model is a truncated preview plus the path to that file. The full content can be read back on demand.

This is a much better failure mode than blowing out the context window mid-task. Jobs that handle build logs or bulk exports now run without me thinking about size at all.

What the spec does not tell you is which part gets truncated. I misunderstood the situation until I pushed real output across the boundary and measured what survived.

Measuring which commands cross the line

The subject is a real content repository holding 791 Japanese and 791 English MDX articles. I ran the commands I hand to agents every day and counted bytes.

CommandOutput bytesvs 100KLines
grep -rn 'claude' content/articles/ja --include='*.mdx'1,201,15412.01x5,595
cat src/data/articles.json822,5828.23x
find content -name '*.mdx' -exec wc -c {} +149,8381.50x1,654
ls -R content87,1350.87x

Three of four are already over. None of these is a reckless command. They are the first things anyone teaches an agent to do: list the files, search across them.

Once a repository grows, ordinary operations cross the boundary on their own.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Measured output sizes for 4 everyday commands, with head-100K line survival rates from 8.3% to 66.8%
The exact position where an 822,582-byte JSON payload breaks under a character cut, and an envelope that stays parseable
A working outbox script that folds 149,838 bytes into 17,182 (11.5%) while preserving the total line
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

API & SDK2026-05-20
Compressing Tool Results in Claude Agents — Aggregating Large Responses Without Bloating Context
When a database returns 8,000 rows, a scrape returns 200KB of HTML, or a file read returns several megabytes, dropping the raw payload into your Claude tool result wrecks both cost and quality. This guide presents a three-layer compression architecture — schema projection, summarization, and reference handles — with TypeScript examples from a production agent pipeline.
API & SDK2026-07-11
Tightening Tool Schemas From the Arguments You See in Production
Record the arguments Claude actually passes to your tools in production, then use that distribution to add enums and patterns back into your JSON Schema. With logging code and before/after numbers.
API & SDK2026-07-09
Same Output, Different Path — Guarding Agent Trajectories with Invariants
When the default model changes, your final output can stay correct while the path your agent takes quietly shifts. Here is a trajectory regression harness built on recorded tool traces and deterministic invariants, with working code and measured numbers.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →