Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

claude-git-hooks

Latest version: v4.15.0

Overview

Last scanned
1 Dec 2026
Published
1 Dec 2026
npm package Publisher: pablo.rovito
29 Versions
3.8K Downloads

Scan summary

claude-git-hooks was last scanned on 1 Dec 2026 at version 4.15.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 29 versions; the latest was published on 1 Dec 2026.
  • Findings: No rules fired in version 4.15.0.
  • Downloads: 3,793 downloads.

Versions

29 versions published
Versions and the rules that fired in each
VersionPublishedStatus
4.15.0 LATEST 1 Dec 2026 No rules fired
4.14.0 23 Nov 2026 No rules fired
4.13.2 20 Nov 2026 No rules fired
2.65.0 20 Nov 2026 Not shown
4.13.1 19 Nov 2026 Not shown

No rules fired in 4.15.0

Findings

Findings for v4.15.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 4.15.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

Claude Git Hooks

AI-powered git hooks for automatic commit messages, code analysis, and PR creation.

Requirements

  • Node.js >=20.19.0
  • Git
  • Claude CLI (authenticated)

On an older Node.js, every command stops with one line naming the required and the running version. The pre-commit hook then lets the commit through without analysis, and prepare-commit-msg refuses a commit that asks for a generated message (auto). update never installs a release whose engines.node the running Node.js does not satisfy.

install chooses the newest installed Node.js that meets the requirement and writes its absolute path into the git hooks, so a commit started from VS Code or GitHub Desktop runs the hooks on that Node.js too, whatever its PATH. It prints the Node.js that runs claude-hooks and the one the hooks will run. Started on an older Node.js, install runs again on a supported one when one is installed. When none is, and nvm is installed, it asks before running nvm install for the newest LTS: no administrator rights, no nvm use. Otherwise it says where to get Node.js (Company Portal on team machines, or nodejs.org) and installs nothing.

Quick Start

npm install -g claude-git-hooks
cd your-project
claude-hooks install

Install verifies npm, Git and the Claude CLI, and chooses the hooks' Node.js. --headless makes the install non-interactive (CI/containers) but still runs those checks — it changes interaction, never scope. To skip them deliberately:

claude-hooks install --headless                          # non-interactive, checks run
claude-hooks install --headless --skip-dependency-checks # opt out, prints a warning

Usage

Auto Commit Message
git commit -m "auto"
# Claude generates message from branch name + changes
# Format: [TASK-ID] type: description
# Example: branch feature/IX-123-auth → [IX-123] feat: add authentication
Create PR
claude-hooks create-pr develop
# Automatically pushes branch if unpublished (with confirmation)
# Analyzes diff, generates title/description, creates PR on GitHub

Auto-push feature (v2.11.0):

  • Detects unpublished branches or unpushed commits
  • Shows commit preview before pushing
  • Prompts for confirmation (configurable)
  • Handles diverged branches gracefully

