# VibeDrift > VibeDrift detects and prevents drift in AI-written code: the behavioral deviation that creeps in when stateless AI coding agents make a codebase stop agreeing with itself. It scans a repo for drift, gives it a Vibe Drift Score, and runs as an MCP server so your agent checks the codebase's own conventions before it writes. VibeDrift is a CLI and MCP server for keeping AI-generated codebases coherent. Local scans and the MCP tools are free and open source on every plan. Run `npx @vibedrift/cli .` for a local scan (signed out, the analysis runs on your machine and your code is not uploaded), or add the MCP server so Claude Code, or any MCP client that supports stdio servers, can consult your repo's conventions mid-task. Drift Sessions (preview, Claude Code only) flags drifting edits while the agent works and asks it to fix, park or decline each flag. ## Key facts - What it is: drift detection and prevention for AI-written code. "Drift" = behavioral deviation across stateless AI sessions (mismatched patterns, missing auth, duplicate or hallucinated code, convention fracture) that still compiles and passes review. - Local scan: `npx @vibedrift/cli .` — runs locally in seconds, free, open source, unlimited. Signed out, your code is not uploaded; a small anonymous usage beacon and a daily npm update check can be turned off with `--local-only` or `vibedrift telemetry disable`. Needs Node 20 or newer. - Vibe Drift Score: a composite 0–100 score plus a letter grade for how consistent the code is with its own dominant patterns, across four categories (architectural consistency, redundancy, security consistency, intent clarity). A separate Hygiene Score covers generic checks like dead code and complexity. Under the hood: 13 static analyzers and 14 cross-file drift detectors. - Deep scan: `vibedrift . --deep` adds a cloud pass on a sample of your functions (semantic duplicates, intent mismatch). Needs an account and is metered. On Pro it adds a ranked coherence report and copy-ready fix prompts. - MCP server: free and open source, local, no login. Install with `claude mcp add vibedrift -- npx -y @vibedrift/cli mcp`. Eight tools: get_dominant_pattern, find_similar_function, check_file_drift, validate_change and get_intent_hints (asked while the agent writes), init and enable (setup), and respond_to_flag (Drift Sessions). - CI: `npx @vibedrift/cli . --json --fail-on-score 70` gates merges below a threshold. - Drift Sessions: `vibedrift enable` once in a repo turns on Claude Code hooks. Checks async style, return shape, data access and duplicates on the edits it can check, and sends the agent a one-line advisory. It never blocks the edit. A finding clears only when the same check re-runs and passes. - Pricing: Free $0 (unlimited local scans, the free MCP tools, 1 deep scan/month, a one-time trial of 5 Drift Sessions). Pro $15/month (Drift Sessions beyond the trial, 12 deep scans per billing cycle, watch mode, a git pre-push gate, full scan history and trends). Enterprise: talk to us. Top up 5 deep scans for $10 on any plan; credits never expire. ## Product - [Homepage](https://www.vibedrift.ai): what VibeDrift is and why AI codebases drift. - [Vibe Check](https://www.vibedrift.ai/vibe-check): free, no-signup tool — paste a public GitHub repo URL and get an instant Vibe Drift Score, letter grade, and four-category drift breakdown, run in the browser by the latest VibeDrift (code analyzed in memory, never stored). - [Guide](https://www.vibedrift.ai/guide): install, scan, deep scan, and MCP setup for every client. - [Pricing](https://www.vibedrift.ai/#pricing): free, Pro, and Enterprise plans. - [Releases](https://www.vibedrift.ai/releases): changelog and product updates. - [FAQ](https://www.vibedrift.ai/faq): common questions about drift, scanning, and the MCP server. ## Blog - [AI technical debt: the hidden cost of agent-written code](https://www.vibedrift.ai/blog/ai-technical-debt): what AI technical debt is, why it's invisible, and how to measure and pay it down. - [Claude Code is drifting your repo. Here's how to stop it.](https://www.vibedrift.ai/blog/stop-claude-code-drift): why Claude Code drifts on large repos and how to stop it with in-loop MCP checks. - [What is an MCP server? A practical guide for coding agents](https://www.vibedrift.ai/blog/what-is-an-mcp-server): the Model Context Protocol explained, and how to add an MCP server to Claude Code or Cursor. - [Why AI-generated code passes review but breaks your codebase](https://www.vibedrift.ai/blog/why-ai-code-passes-review-but-breaks): why human review and linters miss behavioral drift, and what catches it. - [Cursor rules vs MCP: why config files aren't enough](https://www.vibedrift.ai/blog/cursor-rules-vs-mcp): how Cursor rules and MCP differ, and why you want both. - [CLAUDE.md best practices (and where they quietly fail)](https://www.vibedrift.ai/blog/claude-md-best-practices): how to write a CLAUDE.md agents follow, and how to stop conventions from eroding. - [5 MCP tools that make your AI agent write better code](https://www.vibedrift.ai/blog/best-mcp-tools-for-coding-agents): the five VibeDrift MCP tools and the drift each one prevents. - [How to keep a large codebase consistent when AI writes most of it](https://www.vibedrift.ai/blog/ai-codebase-consistency): a practical playbook for AI codebase consistency. - [Adding a drift gate to CI: block incoherent AI code before merge](https://www.vibedrift.ai/blog/drift-gate-ci): how to add a VibeDrift drift gate to GitHub Actions. - [Measuring code coherence: what a Vibe Drift Score actually tells you](https://www.vibedrift.ai/blog/code-coherence-vibe-drift-score): how to read the Vibe Drift Score and the five detectors behind it. - [From detection to prevention: the missing feedback loop in AI coding](https://www.vibedrift.ai/blog/from-detection-to-prevention): moving drift control from after-the-fact scanning to in-loop prevention via MCP. - [VibeDrift now runs inside your coding agent (MCP), and we measured the impact](https://www.vibedrift.ai/blog/does-a-drift-checker-change-agent-output): the controlled eval on whether the MCP signal changes what an agent writes. - [Your AI-written codebase is drifting. Here's how to measure it.](https://www.vibedrift.ai/blog/your-ai-codebase-is-drifting): what drift is and how VibeDrift measures it. ## Resources - [npm: @vibedrift/cli](https://www.npmjs.com/package/@vibedrift/cli): the CLI and MCP server package. - [GitHub: VibeDrift](https://github.com/VibeDrift/VibeDrift): open-source scanner and MCP server. - [VibeLang](https://thevibelang.org): sister project, a language where behavioral intent is compiler-enforced.