pre-commit
$ pre-commit Community Low RiskManages 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.
brew install pre-commit Runs local linters and Git hooks directly on repository files; no MCP integration is needed.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
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 neverand deterministic exit codes - No
--jsonflag for aggregated hook results
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
Available via Homebrew, PyPI, and uvx across macOS, Linux, and Windows; requires Python 3.
- Installable via
breworpip/uvxon all major platforms
Unifies polyglot linters and formatters under one reproducible command.
- Automatic provisioning of language-specific hook runtimes
Widely adopted MIT project maintained by Anthony Sottile.
- Mature
pre-commit/pre-commitecosystem
Clear official site documentation and --help output.
- Complete configuration reference at pre-commit.com
Security, Auth & Guardrails
No credentials stored; caches isolated hook environments locally under ~/.cache/pre-commit.
MIT open-source Python CLI; completely free.
# 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
pre-commit validate-config
Checks .pre-commit-config.yaml syntax and hook declarations without modifying files.
Controlled Writes & Previews
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 neveroutput and reliable exit codes for agent verification loops. - +
validate-configcatches 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.