← Back to Leaderboard
Ritsthecsguy

itsthecsguy/ratchet

A local Rust CLI that lints agent guidance and enforces rules at tool-call time

View on GitHub ↗
Engineering Health (Methodology)
A · 86/100
Maintenance Activity
● Updated yesterday
Latest Release
v0.1.5
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption11/25
Release Cadence20/20
License Clarity20/20
CLISelf-Hosted
Total Stars
★ 373
24h Growth
+13
7d Growth
+373
Forks
21

GitHub Star History

Tracked from daily D1 telemetry snapshots. Hover any data point for exact daily star counts.

itsthecsguy/ratchet Star History (2026-11-28 - 2026-12-03) DAILY STAR HISTORY (6-DAY D1 TELEMETRY) +372 in 5d · avg +74/day 394 197 0 2026-11-28: ★ 12026-11-29: ★ 1372026-11-30: ★ 2712026-12-01: ★ 3132026-12-02: ★ 3602026-12-03: ★ 373 ★ 373 11-28 11-30 12-03

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

Ratchet is a Rust 2021 workspace that ships one ratchet binary. It runs a short-lived process per hook event rather than a daemon. Typed rule blocks in CLAUDE.md, AGENTS.md, and SKILL.md, plus optional .ratchet/checks.yaml, turn repository guidance into checkable policy. ratchet-syntax/src/skill.rs defines the block grammar, ratchet-core/src/skill.rs defines its types, and ratchet-cli/src/lint.rs implements linting. The workspace separates shell handling, I/O, hook integration, and optional model testing into distinct crates. It uses Serde and enables key-order preservation in serde_json when rewriting settings.

ratchet setup installs rules and wires the harness’s native lifecycle hooks. At a supported pre-tool event, the harness passes JSON to Ratchet and waits while it parses or normalizes the action and matches it against policy. A deny response can carry a rule ID, the original guidance, and a corrective fix:. Post-tool and session-end events cover checks that need execution results or test-freshness state. MCP calls are actions Ratchet can govern through a supported adapter, not a reason to deploy an MCP server.

Key Capabilities & Differentiators

ratchet lint distinguishes deterministic checks from rules that require judgment. It detects malformed frontmatter, dead globs, unchecked claims, stale references, broken links, and contradictions across files or lockfiles. ratchet try previews a decision without executing the action, and ratchet test exercises inline ok: and bad: fixtures. Runtime rules cover shell commands, supported file reads and writes, pre-write content scans, MCP and generic tool calls, diff or command checks, and test freshness. Reference timings are roughly 36 ms for linting a 35,000-file repository and 1.8 ms for a hook call, not deployment guarantees.

Adapters cover Claude Code, Antigravity, Codex CLI, Cursor, Gemini CLI, Amp, GitHub Copilot CLI, OpenCode, and Windsurf. Capabilities vary: Codex’s listed pre-tool coverage is Bash and apply_patch, while OpenCode and Windsurf rely on ratchet check and CI for finish or commit rules. Claude Code and Cursor support native interactive ask prompts; binary allow/deny integrations fall back to denial and one-time approval. Optional ratchet test --models runs real agent CLIs, and .ratchet/models.yaml supports custom runners.

Trade-offs & Limitations

Compared with prose-only guidance, Ratchet gives concrete requirements a repeatable decision point. Compared with an ordinary CI linter, it can intervene before a supported tool action rather than waiting for a commit or merge. Its strongest fit is shared repository policy across several agent clients: a package-manager rule can live alongside the guidance, carry positive and negative fixtures, and return a targeted correction. For a team on one client with only coarse permission needs, native controls may be simpler than maintaining a second rule layer. Reviews of style and design intent still belong in prose or model evaluations.

Treat hook policy as a workflow safeguard, not a sandbox. Coverage depends on the events each harness exposes and what the parser can infer from submitted command text. Protected-read checks do not follow shell wildcard expansion, an earlier cd, interpreter code, or recursive discovery. on_opaque: ask|deny and fail_closed: true can make selected rules stricter, but may interrupt legitimate workflows without adding visibility into unobserved actions. Use native permissions or isolation for hard security boundaries, and CI for repository-wide gates.

Hardware & Deployment Guide

