Skip to content

Back to the catalog

coldteadotai/abide
github.comrepo

coldteadotai/abide

Abide is a CLI (npx @coldtea/abide) that hooks into Claude Code, Codex and OpenCode to check every agent edit or turn against project rules written in AGENTS.md/CLAUDE.md that a linter can't enforce (e.g. 'never let a raw error reach a user', 'no premature abstractions'). It uses Jev, TypeSafe's calibrated decision model, to answer a typed yes/no probability per rule per diff instead of a full LLM call, making it cheap (~300ms, fractions of a cent per turn) enough to check every edit; violations above a threshold are fed back to the agent to repair in the same turn.

TL;DR A hook-based CLI that catches coding agents breaking unwritten project rules (via a cheap calibrated decision model) and makes them self-repair.
Document

What it claims

Beyond the summary's mechanism, the page puts a measured baseline on the problem: replaying 93 real Claude Code sessions (1,256 edits, 147 turns) across two repos against their own AGENTS.md cost 22 cents total. Jev flagged 39 edits and 15 turns; an independent reviewer confirmed 10 and 11 respectively. The turn-level catches (single-use abstractions, oversized files, duplicated logic) "held up 11 times in 15." The headline rate is one rule broken per 13 turns. Per-check cost on this repo's 13 rules is 1,000–1,600 input tokens ($0.00004–$0.00007), ~300ms for Jev and ~1s for the whole hook including Node startup; a 15-edit turn is a tenth of a cent. Measured 2026-09-18, direct to TypeSafe.

How it works

Four hooks per agent, which the summary does not enumerate:

  • Session start: hash instruction files; ask the agent to recompile the rubric if they changed.
  • Turn start: snapshot the working tree with git.
  • After each edit: run edit-phase rules on that hunk.
  • End of turn: diff the whole turn against the snapshot, run turn-phase rules plus edit-phase rules for anything a shell command wrote.

Rules compile into a committed, human-readable .abide/rubric.json; every verdict names a rule that quotes the exact instruction-file line it came from. Each rule fires at one moment (edit or turn) and can carry glob scope. Verdicts are banded: ≥0.8 the agent is told to repair; 0.5–0.8 you see a note but the agent does not; below 0.5 nothing.

How to use it

npx @coldtea/abide login    # pick a key type, paste it once
npx @coldtea/abide init     # hooks into every agent on this machine

Then run claude, codex, or opencode as usual. init --project installs into the repo so teammates get it on checkout. Codex needs a one-time /hooks accept of four entries; OpenCode runs as a plugin instead of hook processes.

Other commands: abide audit src/ judges every file as if just written (33 API routes → 12s, ~1 cent); report, check, audit, bench, calibrate take --json. calibrate finds dead rules against twenty real hunks from your history and switches them off; tune has the agent rewrite them. abide uninstall [agent] [--project] removes only abide's own entries.

Keys resolve environment → .env.local/.env at repo root → ~/.abide/.env (owner-only), never a flag, never logged. Set AI_GATEWAY_API_KEY for a Vercel AI Gateway path, or TYPESAFE_AI_BASE_URL to redirect the direct call to a self-hosted deployment, proxy, or mock.

flowchart TD
    E[Edit / turn diff] --> J{Jev probability}
    J -->|>=0.8| R[Agent told to repair, same turn]
    J -->|0.5-0.8| N[Note to you, agent unaware]
    J -->|<0.5| X[Nothing]
    E -.changed lines only.-> B[(TypeSafe / Gateway)]

Limits

  • Depends on a third-party model (TypeSafe's Jev, or a Vercel AI Gateway route). No server of the authors' is in the path, but changed lines do leave your machine.
  • Retention is not fully under your control: TypeSafe's API takes no per-request retention flag; zero-data-retention is an enterprise account arrangement. With a gateway key the call carries zeroDataRetention: true, which only asks the gateway to route to zero-retention providers.
  • On no key or no network the edit goes through unchecked, logged in .abide/events.jsonl; hooks always exit 0 with a hard deadline, so a failure silently means no enforcement.
  • Reviewer-confirmed precision is modest: 10 of 39 edit flags and 11 of 15 turn flags held up under an independent reviewer — so edit-level flags carried a high false-positive rate in the reported benchmark.
  • No built-in rules; it enforces only what your instruction files already say, and badly worded rules score ~0.4 and never fire until you calibrate or tune them.

Organisations named here

Technologies named here

Techniques named here

  • Decision-model rule checking
  • Verdict banding
  • Edit-phase vs turn-phase rule scoping
  • Rubric compilation
  • Hash-based recompilation
  • Git snapshot diffing per turn
  • Fail-open on missing key/network