Sagargupta16

AI Git Hooks — AI skill for Claude Code

AI community

AI-powered git hooks - auto-review diffs, generate commit messages, scan for secrets.

How to install AI Git Hooks

This entry records only its repository, not the path inside it, so there is no exact command to give. Open Sagargupta16/ai-git-hooks and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What AI Git Hooks does

AI-powered git hooks - auto-review diffs, generate commit messages, scan for secrets. Supports Claude, OpenAI, and Ollama

Alternatives in AI

  • Claudekit — by Carl Rannaberg - Impressive CLI toolkit providing auto-save checkpointing, code quality hooks, specificatio 633 ★
  • Commit Claude Config — Version the Solana AI Kit config in git (un-ignores .claude/, CLAUDE.md, .mcp.json, .gitmodules and commits th 98 ★
  • Sloppy — Static analysis for the debt AI agents leave in PHP: 25 rules, Claude Code hooks, git-diff review, a Rector an 84 ★

README

AI Git Hooks

![GitHub stars](https://img.shields.io/github/stars/Sagargupta16/ai-git-hooks?style=flat-square&cacheSeconds=86400) ![GitHub forks](https://img.shields.io/github/forks/Sagargupta16/ai-git-hooks?style=flat-square&cacheSeconds=86400) ![License](https://img.shields.io/badge/License-MIT-blue?style=flat-square) ![Last Commit](https://img.shields.io/github/last-commit/Sagargupta16/ai-git-hooks?style=flat-square&cacheSeconds=86400)

AI-powered git hooks that review your code, generate commit messages, catch bugs, and scan for security issues - before you push.

Drop-in git hooks that use AI (Claude, OpenAI, Ollama) to automate code quality checks at every stage of your git workflow.

Hooks

Hook Description Trigger
AI Code Review Reviews staged changes for bugs, style issues, and anti-patterns pre-commit
Commit Message Generator Auto-generates conventional commit messages from your diff prepare-commit-msg
Commit Message Validator Validates commit messages follow conventions commit-msg
Pre-Push Security Scan Scans for secrets, vulnerabilities, and large files pre-push

Quick Start

1. Install

git clone https://github.com/Sagargupta16/ai-git-hooks.git
cd ai-git-hooks
./scripts/install.sh

2. Configure

Create `.ai-hooks.yml` in your project root:

provider: claude            # claude | openai | ollama
model: claude-sonnet-5      # model to use

hooks:
  pre-commit:
    enabled: true
    severity: warn          # error | warn | info
    max_files: 20
    ignore:
      - "*.lock"
      - "*.min.js"
      - "dist/**"

  prepare-commit-msg:
    enabled: true
    style: conventional     # conventional | simple | detailed
    ticket_prefix: true     # auto-detect ticket from branch name

  commit-msg:
    enabled: true
    convention: conventional
    max_lengt