{"version":"2.1.336","anchor":"new-set-hook-idle-control-request","canonical_anchor":"new-set-hook-idle-control-request","heading":"Programs running Claude Code can mark a PostToolBatch hook as idle so it is skipped","tier":"use","area":"SDK","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.336\/e\/new-set-hook-idle-control-request","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.336","markdown":"### Programs running Claude Code can mark a PostToolBatch hook as idle so it is skipped\n\nPrograms that run Claude Code through the SDK can now mark a PostToolBatch hook as idle, and Claude Code then skips it\n\n**What**\n\nA hook is a script that runs at a set point. `PostToolBatch` hooks run after a batch of tool calls Claude made at the same time has finished, before the next request to the model. Programs that run Claude Code through the SDK, its programming interface, can now send a request to mark one of these hooks as idle or not idle. Hooks marked idle are skipped when Claude Code picks which hooks to run.\n\nThe request must name the `PostToolBatch` event, a non-empty matcher (the pattern that picks the hook) and idle set to true or false. Anything else is rejected with \"Invalid set_hook_idle: event must be PostToolBatch, matcher a non-empty string, and idle true or false\".\n\n**Why**\n\nA program can switch a `PostToolBatch` hook off and on again while Claude Code is running, without changing the hook settings.\n\n- Area: SDK\n- Names: `PostToolBatch`\n- Tier: Use it now\n- Useful: 3\/5\n- Signal: 3\/5\n- Scope: individual\n- Heads-up: no"}