Merge strategy awareness (v2.25.0):

  • Auto-detects required strategy from branch naming: feature/*/release-fix/* → squash, release-candidate/*/hotfix/*/→ main → merge commit
  • Displays strategy in PR preview; adds merge-strategy:squash or merge-strategy:merge-commit label
  • Prepends body reminder for merge-commit PRs; unknown patterns prompt user to select manually

Automatic label resolution (v2.31.0):

  • Resolves labels from 5 rule types: preset, size, quality, strategy, and defaults
  • Remote config priority (your organisation's git-hooks-config repository, labels.json) with local fallback
  • Preset label: one label, named after the preset the PR was analysed under — selected from the PR's files under auto, or the pinned one
  • Size labels: the larger of two bands. Files: size:S (\<10), size:M (10-49), size:L (50-99), size:XL (100+), remote key sizeLabels.thresholds. Changed lines (added + deleted): size:S (\<300), size:M (300-999), size:L (1,000-2,999), size:XL (3,000+), remote key sizeLabels.lineThresholds. Only source files count: files under .library/ (the Library maintenance commit) are left out of both
  • Quality labels: breaking-change, security, performance from analysis result
  • Each rule type independently enabled/disabled via remote config
Team Configuration

Label rules, PR categories, and role-based permissions are managed centrally in a git-hooks-config repository belonging to your organisation. Changes there take effect immediately across all governed repositories — no tool update or deploy required. The repository is resolved from your configuration; see claude-hooks setup-github.

Code Knowledge Library (optional)

A Code Knowledge Library is per-file Markdown "books" extracted from a repository's source. claude-git-hooks does not maintain it itself, and loads no Library engine: since 4.0.0 the maintenance runs as a trigger (see Extensions) that calls an engine's library CLI at create-pr → before-pr: it regenerates stale books and books new sources, in one local commit (chore(library): sync books for <branch>) that create-pr then pushes with the branch. A pre-commit trigger running library check --staged can warn earlier, but it only warns about what this one fixes, so it is not needed.

{
  "version": "2.8.0",
  "overrides": {
    "extensions": {
      "triggers": [
        { "id": "library-create-pr", "on": "create-pr", "when": "before-pr", "mode": "sync",
          "timeoutMs": 600000, "run": ["library", "create-pr-pipeline", "--repo", "."],
          "requiresPath": [".library/resolver.yaml"] }
      ]
    }
  }
}

That is the local form, in .claude/config.json. A team usually declares the same trigger once, in its remote config (settings.json → extensions.triggers), so every repository gets it; a developer can still replace or disable it locally by id.

  • No Library, nothing happens. requiresPath skips the trigger in a repository without .library/resolver.yaml, with nothing printed — which is most repositories.
  • A Library but no engine is one warning. If library is not on PATH, the trigger says so and the command carries on.
  • The engine is yours to choose and install. Any CLI that provides that subcommand works. Keep it out of dependencies: claude-git-hooks is a public package and names no engine.

The trust boundary of remote triggers — write access to the config repository is code execution on every developer machine — is documented in docs/EXTENSIONS.md §8.

Token Setup
claude-hooks setup-github  # Configure GitHub token for PR creation
claude-hooks setup-team    # Select your team (metrics and PR reviewers)
claude-hooks setup-linear  # Configure Linear token for ticket enrichment

Option 1 - Settings file (recommended):

// .claude/settings.local.json (gitignored)
{ "githubToken": "ghp_..." }

Option 2 - Environment variable:

export GITHUB_TOKEN="ghp_..."

Create token at https://github.com/settings/tokens with scopes: repo, read:org

Linting & Formatting

Runs formatters and linters on staged files automatically during pre-commit, or on demand:

# Lint staged files (default)
claude-hooks lint

# Lint all files in a directory
claude-hooks lint src/

# Lint specific files
claude-hooks lint file1.js file2.java

# Mix of directories and files
claude-hooks lint src/ lib/utils/ file.js

Tools per preset (configured via your organisation's remote config repository; these are the package defaults, used when the remote config is unavailable):

Preset Tools
frontend ESLint
backend none
fullstack ESLint
database sqlfluff
ai ESLint
infra none yet
default ESLint

Formatters (Prettier, Spotless) do not run in the gate by default; only linters do. A team re-enables one by listing it in its formatters.json presetTools, e.g. "frontend": ["prettier", "eslint"].

Behavior:

  • When a team lists a formatter, it runs before the linters (Prettier, then ESLint): format before lint
  • Auto-fix is decided per tool and is off by default: linting.autoFixTools ships spotless → true and prettier → false, and every other tool (ESLint, SQLFluff) follows linting.autoFix, default false. A tool named in autoFixTools keeps that value even when autoFix is true. Opt a tool in or out by name, e.g. "autoFixTools": { "prettier": true, "eslint": true }. Per run, CLAUDE_HOOKS_LINT_FIX=1 (on) or =0 (off) forces every tool
  • A fixed file is re-staged whole, so only files whose working tree equals what you staged are ever fixed. A file with unstaged edits (or an untracked one) is skipped and named in a warning; stage or stash the rest to let it fix. Only the files the tool actually changed are re-staged and counted in "auto-fixed N file(s)"
  • Missing tools are skipped with install instructions (never blocks)
  • A tool that is installed but cannot launch, or prints output that cannot be read, blocks the commit before any AI review, naming the tool and the reason. Fix the tool or its configuration and commit again. claude-hooks lint exits 1 in the same case
  • A tool that times out does not block the commit: one warning names the tool, its time budget and the files it did not check, ending "commit not blocked". Those files go unchecked by that tool; every other tool's findings, and those of its runs that finished, still reach the review. claude-hooks lint prints the same warning ending "lint incomplete" and exits 1
  • A long file list is linted in several runs, so a large commit stays under the Windows command-line limit (8,191 characters through a .cmd shim); the findings are the same as one run
  • Prettier checks every staged file type it formats (JavaScript, TypeScript, CSS, HTML, JSON, Markdown, YAML) that .prettierignore does not exclude. An unformatted file is a warning: it reaches the judge as a minor finding and does not block the commit by itself. A file Prettier cannot parse is a tool failure and blocks
  • Unfixable issues are forwarded to the Claude judge for semantic resolution
  • Tool-to-preset mapping is fetched from remote config (team-controlled, no release needed)
Analyze Code (Interactive Review)

Run interactive code analysis before committing:

# Analyze staged changes (default)
claude-hooks analyze

# Analyze unstaged changes
claude-hooks analyze --unstaged

# Analyze all tracked files (deprecated: removed in 5.0.0, no replacement)
claude-hooks analyze --all

# Up to 3 fix-then-verify cycles (default: analysis.cycles, 2)
claude-hooks analyze --cycles 3

# Until nothing blocks, a clean result confirmed through cycle 4
claude-hooks analyze --until-clean

# Continue the last run in a new process, after fixing and staging (no terminal needed)
claude-hooks analyze --verify

What it does:

  • Analyzes selected file scope (staged, unstaged, or all)
  • Shows all issues (INFO, MINOR, MAJOR, CRITICAL, BLOCKER)
  • Interactive prompt with options:
    • Continue: Creates commit automatically with auto-generated message
    • Abort: Generate resolution prompt and fix issues
    • View: Show detailed issue list
  • Executes git commit -m "auto" --no-verify on confirmation
  • Passes or fails by the same gate as the pre-commit hook (a reachable finding at or above analysis.blockingSeverityThreshold, default major). Only a pass writes the hooks-verified marker, so only a commit the hook would have let through carries Hooks-Verified: true. Choosing Continue past a failing gate is your decision; that commit gets no trailer
  • When the gate blocks, offers to verify your fix without a full re-run: the next cycle re-analyses only the files you changed. See Fix-then-verify cycles below
  • Works outside git hooks (no stdin limitations)

Use case: Complete analysis-to-commit workflow in one command.

Analyze Diff (without creating PR)

Deprecated: analyze-diff is removed in 5.0.0. Use claude-hooks create-pr, which runs the same step.

claude-hooks analyze-diff develop
# Generates PR metadata without creating
Analyze PR from GitHub URL
claude-hooks analyze-pr https://github.com/owner/repo/pull/123
# Fetches PR, applies preset guidelines, posts review comments

claude-hooks analyze-pr https://github.com/owner/repo/pull/123 --dry-run
# Analyze without posting comments

claude-hooks analyze-pr https://github.com/owner/repo/pull/123 --preset backend
# Override preset
  • Auto-detects preset from PR labels, Linear ticket labels, or file extensions
  • Enriches with Linear ticket context when [AUT-1234] found in PR title
  • Reads the PR's conversation (comments, reviews, inline threads with replies, resolved and outdated state) so it does not repeat findings already raised or re-raise settled ones. The conversation is quoted into the prompt as data, never as instructions, within a 48,000-character budget: open threads first, then reviews, conversation comments and resolved or outdated threads, newest first; the JSON output's conversation field says how much was read and how many items were left out. If the conversation cannot be read, the command warns and reviews the diff alone
  • Lists findings that are already open on the PR under "Already raised" (console, review body, JSON alreadyRaised) instead of posting them again. Besides the model's own list, an inline finding in the same category, within 3 lines of one of the analyzer's earlier threads on the same file and citing at least 2 of the same code spans, is not reposted while that thread is open, or resolved with its code unchanged; it is posted again once the thread is outdated. A repeated critical finding still fails the run while its thread is open, and stops failing it once the thread is resolved
  • Marks its own reviews with a hidden <!-- claude-hooks:analyze-pr --> marker, so a later run tells them apart from human reviews posted with the same GitHub account. A review counts as the analyzer's only when it carries the marker (or the ## PR Analysis ( heading) AND was posted by the account the GitHub token belongs to, so a pasted marker is ignored. So running the analyzer with another account's token, or with a GitHub App installation token (which cannot say whose it is, and gets a warning), leaves the earlier reviews unrecognised: their findings can be posted again
  • Checks each model-written Library gotcha the PR adds (a paragraph under a <!-- gotcha: auto · … --> marker whose text the PR adds) against the code at the PR head: one tool-less gotchaCheck spawn per gotcha reads the book's source_files at the head commit and answers confirmed, false (with a correction) or unverifiable (with a reason); a cited line it was not shown downgrades the answer to unverifiable. At most 10 gotchas per run (only their books are read), 32,000 source characters per gotcha (larger files are excerpted around the identifiers the gotcha cites), and a hard $1.00 per run: a check starts only if it and every check in flight could bill their per-spawn budget ($0.25) and the run would still stay within $1.00. The result is the JSON output's gotchaCheck field (status ok / none / error, counts, results, truncated, costUsd); a PR adding no gotcha starts no spawn. A failed check warns and never stops the review
  • Interactive comment workflow: confirm/skip each finding before posting
  • Classifies into inline (file:line) and general (review-level) categories
  • --model <model> (override the model) is deprecated: removed in 5.0.0, no replacement
Bump Version

Automatic version management with CHANGELOG generation and Git tagging:

# Bump patch version (1.0.0 → 1.0.1)
claude-hooks bump-version patch

# Bump with suffix
claude-hooks bump-version minor --suffix SNAPSHOT  # → 1.1.0-SNAPSHOT

# Bump and generate CHANGELOG
claude-hooks bump-version major --update-changelog

# Preview without applying
claude-hooks bump-version patch --dry-run

# Push tag immediately (otherwise pushed by create-pr).
# Deprecated: --push is removed in 5.0.0, no replacement
claude-hooks bump-version patch --push

# Manual workflow (skip automatic commit)
claude-hooks bump-version patch --no-commit

What it does:

  • Detects project type (Node.js, Maven, or monorepo with both)
  • Updates package.json and/or pom.xml
  • Generates CHANGELOG entry with Claude (analyzes commits)
  • Commits changes automatically with conventional commit format
  • Creates annotated Git tag with v prefix (e.g., v2.7.0)
  • Tags stay local by default (let create-pr push them; --push still pushes immediately until 5.0.0)
  • --interactive, --push, --remove-suffix and --set-suffix are deprecated: removed in 5.0.0, no replacement

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm claude-git-hooks

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Frame 2085668439 (1)
Group 1261154229