{"data":{"slug":"dadbodgeoff-drift","name":"drift","tagline":"Codebase intelligence for AI","github_url":"https://github.com/dadbodgeoff/drift","owner":"dadbodgeoff","repo":"drift","owner_avatar_url":"https://avatars.githubusercontent.com/u/217510445?v=4","primary_language":"TypeScript","stars":790,"forks":64,"topics":["ai-tools","cli","code-quality","csharp","java","mcp","mcp-server","model-context-protocol","pattern-detection","php","python","typescript","vscode-extension"],"archived":false,"github_pushed_at":"2026-09-11T00:14:02+00:00","maintenance_label":"Active","stars_delta_30d":8,"url":"https://www.graphcanon.com/tools/dadbodgeoff-drift","markdown_url":"https://www.graphcanon.com/tools/dadbodgeoff-drift.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/dadbodgeoff-drift","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=dadbodgeoff-drift","description":"Codebase intelligence for AI. Detects patterns & conventions + remembers decisions across sessions. MCP server for any IDE. Offline CLI.","homepage_url":null,"license":null,"open_issues":4,"watchers":7,"ai_summary":"A code analysis tool that detects patterns and conventions within codebases across multiple programming languages, maintains context across sessions through an MCP (Model Context Protocol) server designed to integrate with any IDE, and offers offline CLI usage.","readme_excerpt":"# Drift\n\n**Drift stops an AI agent from writing code that violates conventions your repo already\nfollows.** It runs entirely on your machine.\n\n> **Beta install: build from source.** Nothing is published to npm yet — `npm install -g @drift/cli`\n> does not work, and the `driftdetect` package on npm is the unrelated v1 from January. Building\n> needs a Rust toolchain ([rustup](https://rustup.rs)) because the scan engine is Rust.\n\n```bash\ngit clone https://github.com/dadbodgeoff/drift.git && cd drift\npnpm install --frozen-lockfile\npnpm build && pnpm build:engine\n\n# There is no `drift` binary yet; the entry point is the built CLI.\nalias drift=\"node $PWD/packages/cli/dist/main.js\"\ndrift doctor --repo-root .          # fails loudly if the toolchain is missing\n```\n\nThen, in the repository you want to protect:\n\n```bash\ncd your-repo\ndrift start --repo-root . --accept-defaults\n```\n\n`start` prints whether the convention it accepted will actually block, and the command to make it a\ngate if it will not. Now have an agent add a route that queries the database directly, the way a\nhundred other routes in your repo do not, and check the change:\n\n```bash\ndrift check --diff HEAD~1...HEAD --scope changed-hunks\n```\n\nIt names the file, the line, and the convention that was broken. In `block` mode it exits `2`.\n\n> `--diff main...HEAD` only works once your branch has commits that `main` does not. On a freshly\n> cloned repo you are *on* `main`, so that range is empty and Drift refuses rather than reporting a\n> pass it cannot support — exit `3`. That refusal is correct; give it a range with changes in it.\n\n## Scope — read this before adopting\n\nDrift enforces **one** convention family well, and says so rather than implying more:\n\n| | |\n|---|---|\n| **Languages** | TypeScript, JavaScript |\n| **Frameworks** | Next.js API routes (App Router and Pages) |\n| **Convention** | API routes must not import data-access clients directly |\n| **Status** | Beta — local CLI and a read-only MCP server |\n\n**It does not** review code generally, support other languages, modify your source, or sync\nanything to a server.\n\nThe data layer is recognised when its import specifier contains `prisma`, `database`, `db` or\n`data-access`. A repo naming its data layer `store` or `supabase` must declare it with\n`--data-modules`. Drift bootstraps and enforces a *declared* layering contract — it does not\nlearn conventions in general, and the claims manifest blocks that claim explicitly.\n\nSecurity heuristics exist behind `--experimental-security` and are **not** proofs. Their own audit\nis in [docs/internal/architecture/security-heuristic-audit.md](docs/internal/architecture/security-heuristic-audit.md).\n\n## What it does on real repositories\n\nEvaluated on seven open-source Next.js repos on every change\n([`pnpm eval:external`](scripts/external-eval.mjs)):\n\n| | |\n|---|---|\n| Onboards, learns the real data layer, catches an injected violation | **7 / 7** |\n| Correct `file:line` evidence | **7 / 7** |\n| A properly layered route falsely flagged | **0 / 7** |\n| False-positive rate (dub, 494 routes) | **3.1%** |\n| Evasion shapes caught, at the contract's mode ([`pnpm eval:evasion`](scripts/evasion-matrix.mjs)) | **66 / 66** testable cells |\n\nAnd, because the number that decides whether a first session is tolerable is not recall but how often\nDrift declines to answer — eight ordinary edits per repo, none of them a violation\n([`pnpm eval:bench`](scripts/beta-bench.mjs)):\n\n| | |\n|---|---|\n| Ordinary edits refused rather than answered | **0 / 56** |\n| Local imports the resolver places | **96.1% – 99.9%** |\n\nEvery check reports its own coverage, so a clean result is never mistaken for full coverage. Where\nDrift cannot resolve something it says so, with the offending specifiers — see\n[`drift doctor`](docs/reference/enforcement.md) and `summary.import_coverage`.\n\n## Why your repo might only warn\n\nIf findings appear but the check exits `0`, the convention is in **warn** mode, deliberately.\n\nDrift infers the c","github_created_at":"2026-01-19T04:48:51+00:00","created_at":"2026-07-11T11:54:23.025978+00:00","updated_at":"2026-09-20T06:44:55.722377+00:00","categories":[{"slug":"developer-tools","name":"Developer Tools","url":"https://www.graphcanon.com/categories/developer-tools","markdown_url":"https://www.graphcanon.com/categories/developer-tools.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/developer-tools"}],"tags":[{"slug":"ai-tools","name":"ai-tools"},{"slug":"cli","name":"cli"},{"slug":"code-quality","name":"code-quality"},{"slug":"csharp","name":"csharp"},{"slug":"java","name":"java"},{"slug":"mcp","name":"mcp"},{"slug":"mcp-server","name":"mcp-server"},{"slug":"pattern-detection","name":"pattern-detection"}],"trust":{"provenance":{"is_fork":false,"github_id":1137222083,"owner_type":"User","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-09-20T06:44:53.546Z","maintenance":{"label":"Active","score":82,"methodology":"github_public_v1","releases_90d":0,"days_since_push":9,"last_release_at":null,"stars_delta_30d":8,"open_issues_delta_30d":-11},"security_summary":{"status":"ok","scanner":"osv@v1","low_count":0,"high_count":0,"last_scan_at":"2026-08-16T04:01:45.186Z","medium_count":0,"scan_profile":"deps","critical_count":0}},"capability_facts":{"mcp":{"source":"repo_scan","observed_at":"2026-09-20T06:44:54.539Z","server_manifest":false},"scan":{"source":"repo_scan","observed_at":"2026-09-20T06:44:54.539Z"},"languages":{"value":["typescript","javascript"],"source":"github.language+package.json","observed_at":"2026-09-20T06:44:54.539Z"},"license_spdx":{"value":"MIT","source":"github.license","observed_at":"2026-09-20T06:44:54.539Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":null,"constraints":null,"when_to_use":["When working with complex, multi-language projects where maintaining consistent coding standards is crucial.","For developers who prefer using Visual Studio Code, as drift offers a dedicated extension optimized for this IDE which can leverage the full capabilities of the MCP server."],"when_not_to_use":["If your development environment does not support or integrate well with external plugins like those required by the Model Context Protocol server.","For projects where offline CLI usage is insufficient since drift’s most powerful features rely on an active connection to its MCP server for context preservation and session continuity."],"source":"enrich:decision_facts","observed_at":"2026-07-12T18:29:49.862Z"},"constraint_facets":null,"decision_summary":[{"label":"Adopt for","value":"drift is a code analysis tool that specializes in detecting patterns and conventions within multi-language codebases by leveraging an MCP (Model Context Protocol) server for context preservation across sessions."}]}}