CLAUDE LABJP
RELEASE — Claude Code v2.1.246 shipped on August 26, adding a startup warning for Bash allow rules that put a wildcard ahead of the subcommandPERMISSIONS — /permissions now has an Auto mode tab, so you can see in one place what runs automatically and where Claude still stops to askMEMORY — Unbounded memory growth in long interactive sessions is fixed: subagent tool results are released once they scroll out of the recent display windowMCP — In headless and remote sessions, a tool call interrupted by an incoming message is now reported as an explicit interrupted error instead of completing with no outputRUNNER — claude self-hosted-runner gains --proxy-authorization-command and --proxy-authorization-file for egress proxies that issue a fresh auth header on every connectionLIMITS — The 50% weekly limit increase runs through August 31 for Pro, Max, Team, and seat-billed Enterprise accounts, which leaves four daysRELEASE — Claude Code v2.1.246 shipped on August 26, adding a startup warning for Bash allow rules that put a wildcard ahead of the subcommandPERMISSIONS — /permissions now has an Auto mode tab, so you can see in one place what runs automatically and where Claude still stops to askMEMORY — Unbounded memory growth in long interactive sessions is fixed: subagent tool results are released once they scroll out of the recent display windowMCP — In headless and remote sessions, a tool call interrupted by an incoming message is now reported as an explicit interrupted error instead of completing with no outputRUNNER — claude self-hosted-runner gains --proxy-authorization-command and --proxy-authorization-file for egress proxies that issue a fresh auth header on every connectionLIMITS — The 50% weekly limit increase runs through August 31 for Pro, Max, Team, and seat-billed Enterprise accounts, which leaves four days
Articles/Claude Code
Claude Code/2026-08-28Intermediate

Don't let your verification script's full output flow back through a hook

The check was working the whole time. The conversation was what ran out of room. Measured side by side: one scan of 833 files returns 58 bytes, another returns 42KB. Here is how to put an output budget on your hooks.

Claude Code237hooks17automation106context design4quality gates

Premium Article

The check ran correctly to the very end. The conversation was the thing that broke.

I had added a hook that ran a static check after every edit. Working alone as an indie developer across several repositories, I have found that checks tied to the edit itself hold up far better than checks I have to remember to run. The check worked exactly as intended and caught the violations it was supposed to catch. But somewhere after a few dozen edits, responses got noticeably sluggish, and eventually long prompts stopped going through at all.

I spent a while staring at the check script looking for the problem. Wasteful loops. Slow regular expressions. But it was never about processing time. The strings the check was returning had been piling up inside the conversation, one edit at a time.

Hook timeouts are a separate topic, covered in what to look at when a hook dies with command timed out. This piece is about the other axis: not duration, but volume.

What lands in context is what you returned, not what you scanned

Here are numbers I measured on my own machine. Against the same repository (833 MDX files), I ran several checks with different personalities and recorded the bytes and lines each one wrote to standard output.

ProcessScope scannedOutput bytesLinesApprox. tokens
Frontmatter integrity check (pass)833 files58 B1~26
Verbatim-duplication scan (pass)833 files109 B1~50
Redirect integrity check (pass)whole repo126 B1~57
Single-file check (violations found)2 files893 B18~406
Enumerating grep833 files42,280 B398~19,218
Dumping the files themselves1 directory5,748,215 B~2.61M

Token figures are rough, based on roughly 2.2 bytes per token for mixed Japanese and English text. Your tokenizer will give different numbers.

The gap between the top three rows and the bottom two is the part worth sitting with. The same 833 files, scanned by both — one returns 58 bytes, the other 42,280. Roughly 728 times more. The size of what you scan does not determine the size of what you return. The only thing that determines it is what the author decided to print.

Until I built that table, I had been quietly assuming that heavier checks produce heavier output. The opposite tends to be true. A well-designed full-repository check returns one line when everything passes. A hastily written grep -rn prints every matching line it finds. The second one is far cheaper to run and three orders of magnitude more expensive to keep.

That last row, 5.7MB, is there as a ceiling. Return that and it will not fit in a million-token window, let alone a working conversation. "A hook whose output stalls the session" is not an abstract hazard — it is one misplaced cat away.

The best thing a passing check can say is almost nothing

Depending on the hook type, whatever your script returns can be carried into the next turn's context. That is the part that makes hooks different from ordinary shell work. In a terminal, a long dump scrolls past and is gone. Hook output does not scroll away. It stays, accumulates, and becomes the running cost of everything that comes after.

Which makes the design rule fairly blunt:

  • When the check passes, return the fact that it passed and nothing else
  • When it fails, return the smallest thing that lets someone fix it
  • Full logs, complete listings, and raw traces go to a file, not to the conversation

The top three rows of that table are exactly this shape. Inspect 833 files, print "clean," stop. Nothing about listing which files passed would change anyone's next move.

Failure is a different negotiation. That 893-byte, 18-line output contains the violated rule names and where they occurred. For something you are about to fix on the spot, that trade is fair.

Why "show everything, just in case" backfires

More information feels safer. For logs a human reads, that instinct is usually right.

But when the reader has a finite context window, the total volume of available evidence has a ceiling. Fill the ceiling and there is nowhere left for the information that actually matters later. Worse, most of what filled it was the names of files that turned out to be fine.

Information that does not change a decision becomes pure debt the moment you include it. That holds well beyond checks — it is a reasonable default for anything a hook hands back.

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
You will be able to estimate how many bytes a verification script sends back into the conversation before you wire it into a hook
You will know how to split success output from failure output, so a passing check stops quietly eating your context window
You will understand why a scan across 833 files can still return a single line, and be able to set an output budget for your own hooks
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 $15 for lifetime access
View Membership →

Related Articles

Claude Code2026-07-10
Carrying Decisions Across Compaction with PreCompact and SessionEnd Hooks
Auto-compaction does not delete your conversation. It deletes the reasons behind it. Here is a working PreCompact / SessionEnd / SessionStart hook pipeline that rescues decisions to disk and hands them to the next session, with real code and measurements.
Claude Code2026-07-01
My Claude Code Hooks Stopped Firing After an Update — the Hyphenated Matcher Exact-Match Change in v2.1.195
In Claude Code v2.1.195, hook matchers containing a hyphen switched from partial match to exact match, silently disabling an existing PreToolUse hook. Here is how I isolated the cause and how to write matchers that won't break.
Claude Code2026-06-18
Moving Cleanup and Logging into a SessionEnd Hook
How to use Claude Code's new post-session hook to automate temp-file cleanup and log writing after a session ends, with real examples from a pipeline that processes several repositories in sequence.
📚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 →