itsthecsguy/ratchet

Ratchet is a single-file program written in Rust: `ratchet lint` identifies unenforced constraints, broken paths and links, and contradictory rules across files; `ratchet setup` writes rules to `.ratchet/checks.yaml` and integrates with native hooks for 9 agents including Claude Code, Codex, Cursor, Gemini CLI, and Copilot CLI. Agents are blocked when they attempt to run prohibited commands, write to protected files, or exit without running tests, and receive specific fix commands. Rules have four levels: enforce, ask, warn, and shadow; `ratchet approve` can grant a one-time pass. The README states it operates fully offline with no API Key required, with each interception taking approximately 1.8 milliseconds (author's self-test).

Ratchet is a single-file program written in Rust: ratchet lint identifies unenforced constraints, broken paths and links, and contradictory rules across files; ratchet setup writes rules to .ratchet/checks.yaml and integrates with native hooks for 9 agents including Claude Code, Codex, Cursor, Gemini CLI, and Copilot CLI. Agents are blocked when they attempt to run prohibited commands, write to protected files, or exit without running tests, and receive specific fix commands. Rules have four levels: enforce, ask, warn, and shadow; ratchet approve can grant a one-time pass. The README states it operates fully offline with no API Key required, with each interception taking approximately 1.8 milliseconds (author's self-test).

Why It Matters Documentation often states "use pnpm only," but models frequently ignore this; Ratchet does not rely on model judgment but instead intercepts tool calls based on rules before execution, telling the agent which command to use instead.

Stars 96 (+10 / 24h)

Reasoning

  • Gained 10 stars in 24 hours, totaling 96 stars, ranked 12 on Trendshift for the day (indicating attention only); the README specifies an MIT license, created on 28 11
  • Does not call the model when enforcing rules, ensuring reproducible results; optionally integrates with your existing agent CLI only when generating new rules

Usage

  • Install from source using cargo install --git https://github.com/itsthecsguy/ratchet --locked ratchet-cli; in your project, first run ratchet lint to identify issues, then use ratchet setup --level warn to observe behavior, and switch to enforce once confirmed

Risks

  • The default level is enforce, which directly blocks commands; you can rehearse with ratchet try before integration
  • The README recommends installing precompiled binaries by piping a remote script to sh; it is advisable to read the script first or install from source; this is a new repository, and performance figures are self-tested by the author

Open

Trendshift(GitHub Trending 快照)

Explore the latest AI Radar updates