Skip to content

ai / hooks

Hooks

Small checks that run on every edit or command, so rules are enforced, not just requested.

/

40 templates

  • Block Chmod 777

    HookSecurity

    Free
  • Block Curl Pipe Shell

    HookSecurity

    Free
  • Block Dangerous Commands

    HookSecurity

    Free
  • Block Database Drops

    HookDatabases

    Free
  • Block Env in Git Add

    HookSecurity

    Free
  • Block Force Push

    HookSecurity

    Free
  • Block Generated File Edits

    HookCode quality

    Free
  • Block Git No Verify

    HookGit and releases

    Free
  • Block Git Reset Hard

    HookGit and releases

    Free
  • Block Global Installs

    HookDevOps and cloud

    Free
  • Block Large Writes

    HookCode quality

    Free
  • Block npm Publish

    Hooknode

    Free
  • Block Secrets in Edits

    HookSecurity

    Free
  • Block Secrets in Prompts

    HookSecurity

    Free
  • Block Sudo Commands

    HookSecurity

    Free
  • Block Vendor Edits

    HookCode quality

    Free
  • Check Node Version

    Hooknode

    Free
  • Detect Merge Markers

    HookGit and releases

    Free
  • Ensure Final Newline

    HookCode quality

    Free
  • Format After Edit

    HookCode quality

    Free
  • Inject Current Date

    HookWorkflow

    Free
  • Inject Git Branch

    HookGit and releases

    Free
  • Log Bash Commands

    HookWorkflow

    Free
  • Log Session End

    HookWorkflow

    Free
  • Notification Bell

    HookWorkflow

    Free
  • Protect CI Workflows

    Hookgithub-actions

    Free
  • Protect Env Files

    HookSecurity

    Free
  • Protect Lockfiles

    HookDevOps and cloud

    Free
  • Remind Run Tests

    HookTesting

    Free
  • Session Git Context

    HookGit and releases

    Free
  • Stop Bell

    HookWorkflow

    Free
  • Trim Trailing Whitespace

    HookCode quality

    Free
  • Validate JSON After Edit

    HookCode quality

    Free
  • Warn Console Log

    Hookjavascript

    Free
  • Warn Debugger Statements

    HookCode quality

    Free
  • Warn Long Files

    HookCode quality

    Free
  • Warn New Todos

    HookCode quality

    Free
  • Warn Skipped Tests

    Hookjavascript

    Free
  • Warn Uncommitted Changes

    HookGit and releases

    Free

Hooks: the basics

What is a hook?
A command the agent runs at a fixed moment, such as before a tool call or after an edit. Unlike an instruction, a hook always runs, so it can block a dangerous command or format a file every time.
Where does a hook go?
In .claude/settings.json in your project (or ~/.claude/settings.json for every project), under the event it listens to.
What do I need to run them?
Node.js, which these hooks use so one command works on macOS, Linux and Windows.