Skip to content
BENIBIX Learn

Async Hook

AI⌨️ Claude CodeConfiguration

Also known as async: true, asyncRewake

A command hook that runs in the background while Claude goes on.

Think of it like

It is like you start the washing machine. Then you do other jobs.

Example

Jack's tests take two minutes. As an async hook after each write, they run while Claude goes on, and the results arrive on the next turn.

Why it matters

A slow check no longer stalls every edit.

Definition

An async hook is a command hook with async set to true. It runs in the background, and Claude does not wait for it. When it ends, its additionalContext and systemMessage reach Claude on the next turn. Claude has already moved on, so it cannot block a thing. asyncRewake is a kind that wakes Claude at once if the hook exits 2.

Example code

json
{
  "type": "command",
  "command": "./run-tests.sh",
  "async": true
}
Run the tests without making Claude wait.

Common mistake

Making a guard async. By the time it says no, the action has already happened.

Key takeaways

  1. 1
    Runs in the background. Claude goes on.
  2. 2
    Results next turn. As context.
  3. 3
    Cannot block. Too late.