Agent SDK Hooks
Claude Certified Architect – Foundations (CCAR-F) exam practice questions · 10 flashcards
Question
What is a PostToolUse hook used for?
1 / 10
Tip: Space flips the card, ← / → navigate.
Show all 10 Agent SDK Hooks practice questions and answers
- What is a PostToolUse hook used for?Intercepting tool results before the model sees them, e.g. to normalize or trim data.
- Give a PostToolUse normalization example.Converting differing timestamp formats or status codes from multiple MCP tools into one consistent format.
- What is a PreToolUse hook used for?Intercepting outgoing tool calls to block or redirect them based on policy.
- Refunds above $500 must go to a human. Best implementation?A hook that intercepts process_refund over the threshold and redirects to human escalation.
- Hooks vs prompt instructions?Hooks give deterministic guarantees; prompts give probabilistic compliance.
- When should you choose hooks?When business rules require guaranteed compliance (financial limits, compliance, safety).
- Can hooks reduce context usage?Yes. A PostToolUse hook can strip irrelevant fields from verbose tool output.
- Can a hook give feedback to Claude?Yes. A blocking hook can return a reason so Claude adjusts its next action.
- Where do hooks run?In your application code, outside the model.
- Name typical hook events.PreToolUse, PostToolUse, UserPromptSubmit, Stop, SubagentStop, SessionStart and PreCompact.