---
title: "Hooks"
description: "The plugin hooks and what they enforce."
canonical_url: "https://razcue-agent-kit.vercel.app/en/reference/hooks"
---
# Hooks

> The plugin hooks and what they enforce.

Hooks are silent outside agent-kit projects and never block on their own errors.

<table>
<thead>
  <tr>
    <th>
      Event
    </th>
    
    <th>
      Matcher
    </th>
    
    <th>
      Script
    </th>
    
    <th>
      What it does
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        SessionStart
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      <code>
        session-start.mjs
      </code>
    </td>
    
    <td>
      SessionStart hook: injects the project profile (voice, language, git flow, method, work lanes), a compact knowledge index and the script index. Silent outside agent-kit projects.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        PreToolUse
      </code>
    </td>
    
    <td>
      <code>
        Bash
      </code>
    </td>
    
    <td>
      <code>
        git-guard.mjs
      </code>
    </td>
    
    <td>
      PreToolUse(Bash) hook: blocks git commands the project's git flow forbids. Exit 2 blocks the call and shows stderr to Claude. Silent outside agent-kit projects.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        PostToolUse
      </code>
    </td>
    
    <td>
      <code>
        Write
      </code>
    </td>
    
    <td>
      <code>
        script-nudge.mjs
      </code>
    </td>
    
    <td>
      PostToolUse(Write) hook: when the agent writes a script somewhere it will be lost (outside the project, at the project root, or in a tmp folder), remind it of the <code>
        scripts
      </code>
      
       skill so the script is found and reused next time.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        Stop
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      <code>
        checkpoint.mjs
      </code>
    </td>
    
    <td>
      Stop hook: after every turn (sync: async hooks are dropped when a headless run exits), saves where the work stands so the next session can resume — branch, changed files, active work. Silent; never fails.
    </td>
  </tr>
</tbody>
</table>


## Sitemap

See the full [sitemap](https://razcue-agent-kit.vercel.app/sitemap.md) for all pages.
