CLAUDE LABJP
TEACHERS — Anthropic launches Claude for Teachers, giving verified US K-12 educators free premium access, teaching skills, and curriculum links aligned to standards in all 50 statesADMIN — The Admin API is now in beta for every Claude Enterprise organization: member and invite calls need no beta header, while group and custom-role calls doM365 — The Microsoft 365 connector gains write tools — draft, send, and organize email, manage calendar events and mailbox settings, and create or update files in OneDrive and SharePointMCP — Fixed servers from --mcp-config or .mcp.json ignoring a per-server request_timeout_ms, which left long-running tool calls timing out at the 60s default in fresh sessionsSUBAGENT — A new --forward-subagent-text flag and CLAUDE_CODE_FORWARD_SUBAGENT_TEXT variable include subagent text and thinking in stream-json outputDEADLINE — Opus 4.7 fast mode is removed on July 24, seven days out. speed: "fast" will error, so confirm your move to Opus 4.8TEACHERS — Anthropic launches Claude for Teachers, giving verified US K-12 educators free premium access, teaching skills, and curriculum links aligned to standards in all 50 statesADMIN — The Admin API is now in beta for every Claude Enterprise organization: member and invite calls need no beta header, while group and custom-role calls doM365 — The Microsoft 365 connector gains write tools — draft, send, and organize email, manage calendar events and mailbox settings, and create or update files in OneDrive and SharePointMCP — Fixed servers from --mcp-config or .mcp.json ignoring a per-server request_timeout_ms, which left long-running tool calls timing out at the 60s default in fresh sessionsSUBAGENT — A new --forward-subagent-text flag and CLAUDE_CODE_FORWARD_SUBAGENT_TEXT variable include subagent text and thinking in stream-json outputDEADLINE — Opus 4.7 fast mode is removed on July 24, seven days out. speed: "fast" will error, so confirm your move to Opus 4.8
Articles/Claude Code
Claude Code/2026-07-17Advanced

My Nightly Subagents Ran, and I Couldn't Retrace Them — Trimming the Logs That --forward-subagent-text Unleashed

Subagent text and thinking can now flow into stream-json output, and unattended log volume climbs sharply with it. Here are measured numbers, a three-tier retention filter that keeps only what postmortems need, and a correlation ID design that survives missing fields.

Claude Code194Subagents7stream-jsonLog Design2Automation37

Premium Article

I opened the log from a failed nightly task and stopped short.

The parent session recorded two useful things: that it had launched four subagents, and that one of them never returned a result. What those four read, where they changed course, and why exactly one went quiet — none of it was there.

When a job runs unattended, the log is all you get. And mine was missing the part that mattered.

The July 17 update added the --forward-subagent-text flag (or CLAUDE_CODE_FORWARD_SUBAGENT_TEXT as an environment variable), which pushes subagent text and thinking into stream-json output. Exactly what I'd wanted.

Then I turned it on, ran one night, and hit a different wall the next morning. The logs were no longer a size a person reads.

What actually starts flowing

First I measured what the flag changes.

# Before: parent events only
claude -p "Validate article metadata across four categories" \
  --output-format stream-json > baseline.jsonl
 
# From July 17: subagent text and thinking included
claude -p "Validate article metadata across four categories" \
  --output-format stream-json \
  --forward-subagent-text > forwarded.jsonl

Output is JSON Lines, one event per line, so counting by type is straightforward.

# Break down the event types
jq -r '.type' forwarded.jsonl | sort | uniq -c | sort -rn

I ran the same prompt ten times each and took the medians. Four subagents plus one parent, on Sonnet 5.

MetricNo flag--forward-subagent-textRatio
Lines (events)2184,93022.6×
File size0.9 MB38.4 MB42.7×
From thinking blocks0 MB24.1 MB
From assistant text0.4 MB11.8 MB29.5×
90-day total (3 runs/day)0.24 GB10.4 GB43.3×

The 42× headline mattered less to me than the breakdown. 63% of the growth is thinking. And thinking is enormously useful for diagnosing a failure, while a successful run's thinking is never opened at all.

So most of the new volume has an awkward shape: rarely read, indispensable when you need it. Dropping all of it is wrong. Keeping all of it is also wrong.

Three tiers, three fates

I settled on sorting every event into one of three tiers.

TierContentsRetentionPolicy
SkeletonParent/child start and stop, tool names, result statusForeverNever trimmed. Enough to reconstruct the shape of a run
BodyAssistant text, summarized tool input30 daysKeep head and tail, record the middle as a character count
ThinkingThinking blocks7 days / forever on failureDiscard for successful runs, keep for failed ones

"Keep only on failure" can't be decided while writing. You don't know a run failed until you reach the end of it.

So the filter writes everything first, then decides once the exit status is known. Deferring the judgment costs a little disk churn and buys correctness.

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 growth per run with --forward-subagent-text enabled, broken down by event type
A three-tier filter separating keep-everything, summarize, and discard (runnable Node.js)
Correlation ID design for matching parent sessions to child agents, including what to do when the field arrives null
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

Claude Code2026-06-14
A SubagentStop Hook That Grades Subagent Output and Sends It Back to Be Redone
When a Claude Code subagent occasionally returns rule-breaking work, a SubagentStop hook can grade it automatically and ask for a redo. Here is a working setup with code and field notes.
Claude Code2026-05-23
Skill, Subagents, and Rules in Claude Code: A One-Hour Implementation Loop That Fits a Solo Operator
Misaki Ito at SonicGarden wrote about wiring Claude Code's Skill, Subagents, and Rules to close a week's worth of low-priority work in one meeting. Here is how I adapted that pattern as a solo developer running a 50M-download app business.
Claude Code2026-07-16
Switching Claude Code to Plain-Text Rendering — Three Ways In, and What Your Logs Actually Weigh
I opened last night's Claude Code log and found the same spinner line stacked dozens of times. Here are the three ways to turn on screen reader mode, a short script that measures what escape sequences and redraws really cost you, and what you give up when the rendering goes plain.
📚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 →