Skip to content
LinkedInX

Hook Trigger Points

Target audience: Those deciding where to attach hooks, those learning the common trigger points
Prerequisites: Basic understanding of What Are Hooks

Hooks run logic automatically at set points. What becomes possible depends on which point is chosen.

The Common Trigger Points

graph LR
    Start["Session start"] --> Before["Before tool execution"]
    Before --> Exec["Tool execution"]
    Exec --> After["After tool execution"]
    After --> Resp["Before the response"]
    Resp --> End["Session end"]
TimingWhat it enablesExample use
Session startInjecting background informationLoading project conventions
Before tool executionBlocking, or requesting approvalBlocking operations against production
After tool executionVerifying, formatting, recordingRunning tests after a change
Before the responseInspecting the outputChecking for sensitive information
Session endWrap-up processingSaving work logs, clearing temporary files
This table scrolls horizontally. Keyboard users can focus the table and use the left and right arrow keys.

To Block, Use Before Execution

The highest-value point is immediately before tool execution. It is the only place where an operation can be prevented from running.

  • Abort when the target path falls outside the allowed scope
  • Request approval for delete operations
  • Stop when a connection to production is detected

Unlike an instruction, a hook operates as mechanism, so it keeps working even deep into long tasks.

To Verify, Use After Execution

Running verification immediately after a change keeps errors from carrying into the next step.

  • Run tests or syntax checks after a file changes
  • Confirm the output meets conventions
  • On failure, return the result to the AI so it corrects course immediately

This is also a way to enforce self-correction as mechanism rather than leaving it to the AI’s judgment.

To Supply Context, Use Session Start

When the same background gets repeated every time, load it automatically at session start: project conventions, terminology rules, and anything that should always apply.

Choose From the Goal

More trigger points is not better. Work backward from the purpose.

GoalPoint to choose
Prevent something dangerousBefore tool execution
Confirm the result is correctAfter tool execution
Keep the baseline consistentSession start
Inspect the outputBefore the response
This table scrolls horizontally. Keyboard users can focus the table and use the left and right arrow keys.

Summary

  • The main points are session start, before and after tool execution, before the response, and session end
  • Only the before-execution point can actually prevent an operation
  • Verification right after a change enforces self-correction as mechanism
  • Choose points from the goal rather than attaching hooks everywhere
Quiz