pre-commit-review

pre-commit-review is a skill for Claude Code from openshift-eng/ai-helpers. It costs 43 tokens per session (1,327 once invoked), scanned A, original, Apache-2.0.

A review procedure for staged and unstaged code changes, meaning edits currently prepared for commit and edits not yet prepared. It checks the current difference against project guidance, including tests, build verification, duplication, and code style.

In plain words
What is it for?
Use it for a pre-commit review of the current code difference, with optional language-specific or project-specific checks.
Why use it?
It catches problems before a commit while avoiding unrelated issues that were already present in unchanged code. It can also report when builds or test review were deliberately skipped.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions Claude Code; mentions OpenCode.

Part of the code-review plugin — 5 skills, 2 commands shipped together

Good fit Use it for a pre-commit review of the current code difference, with optional language-specific or project-specific checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/openshift-eng/ai-helpers/pre-commit-review
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add openshift-eng/ai-helpers --skill pre-commit-review
Clone the repo
git clone --depth 1 https://github.com/openshift-eng/ai-helpers

Made for: Claude Code.

Or install code-review, the plugin that ships this one along with the rest of its 5 skills, 2 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pre-commit-review

README.md
[![agentmods](https://agentmods.dev/badge/skills/openshift-eng/ai-helpers/pre-commit-review/github.svg)](https://agentmods.dev/skills/openshift-eng/ai-helpers/pre-commit-review)
Your own site
<a href="https://agentmods.dev/skills/openshift-eng/ai-helpers/pre-commit-review"><img src="https://agentmods.dev/badge/skills/openshift-eng/ai-helpers/pre-commit-review/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pre-commit-review

Your own site · 80×15
<a href="https://agentmods.dev/skills/openshift-eng/ai-helpers/pre-commit-review"><img src="https://agentmods.dev/badge/skills/openshift-eng/ai-helpers/pre-commit-review.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,327 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00043 $0.01327
Opus 5.5 $0.00017 $0.00531
Sonnet 5.5 $0.00009 $0.00265
Haiku 4.5 $0.00004 $0.00133

Measured 21d ago against content hash 96f6594bc54b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pre-commit-review scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 21d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/code-review/skills/pre-commit-review/SKILL.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Name

code-review:pre-commit-review

Synopsis

/code-review:pre-commit-review [--language <lang>] [--profile <name>] [--skip-build] [--skip-tests]

Purpose

Review the current staged and unstaged changes before committing. Assess test coverage, idiomatic code, duplication, design, and build verification. Review only the current diff; do not report pre-existing issues in unchanged code.

The same-named skill replaces the former plugin command, so the /code-review:pre-commit-review invocation remains available in Claude Code. Install the plugin through APM to expose this skill to OpenCode and other supported clients.

Workflow

1. Resolve options and review guidance

Read options from the skill invocation or the user's request:

Option Behavior
--language <lang> Apply language-specific review guidance. If omitted, detect from changed-file extensions.
--profile <name> Apply project-specific conventions and checks.
--skip-build Skip build verification and report it as skipped.
--skip-tests Skip unit-test coverage review and report it as skipped.

Detect the primary language from changed-file extensions: .go → Go, .py → Python, .rs → Rust, .ts/.tsx → TypeScript, and .java → Java. If files are mixed or the language has no guidance, continue with a general review.

Load optional guidance from sibling skill directories, relative to this SKILL.md:

  • Language: ../<language>-code-review/SKILL.md (currently available: ../go-code-review/SKILL.md).
  • Profile: ../<name>-code-review/SKILL.md (for example, ../hypershift-code-review/SKILL.md).

If requested guidance is absent, say so and continue without it. Give loaded guidance to each relevant review pass.

Completion criterion: all supplied options are accounted for, and each available language/profile guide has been loaded before reviewing.

2. Establish the diff

Collect and deduplicate changed paths from both git diff --name-only and git diff --cached --name-only. Categorize them as source, tests, configuration, or documentation. If the diff is empty, report that and stop. If no source files changed, narrow the review accordingly.

Read the full file on GitHub · 104 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 21d ago First seen · 104 lines · 43 tokens per session scan A 96f6594bc54b

Subscribe to this mod's changes

pre-commit-review is a skill published in the GitHub repository openshift-eng/ai-helpers (121 stars, last pushed today), licensed Apache-2.0. It adds 43 tokens to every session and 1,327 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-01.