{"version":"2.1.333","anchor":"background-hook-wake-cap-stop-hook-block-cap","canonical_anchor":"background-hook-wake-cap-stop-hook-block-cap","heading":"Hooks can wake Claude at most 8 times in a row by default","tier":"notice","area":"Hooks","scope":"both","heads_up":true,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.333\/e\/background-hook-wake-cap-stop-hook-block-cap","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.333","markdown":"### Hooks can wake Claude at most 8 times in a row by default\n\nA hook that keeps waking Claude is now stopped after 8 wakes in a row; `CLAUDE_CODE_STOP_HOOK_BLOCK_CAP` changes the limit\n\n**What**\n\nA hook is a script or command you set up to run automatically at certain moments in a session. Some hooks can wake Claude and make it keep working instead of stopping. Claude Code now limits how many times in a row a hook can do this. The limit covers hooks on events such as:\n\n- `Stop`, when Claude finishes responding\n\n- `SubagentStop`, when a subagent (a helper Claude runs for a separate task) finishes\n\n- `SessionStart`, when a session begins or resumes\n\n- `UserPromptSubmit`, when a prompt is submitted\n\nThe limit is 8 wakes in a row by default. You can set the environment variable `CLAUDE_CODE_STOP_HOOK_BLOCK_CAP` (a named value set in your shell before starting Claude Code) to a different number, or to 0 or less to remove the limit. When the limit is reached, Claude Code holds the hook's output until the next turn and shows a notice saying how many times in a row a background hook woke Claude.\n\n**Why**\n\nThis stops a hook from trapping Claude in an endless loop. If your hooks are meant to wake Claude more than 8 times in a row, raise the limit with `CLAUDE_CODE_STOP_HOOK_BLOCK_CAP`.\n\n- Area: Hooks\n- Tier: You'll notice\n- Useful: 3\/5\n- Signal: 3\/5\n- Scope: both\n- Heads-up: yes"}