Nov 20, 2026

Abide Enforces the AGENTS.md Rules No Linter Can Check

A 1k-star hook system judges every agent edit against your own instruction files with a decision-model call of about 300 ms, and makes the agent repair violations in the same turn.

#tutorial#claude-code#agent-tools#best-practices

Your AGENTS.md is full of rules no linter can script — "never let a raw error reach a user", "don't create premature abstractions" — so nothing enforces them. Abide, from coldtea, hooks into Claude Code, Codex, OpenCode and Pi and checks every edit against exactly those rules, using a decision-model call it claims costs about 300 ms and a few thousandths of a cent.

Why This Skill Matters

The README grounds the problem in a measurement: replaying 93 real Claude Code sessions — 1,256 edits across 147 turns in two repos, checked against each repo's own AGENTS.md for a total of 22 cents — found the agent breaking a rule on 1 turn in 13, from the first edit on. Jev, TypeSafe's decision model, flagged 39 edits and 15 turns; an independent reviewer confirmed 10 and 11 of those. The mechanism is deliberately narrow: on every edit (or turn) Abide asks Jev one typed question per rule and gets a probability back — Jev sees the rule and the diff, never the conversation. Rules a linter could check are handed to your linter instead, and there are no built-in rules to enforce.

Installation

Abide needs a model key: a TypeSafe API key from typesafe.ai, or a Vercel AI Gateway key you already have. Then:

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

The key goes to ~/.abide/.env for every repo on the machine, or to .env.local in one repo — owner-only either way. init takes an agent name (claude, codex, opencode, pi) or installs into every agent it finds; add --project to install into the repo instead, so teammates get it with the checkout. Per-agent landing spots are documented in a table: ~/.claude/settings.json for Claude Code, ~/.codex/hooks.json for Codex, ~/.config/opencode/plugins/abide.js for OpenCode, ~/.pi/agent/extensions/abide.js for Pi. Codex has one extra step — start codex, type /hooks, and accept the four abide entries.

Real Workflow: Catch the First Rule Break in Three Minutes

Start your agent. Its first turn compiles your rules into .abide/rubric.json and tells you what it found. The README's own example of what a violation looks like:

Abide: This edit appears to break a rule from this repository's instructions.
- Rule "api-validation-uses-yup" from ~/.codex/AGENTS.md line 65: "When writing API endpoints, do NOT write input validations manually. Use Yup (with clear validation messages) + early return in the API handler". Scored 0.86 in apps/web/src/pages/api/logout.ts.
Repair apps/web/src/pages/api/logout.ts now, then continue with the task.

The agent repairs the file before moving on, with no human in the loop. Every verdict names a rule, and every rule in the rubric quotes the line of your instruction file it came from — the README's point being that a wrong verdict is a rule you can rewrite.

Two behaviors are worth knowing before you trust it. Verdicts are banded: at 0.8 and above the agent is told to repair, between 0.5 and 0.8 you see a note the agent does not, and below 0.5 nothing fires. And the safety net is explicit: every hook path exits 0 with a hard deadline, so the hooks cannot break your session — with no key or no network, the edit goes through unchecked and the miss is logged in .abide/events.jsonl, where abide report counts it.

For existing code, abide audit src/ judges every file as if it had just been written — the README measured 33 API routes of a real Next.js app at 12 seconds and about a cent.

Tips

  • abide calibrate scores every rule against twenty real hunks from your git history; a badly worded rule scores around 0.4 on everything and never fires, and abide tune has an agent rewrite it.
  • Each rule runs at one of two moments — edit after each edit, or turn against the whole diff at the end — because a rule like "did this add more than was asked" has no answer after edit 1 of 12.
  • Rules can carry a scope of globs, so an API route and a stylesheet get different questions.
  • .abideignore skips files with repo-relative picomatch globs; it is glob syntax, not .gitignore — ! does not re-include, and directory patterns need /**.
  • abide bench measures latency and spend on your machine; the README's own figures (a 15-edit turn costs a tenth of a cent) were measured 2026-09-18 direct to TypeSafe.

When Not to Use This

The check rides on an external call: changed lines go to TypeSafe under your key, and the README states their zero-data-retention posture is an enterprise-tier account arrangement — if your policy forbids sending code to a third-party model at all, TYPESAFE_AI_BASE_URL can redirect the call to a self-hosted deployment, but a fully offline setup leaves the hooks unchecked. And teams whose house rules are all mechanically checkable get more from their linter than from a probability score.


See the leaderboard for more skills.