NEWnpm install -g @whitehatd/crag

Your agent ignores your rules.
crag makes them un-ignorable.

crag makes an agent's knowledge verified and its obedience compiled. Failures from real sessions become rules with proof — enforced in every request, in every agent, automatically.

Get startedSee it run on your repo — free audit →

demo scene — real mechanics

claude — ~/dev/acme-app
wire the checkout webhook and test it against the live payments API
Wiring(0s · esc to interrupt)
Bash(curl -X POST https://api.payments.example/v1/charges …)✗ Blocked by crag · rule net-002: external APIs in dev go through the mock gateway — verified 2 days ago
Using the mock gateway instead.
Update(src/webhooks/checkout.ts)
Updated src/webhooks/checkout.ts with 1 addition and 1 removal
14 const PAYMENTS_URL =
15-removed: 'https://api.payments.example/v1/charges';
15+added: 'http://localhost:4010/v1/charges'; // mock gateway
16
crag · captured 1 lesson · claim verified · rule enforced
$crag why net-002
incident2026-06-30 · session #412
claim"dev hits live payments API"
falsifier re-runPASS · verified 2 days ago
principle#29
compiled toCLAUDE.md · AGENTS.md · cursor.rules · pre-tool hook

Every rule answers crag why with proof.

84%/ 3%
of devs use AI coding tools · only 3% highly trust the output
66%
#1 frustration: "almost right, but not quite"
70.1%vs 42.5%
compiled enforcement vs. memory-retrieval compliance

Rules files are advisory. The model's biggest failure is not reading them. So crag stopped relying on that.

Sources: Stack Overflow Developer Survey 2025/2026 · HackerRank AI report 2026 · arXiv:2606.13174 (TRACE)

How crag works

The loop.

01

Capture

Failures are captured silently from real agent sessions.

02

Claims

Each capture is decomposed into atomic, falsifiable claims.

03

Verify

Every claim is checked against reality by re-running its falsifier.

04

Compile

Only claims that stay fresh compile into governance.

05

Enforce

Rules land in the files, hooks, and gateway every agent obeys.

06

Receipts

Every rule answers crag why with a full proof chain.

Trust is a number — the verified fraction of active claims. Rules whose evidence goes stale stop compiling. Nothing is deleted; everything answers why.

Same rule. Different harness.

crag doesn't care which agent you run.

codex — ~/dev/acme-app
wire the checkout webhook and test it against the live payments API
curl -X POST https://api.payments.example/v1/charges …✗ blocked · net-002 (dev → mock gateway)

One governance source. Compiled to Claude Code, Codex, Cursor, Copilot + 20 more targets — and enforced at the gateway even when the harness has no hooks.

crag Gate: point your baseURLat it. That's the whole integration.

Not another memory tool

Memory tools remember. Linters check format. crag verifies your knowledge is true, then compiles it into enforcement.

Memory tools

Remember what happened. Recall depends on the model reading the right thing at the right time — compliance tops out around 42.5%.

Linters

Check that code is formatted correctly. They have no opinion on whether the agent’s knowledge is true.

crag

Verifies your knowledge is true, then compiles it into enforcement the model can’t skip past.

Free, no signup

Point it at any GitHub repo.

See what your agents are actually working with — stale commands, missing gates, drift.

Or install it

Three commands. Every agent aligned.

$npm install -g @whitehatd/crag && crag analyze && crag compile --target all

Verified knowledge. Compiled obedience.

Get startedSign in