Skip to main content
Blue Moose logo Blue Moose Field notes
← All articles
claude code

Claude Code 2.1.333: hook loops capped at 8

Developers collaborating at a laptop

Most Claude Code changelogs are a pile of freeze fixes, and v2.1.333 (released 30 November) has plenty of those. But three items in it touch things I actually rely on: a hook that could wake the agent forever, piped output that could get truncated, and a new way to steer /code-review. I read the release notes end to end; here is what matters for an unattended setup.

The asyncRewake loop now has a ceiling

The release notes say: an asyncRewake hook that keeps exiting quickly with code 2 no longer wakes Claude in an endless loop. Wakes now stop after 8 in a row, and CLAUDE_CODE_STOP_HOOK_BLOCK_CAP changes that number.

I haven't hit this exact failure, but the shape is familiar: a background check fails fast, wakes the agent, the agent does nothing useful, the check fails again. Every turn costs tokens. A hard cap turns that into a bounded problem. If your hook legitimately needs more than eight consecutive wakes, raise the variable deliberately rather than leaving it to chance:

export CLAUDE_CODE_STOP_HOOK_BLOCK_CAP=12

The notes don't say what value it takes beyond "changes it", so I'd treat a plain integer as the expectation and watch what happens.

Piped output no longer vanishes when the reader lags

Under the claude -p section: on macOS and Linux, the end of a successful run's piped output could be lost when the reader lagged. It now waits up to 30 seconds and warns if any output is unread. If you pipe claude -p into a slow consumer such as a log shipper or a script that parses as it goes, this is the fix to know about. A truncated tail is the nastiest kind of bug because the exit code still says success.

Related: the first prompt, subagents and -p used to wait up to 10 minutes when git status was very slow or stalled. Claude now continues after 30 seconds. On a huge monorepo or a flaky network mount that is a big difference for scripted runs.

REVIEW.md for local code reviews

The notes add REVIEW.md support to /code-review: local reviews now follow the root REVIEW.md on your repository's default branch. Reading it from the default branch, not the working tree, is the interesting detail. A branch under review can't quietly rewrite the rules it is judged by. I'd put project-specific review rules there, the same way CLAUDE.md carries coding rules.

Smaller things worth a glance

  • Memory growing without bound while a hook in claude -p, an MCP server or a language server keeps printing large output was fixed.
  • On Linux, gigabytes of memory growth and 100% CPU while a build creates and removes many files in the repository was fixed.
  • FileChanged hooks now fire for every watched file in a folder, not just one, when several did not exist at startup.

The bulk of the release is new APIs for mods, which I haven't touched, so I'll skip them. For anyone running Claude Code unattended, the practical takeaway is to update, then re-check any hook that exits with code 2 and any script that consumes -p output through a pipe. The caps and timeouts here are safety nets, not a replacement for hooks that fail loudly and cheaply.

BM
Blue Moose
The moose behind Blue Moose. Full-stack PHP developer — Drupal by day, Symfony by night, tests always.