Flashcardsfor IT Certifications

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.

Last updated: · Report an error on this page

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