Drift
The convention lockfile for AI agents: mined from your code, approved by you, checked in your agents and CI.
Drift is a command-line tool that reads a repository and learns the conventions
the code already follows, such as the wrapper every API route uses, the guard
every server action calls or the layout every page renders. You confirm them;
Drift then tells coding agents about the ones you accepted (a suggestion also
needs drift review --show-to-agents) and reports new code that breaks them, and blocks only the ones you set to block. It ships no
predefined rules, runs no AI in the check path, and never sends your source
code anywhere: it reads the working tree and writes under .drift/ and
drift.lock.
Status: beta. Drift learns the conventions of TypeScript, JavaScript and
Python code, shows them to you first, tells coding agents
only about the ones you accept, and plugs into Claude Code, pre-commit, GitHub
code scanning and any MCP client.
- Agents see only what a person accepted, and chose to show. Default-tier
proposals are block candidates: they reach agents once you accept them
(decision D13). A suggestion (every Python convention is one) reaches agents
only after
drift review --show-to-agents <id>, unless its rule family is
admitted (none is today).
- Nothing blocks unless a person sets it to block.
- Mined Python proposals are on by default, as suggestions only
(
proposals: {python: off} turns them off). A blind check of 11 cards
decided the default; it is not a held-out result.
- Review every proposal. On repositories Drift was not tuned on, about half
of the default-tier cards (7 of 15) and 6 of 7 shown suggestions were right:
small samples, and below the ≥ 95% release gate. See
How accurate is it? and
Accuracy and limits.
Beta release notes · plan
Documentation. This page is the front door. The full guide is the wiki
pages under docs/wiki/: start at Home, or
go straight to Getting started,
Drift in CI, Team rollout,
the command reference or
Troubleshooting.
Contents
What Drift does and how sure it is
Drift does five things, all locally. It mines the conventions your code
follows and proposes them as rules for you to review (drift init,
drift census, drift review, drift check). It maps what the code does
per route for authentication, authorization, error handling, logging, validation
and more (drift practices). It inventories entry points with their guards
and where they are reachable from (drift security). It gives agents a
file's place and rules (drift card, drift mcp, the Claude Code hooks). And it
asks the few questions only a person can answer, such as whether a compose
file deploys anything (drift setup).
How sure are the answers? Not equally. Exposure (internet-facing, internal,
unknown) and error handling are in good shape. For authentication and
authorization, known is proven, but on code Drift was not tuned on a share of
none answers (and some known) are wrong: independent, unseen test suites
found 9% to 15% of soundness checks (about one in seven to one in eleven)
wrong on first contact. Read
none and internal as "nothing found in what Drift read": a finding to check,
not a fact. unknown means Drift could not tell and says why; it is common, and
it is the honest answer. Mined conventions are proposals, and about half of the
default-tier ones were wrong out of sample, which is why a person reviews every
one. Details: Accuracy and limits and
Accuracy and Limits.
Install
Nothing is published yet: there is no npm package and no release archive. Until
the first release, use one of the two paths below. Both end at drift --version.
A binary a teammate gave you. It must be built for your operating system and
CPU. Put it in a directory on your PATH and make it executable:
mkdir -p ~/.local/bin
cp ./drift ~/.local/bin/drift && chmod +x ~/.local/bin/drift
drift --version