PreToolUse or PostToolUse? Where to Put a Check in the Claude Agent SDK
If an agent can trigger a business action, the most important design question is where each check runs. In the Claude Agent SDK, hooks give you two points around every tool call. Only one of them can stop the action. A check that must prevent a side effect belongs in PreToolUse. It runs before the tool executes and returns a decision.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in