Prebuilt binaries are available for Linux and macOS on x86-64 and arm64; the installer verifies SHA-256 checksums. Source installation uses Rust 1.82 or later, either through cargo install --git https://github.com/itsthecsguy/ratchet --locked ratchet-cli or cargo install --path crates/ratchet-cli from a checkout. Linting and enforcement run offline without a daemon, model API key, or GPU. The target harness provides the tool events; optional model tests require the chosen agent CLI and whatever credentials or environment that CLI needs.

Start with ratchet lint, then use ratchet setup --level shadow or --level warn to evaluate rules without blocking work. Setup otherwise enforces by default. Exercise representative actions with ratchet try and fixture tests before promoting rules. Teams can add Git pre-commit and GitHub Actions through --git-hook --ci and run ratchet check --ci in automation. After v0.1.0 and v0.1.1, v0.1.2 added opt-in user-wide guidance rules, .agent/ scanning, and lint --root, and narrowed W103 behavior at cd boundaries.

Rule source: Typed Markdown blocks and optional .ratchet/checks.yaml keep machine-enforced rules alongside agent guidance.
Lint diagnostics: E006 flags malformed frontmatter, W108 finds dead globs, and W103 catches stale repository references.
Hook adapters: Nine coding-agent harnesses are supported, with adapter-specific tool coverage and session-end behavior.
Rollout control: shadow, warn, ask, and enforce separate observation from blocking; ratchet approve offers a one-time exception.
Verification: Inline ok: and bad: fixtures test rules deterministically; ratchet test --models measures behavior with real agent CLIs.
Repository gates: ratchet check --staged targets staged changes, while ratchet ci init sets up GitHub Actions verification.
Best For

Teams using multiple coding-agent clients that want shared, testable guardrails for package managers, sensitive paths, and required test runs, with feedback before a supported tool action executes.

Skip If

You need a security sandbox, uniform interception of every action across clients, or automated judgment of subjective guidance. If native permissions and CI already cover your requirements, another hook layer may not pay off.

Reviewed on 2026-12-01 · Grounded in GitHub README, root file tree & releases · Newer release v0.1.5 (2026-12-03) shipped after this reviewMethodology

Quick Start & Installation

CLISelf-Hosted
# Prebuilt release binary (Linux x86_64/arm64, macOS arm64/x86_64, SHA-256 verified):
curl -fsSL https://raw.githubusercontent.com/itsthecsguy/ratchet/main/scripts/install.sh | sh

# Update anytime to the latest release (SHA-256 verified, atomic swap):
ratchet update

# Or install from source via Git (Rust 1.82+):
cargo install --git https://github.com/itsthecsguy/ratchet --locked ratchet-cli

# Or from a local checkout:
cargo install --path crates/ratchet-cli

Comparison vs. Top Coding, Skills & MCP Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
ratchet ★373+373RustMITA local Rust CLI that lints agent guidance and enforces rules at tool-call time
rtk88.7k+684RustApache-2.0A local Rust CLI wrapper that trims command output before coding agents read it.
obsidian-skills56.2k+1.7kShellMITAgent Skills plugins for editing Obsidian files and working with vaults
ECC316.1k+4.2kJavaScriptMITPlugins and CLI workflows for planning, reviewing, and verifying agent-written c

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/itsthecsguy/ratchet.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

itsthecsguy/ratchet Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about ratchet

Does Ratchet need an MCP server or a background service?

No separate MCP server is required. Ratchet runs as a short-lived local process invoked through the coding agent’s native hooks or plugin adapter. On integrations that expose the relevant events, a when: tool rule can govern MCP and other tool calls.

What hardware and runtime overhead should we budget for?

Linting and enforcement run offline and need no GPU, VRAM allocation, or model API credentials. The release binary is about 5 MB; that is artifact size, not peak memory. The published hook timing is about 1.8 ms, but measure it on your own machines and rule set. Optional model testing invokes agent CLIs, so compute and credentials depend on those backends.

Can we self-host Ratchet for commercial use?

Yes. The MIT license permits internal and commercial use and redistribution, subject to retaining the copyright and license notices as required. The local enforcement path does not need a hosted Ratchet service. Review the terms and data handling of any external agent CLI used for optional model tests separately.

When is Ratchet better than native agent permissions or ordinary CI linting?

Native permissions are a better fit for access boundaries that the agent can enforce directly, and ordinary CI linting is a better fit for checks that only need to gate a commit or merge. Ratchet adds value when the same repository rule should run before an agent tool call, return a concrete correction, and be testable with fixtures across multiple clients.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining itsthecsguy/ratchet? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature itsthecsguy/ratchet on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare