◉CLAUDE LABJP
●2.1.310 — Monitor tool now works on Bedrock, Vertex and Foundry, and gateway failures are fixed (10/23)●2.1.307 — Fixes MCP failing to reconnect after sleep or a keychain lock (10/21). 2.1.306 also fixed the false claude -p login message●SONNET 4.5 — Retires on the Claude API on 11/30, 35 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●API — In API version 2026-10-21, passing temperature, top_p or top_k returns a 400 error●NEW — I Put a Ten-Line Promise File at the To…●2.1.310 — Monitor tool now works on Bedrock, Vertex and Foundry, and gateway failures are fixed (10/23)●2.1.307 — Fixes MCP failing to reconnect after sleep or a keychain lock (10/21). 2.1.306 also fixed the false claude -p login message●SONNET 4.5 — Retires on the Claude API on 11/30, 35 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●API — In API version 2026-10-21, passing temperature, top_p or top_k returns a 400 error●NEW — I Put a Ten-Line Promise File at the To…
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-sdk4mcp20tool-use24context12operations31

✦ 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
✦The boundary counts characters while wc -c counts bytes: corrected survival rates (10.7% to 65.7%) and the 1.29x gap on multibyte output
✦The envelope defect that drops the conclusion line precisely when a log is error-heavy, with the measured 220-240 character threshold and a corrected implementation
✦Where an 822,582-character JSON payload breaks under a head cut, and an envelope that folds it to 0.69% while staying parseable
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-09-09
The agent I built in the Console could not be adopted by ant apply
ant apply refuses some drift and silently duplicates other resources. Here is where that line sits, why claude-lock.json belongs in your commits, and the five doors a second copy walks through.
⬡ API & SDK2026-09-03
Don't Hand Your Agent the Tool That Commits — Sorting Tools Into Advise, Prepare, and Commit
Before you wrap irreversible actions in an approval gate, decide which ones never belong in the tool list at all. A three-tier inventory, a rewritten tool definition, and a small script that flags commits hiding in your schema.
⬡ API & SDK2026-08-30
Read the Catalog Your CLI Already Ships Before Bulk-Replacing Model IDs
A newer generation makes older model IDs look stale. Here is how to pull the catalog embedded in your installed binary, sort every reference into matched, date-mismatched, and malformed, and stop the replacement that would break working IDs.