dadbodgeoff/drift
Codebase intelligence for AI. Detects patterns & conventions + remembers decisions across sessions. MCP server for any IDE. Offline CLI.
What it solves
Drift prevents AI agents from introducing code that violates existing repository conventions. It specifically addresses the problem of agents writing code that ignores established architectural patterns, such as preventing API routes from importing data-access clients directly in Next.js projects.
How it works
Drift uses a Rust-based scanning engine and a TypeScript CLI to analyze code and enforce a declared layering contract. It runs entirely locally, storing its state and repository intelligence in a SQLite database. It identifies conventions by analyzing the codebase and allows humans to accept or reject these candidates. Once a convention is a part of the repo contract, Drift can check diffs to see if new changes (often from an AI agent) break these rules, exiting with an error code to block the change if configured in block mode.
Who it’s for
Developers using TypeScript or JavaScript with Next.js (App Router or Pages) who use AI agents to generate code and want to maintain architectural integrity without manually reviewing every line for convention violations.
Highlights
- Local-first execution: Runs entirely on the user's machine with no cloud sync or external server requirements.
- Deterministic enforcement: Uses a declared contract to block violations rather than relying on general LLM-based code review.
- Agent-ready: Includes a read-only MCP (Model Context Protocol) server to provide agents with context about repository maps and findings.
- Evidence-based: Reports the exact file and line where a convention was broken.
- Governance-focused: Requires explicit human confirmation for any changes to the repository contract or governance decisions.
Related
- Project
- Project
- Project
- Project
- Project