C

Create Git Hook

Claude Code git hook creation workflow with project analysis, intelligent suggestions for TypeScript/Prettier/ESLint/security, auto-configuration, and testing

Home/Developer Tools/Create Git Hook

What is it?

Hooks let you run code at key points in Claude Code's lifecycle: format files after edits, block commands before they execute, send notifications when Claude needs input, inject context at session start, and more. For the full list of hook events, see the Hooks reference.

Each example includes a ready-to-use configuration block that you add to a settings file. The most common patterns:

  • Get notified when Claude needs input
  • Auto-format code after edits
  • Block edits to protected files
  • Re-inject context after compaction

How to use it?

Hook events fire at specific lifecycle points in Claude Code. When an event fires, all matching hooks run in parallel, and identical hook commands are automatically deduplicated. The table below shows each event and when it triggers:

EventWhen it fires
SessionStartWhen a session begins or resumes
UserPromptSubmitWhen you submit a prompt, before Claude processes it
PreToolUseBefore a tool call executes. Can block it
PermissionRequestWhen a permission dialog appears
PostToolUseAfter a tool call succeeds
PostToolUseFailureAfter a tool call fails
NotificationWhen Claude Code sends a notification
SubagentStartWhen a subagent is spawned
SubagentStopWhen a subagent finishes
StopWhen Claude finishes responding
`Pr

Key Features

  • Claude Code git hook creation workflow with project analysis, intelligent suggestions for TypeScript/Prettier/ESLint/security, auto-configuration, and testing
  • Automated workflow execution for repetitive tasks
  • Seamless integration with Claude's development workflow
View on GitHub

GitHub Stats

Stars
Forks
Last Update
Author
NeoLabHQ
License
GPL-3.0
Version
1.0.0

Features