Block AI coding agents on the same quality gates your humans hit.
klasp turns fmt, lint, type-check and test
into hard agent boundaries. Drift, infinite loops, and broken PRs stop at the gate —
not in human review.
Use case · overnight autonomy
Ship while you sleep. Wake up to PRs, not panic.
Autonomous agents need a deterministic done signal. Without one, an overnight run drifts: retry loops, exhausted context, force-pushed-broken commits. klasp is that signal — every iteration ends in a clean pass / fail with structured findings.
test_total::charges_tax · agent investigates01 — deterministic done
Exit codes are unambiguous. Agents stop guessing whether they're finished — the gate said zero, the gate said one. No drift, no panic loops.
02 — structured findings
When a gate fails, klasp surfaces line-numbered diagnostics from
cargo, pytest, your linter — so the agent fixes
the actual error, not a hallucinated symptom.
03 — bounded context
Tight pass / fail loops mean each iteration burns a few hundred tokens, not tens of thousands. Overnight runs stay inside their context window.
Why klasp
One config. Same gates. Both audiences.
01 Stop bad PRs at the source
Agents can't merge what they can't pass. klasp wires your existing fmt / lint / test commands into deterministic exit-code gates the agent has to clear before it commits.
02 One config, both audiences
klasp.toml is the single source of truth. The same gate that
guards your pre-commit hook guards the agent loop — no second config to
drift out of sync.
03 Plug-in agent support
First-class for Claude Code and Codex CLI today. Managed
CLAUDE.md / AGENTS.md blocks installed
idempotently, with conflict detection and clean uninstall.
Recipes
Typed recipes for the gates you already run.
# fmt — wraps an existing pre-commit hook [[checks]] name = "format" type = "pre_commit" hook_id = "rustfmt" # lint — fallow groups multiple checks under one verdict [[checks]] name = "lint" type = "fallow" # test — pytest with JUnit-XML diagnostics surfaced to the agent [[checks]] name = "test" type = "pytest" junit_xml = true # build — cargo with structured compiler diagnostics [[checks]] name = "build" type = "cargo" subcommand = "check"
Agents
First-class support for the agents you ship with.
| Capability | Claude Code | Codex CLI |
|---|---|---|
| Pre-commit gate hooks | ✓ | ✓ |
| Managed config block | CLAUDE.md | AGENTS.md |
| Idempotent install / uninstall | ✓ | ✓ |
| Conflict detection | ✓ | ✓ |
| Cursor / Aider | — roadmap | — roadmap |
Install
Pick your package manager.
npm / pnpm / bun
$ npx klasp@latest init pipx (python)
$ pipx install klasp $ klasp init
cargo (rust)
$ cargo install klasp $ klasp init