Make AI write code that actually fits your codebase.
Drift scans your code, learns your patterns, and tells AI how you do things. No more fixing AI output.
npm install -g driftdetect
cd your-project
drift setupThat's it. The setup wizard walks you through everything:
- Pattern scanning
- Auto-approval of high confidence patterns
- Call graph analysis
- Test topology mapping
- Cortex memory initialization
Want defaults without prompts? Run drift setup -y
You know that AGENTS.md or CLAUDE.md file you wrote once and forgot about? It's stale. Delete it.
Drift's Cortex Memory System replaces static instruction files with living memory:
# Instead of maintaining a static file:
drift memory add tribal "Always use bcrypt for passwords" --importance critical
drift memory add tribal "Services should not call controllers" --topic Architecture
# AI gets context dynamically:
drift memory why "authentication"
# And learns from corrections:
drift memory learn --original "Used MD5" --feedback "Use bcrypt instead"| Static AGENTS.md | Cortex Memory |
|---|---|
| Written once, forgotten | Learns from corrections |
| Gets stale immediately | Confidence decays naturally |
| Manual updates required | Self-correcting through feedback |
| One-size-fits-all dump | Intent-aware retrieval |
- Node.js 18 or newer β Download here
- npm β Comes with Node.js
Check if you have them:
node --version # Should show v18.x.x or higher
npm --version # Should show 9.x.x or higher| Path | Best For | Time to Setup |
|---|---|---|
| 1. CLI Only | Exploring your codebase manually | 2 minutes |
| 2. AI + CLI | AI runs drift commands for you | 2 minutes |
| 3. MCP Server | Full AI integration (recommended) | 5 minutes |
Perfect for: Exploring what Drift finds in your codebase before connecting AI.
npm install -g driftdetect
cd your-project
drift setupThe setup wizard handles everything. Just answer the prompts (or use drift setup -y for defaults).
drift statusYou'll see something like:
Patterns: 47 discovered, 12 approved
Health Score: 85/100
Languages: TypeScript, Python
| Command | What It Does |
|---|---|
drift status |
Quick overview of your codebase |
drift patterns list |
See all discovered patterns |
drift callgraph reach src/api/users.ts:42 |
What data can line 42 access? |
drift coupling cycles |
Find circular dependencies |
drift test-topology affected src/auth.ts |
Which tests cover this file? |
npm install -g driftdetect@latestPerfect for: Using AI assistants that can run terminal commands (Cursor, Windsurf, Kiro, etc.)
npm install -g driftdetect
cd your-project
drift setupCopy this into your AI chat:
I have Drift installed. Before writing code, run these commands:
1. `drift status` - See codebase overview
2. `drift similar --intent api_endpoint --description "what you're building"` - Find similar code
Use what you learn to match my patterns.
That's it! Your AI will run drift commands and use the output to write better code.
Perfect for: The best experience. AI automatically gets context without you asking.
MCP (Model Context Protocol) lets AI tools directly query Drift. Instead of you running commands and pasting output, the AI calls Drift tools automatically.
# Install both packages
npm install -g driftdetect driftdetect-mcp
# Run the setup wizard
cd your-project
drift setupPick your AI tool and follow the instructions:
Claude Desktop
-
Open this file (create it if it doesn't exist):
- Mac:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- Mac:
-
Add this:
{
"mcpServers": {
"drift": {
"command": "driftdetect-mcp"
}
}
}- Restart Claude Desktop
Cursor
-
Create
.cursor/mcp.jsonin your project folder -
Add this:
{
"mcpServers": {
"drift": {
"command": "driftdetect-mcp"
}
}
}- Restart Cursor
Windsurf
-
Open Settings β MCP Servers
-
Add a new server with command:
driftdetect-mcp -
Restart Windsurf
Kiro
-
Create
.kiro/settings/mcp.jsonin your project folder -
Add this:
{
"mcpServers": {
"drift": {
"command": "driftdetect-mcp"
}
}
}- Restart Kiro
VS Code + Copilot
-
Create
.vscode/mcp.jsonin your project folder -
Add this:
{
"mcpServers": {
"drift": {
"command": "driftdetect-mcp"
}
}
}- Restart VS Code
Ask your AI: "What patterns does Drift see in my codebase?"
If it responds with pattern information, you're all set! π
The CLI isn't installed. Run:
npm install -g driftdetect-
Make sure you installed the MCP server:
npm install -g driftdetect-mcp
-
Make sure you ran
drift scanin your project first -
Make sure you restarted your AI tool after configuring
Run a full scan:
drift scan --fulldrift --version # CLI version
driftdetect-mcp --version # MCP server versionnpm install -g driftdetect@latest driftdetect-mcp@latest| Category | Count | Examples |
|---|---|---|
| Languages | 10 | TypeScript, JavaScript, Python, Java, C#, PHP, Go, Rust, C, C++ |
| Web Frameworks | 21 | Next.js, Express, NestJS, Spring Boot, ASP.NET, Laravel, FastAPI, Gin, Actix, Axum |
| ORMs | 16 | Prisma, TypeORM, Sequelize, Django ORM, Entity Framework, Eloquent |
| Pattern Detectors | 101+ | API, Auth, Security, Errors, Logging, Testing, and more |
See SUPPORTED_LANGUAGES_FRAMEWORKS.md for the full list.
Drift runs 100% locally. Your code never leaves your machine.
- β All analysis happens on your computer
- β No code sent to external servers
- β
Data stored in
.drift/folder only - β
Optional anonymous telemetry (disable with
drift telemetry disable)
- Wiki β Full documentation
- MCP Tools Reference β All 50 MCP tools
- CLI Reference β All CLI commands
- FAQ β Common questions
Open Core β Free for individuals and small teams.
- Core packages: Apache 2.0 (open source)
- Enterprise features: BSL 1.1 (converts to Apache 2.0 after 4 years)
See licenses/LICENSING.md for details.
Stop fixing AI output. Start shipping.