Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

pre-commit

$ pre-commit Community Low Risk
pre-commit Contributors · Code & DevOps · MIT · macos / linux / windows

Manages and executes polyglot Git pre-commit hooks defined in .pre-commit-config.yaml inside isolated hook environments. Agents can run pre-commit run --all-files or validate configs headlessly without manual tool setup.

FCRS-1.0 Score
84 /100
Good
Medium Confidence
Zero-Friction Install
brew install pre-commit
CLI vs MCP Decision CLI Only

Runs local linters and Git hooks directly on repository files; no MCP integration is needed.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 20 / 25

Fully non-interactive with --color never and clear pass/fail exit codes, though it reports hook results as human-readable text rather than JSON.

  • Supports --color never and deterministic exit codes
  • No --json flag for aggregated hook results
Trust & Safety 21 / 25

Pins hook revisions by commit SHA in .pre-commit-config.yaml and runs in isolated environments, though auto-fix hooks modify workspace files.

  • Isolated hook caches in ~/.cache/pre-commit
  • Immutable hook revision pinning recommended
Setup & Portability 13 / 15

Available via Homebrew, PyPI, and uvx across macOS, Linux, and Windows; requires Python 3.

  • Installable via brew or pip/uvx on all major platforms
Utility & Efficiency 13 / 15

Unifies polyglot linters and formatters under one reproducible command.

  • Automatic provisioning of language-specific hook runtimes
Maintenance & Lineage 9 / 10

Widely adopted MIT project maintained by Anthony Sottile.

  • Mature pre-commit/pre-commit ecosystem
Docs & Verifiability 8 / 10

Clear official site documentation and --help output.

  • Complete configuration reference at pre-commit.com

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

No credentials stored; caches isolated hook environments locally under ~/.cache/pre-commit.

Side Effects
Read-Only Local Write
Cost & Quotas

MIT open-source Python CLI; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# pre-commit Agent Rules
- Run `pre-commit run --all-files --color never` (or target staged files) before concluding edits.
- Never bypass failing hooks with `git commit --no-verify` unless explicitly instructed.

Agent-Ready Command Recipes

Safe Read-Only Queries

Validate .pre-commit-config.yaml schema
pre-commit validate-config

Checks .pre-commit-config.yaml syntax and hook declarations without modifying files.

Controlled Writes & Previews

Run configured hooks across all tracked files
pre-commit run --all-files --color never

Executes all configured hooks deterministically with ANSI colors disabled; auto-fixing hooks may edit files in place.

Strengths for Agents

  • + Automatically provisions isolated hook runtimes across Python, Node, Go, and Rust.
  • + Clean --color never output and reliable exit codes for agent verification loops.
  • + validate-config catches malformed hook configs before running.

Caveats & Pitfalls

  • ! First run in an offline sandbox fails if hook repositories are not pre-cached.
  • ! Does not output structured JSON reports.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI