Which Claude Code hook event runs an org shell command check

CCAR-F Claude Code Configuration & Workflows Easy Question 12 of 59

An organization check takes the exact text of a shell command and returns pass or fail. It has to run against the command Claude proposes, which does not exist while the engineer is typing the request, and a failing command must not reach the shell. The check does not look at results, and it is not there to keep the turn going.

Which hook event runs the check?

Show answer and explanation

CPreToolUse, which sees the proposed tool input before the call runs

PreToolUse is the event that receives the tool input before execution and can return a deny decision, so the command is stopped rather than reviewed after the fact. PostToolUse is right for a check on what a call produced, such as running a formatter once an edit has landed, and the shell command has already run by then. UserPromptSubmit can block, and it is right for a policy about what was asked for, but it fires on the person's message, before any command text exists. Stop can block too, and it is right for forcing more work before the turn ends, such as requiring the tests to pass.

Source: code.claude.com/docs/en/hooks

Anonymous, no account needed. Your tally stays in this browser.

Next question Start 5 timed questions Browse all 59 original CCAR-F practice questions