prek
$ prek Community Low RiskSingle-binary Rust reimplementation of pre-commit that runs Git hooks from .pre-commit-config.yaml or prek.toml without a Python runtime. Supports workspace monorepos, tag filtering, and fast hook caching, with non-interactive prek run execution.
brew install prek Runs local workspace linters and formatters directly against files; CLI execution is vastly faster and lower-overhead than MCP.
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
Deterministic non-TTY prek run, --color=never, --show-diff-on-failure, and strict config validation, though it lacks native --json summary output.
- Supports
--color=never,--all-files, and--show-diff-on-failure - Outputs human-readable pass/fail hook logs rather than JSON
Operates locally in the repo, though executing third-party hook repos from .pre-commit-config.yaml can run arbitrary hook scripts and format files in place.
- Hook execution inherits write permissions of configured project hooks
Single Rust binary with no Python dependency for prek itself, available via Homebrew, Cargo, and GitHub Releases.
- Zero-dependency Rust binary across macOS, Linux, and Windows
Dramatically faster startup and built-in monorepo workspace support compared to Python pre-commit.
- Drop-in
.pre-commit-config.yamlcompatibility with faster Rust orchestration
Actively developed open-source project (j178/prek) under MIT license.
- Active MIT-licensed repository
Clear documentation site (prek.j178.dev) detailing differences from pre-commit, workspace mode, and CLI flags.
- Official docs site at prek.j178.dev
Security, Auth & Guardrails
Stores cached hook toolchains locally; uses Git credentials only when fetching hook repositories.
MIT open-source Rust binary; completely free.
# prek Agent Rules - Run `prek run --all-files --color=never` (or pass specific files) before finalizing commits, as hooks may auto-format files. - Remember that hooks defined in `.pre-commit-config.yaml` can modify staged/working files in place.
Agent-Ready Command Recipes
Safe Read-Only Queries
prek validate-config
Checks .pre-commit-config.yaml syntax strictly without executing or modifying files.
Controlled Writes & Previews
prek run --all-files --show-diff-on-failure --color=never
Executes project hooks non-interactively with ANSI colors disabled and prints diffs if auto-formatting hooks modify files.
Strengths for Agents
- + Drop-in
.pre-commit-config.yamlrunner with single-binary Rust speed and no Python bootstrap required. - +
--show-diff-on-failureand--color=nevergive agents clean diagnostic feedback when a hook rejects or edits files.
Caveats & Pitfalls
- ! No
--jsonoutput mode for hook results; agents parse stdout/exit codes. - ! Formatter hooks run via
prek runmutate working-tree files in place.