Skip to content
geoffrey fernald edited this page Feb 1, 2026 · 7 revisions

Drift β€” Codebase Intelligence for AI Agents

Make AI write code that actually fits your codebase.

Drift scans your code, learns your patterns, and gives AI agents deep understanding of your conventions. 50+ MCP tools. 60+ CLI commands. 10 languages. Native Rust core.


🚫 Delete Your AGENTS.md

That static AGENTS.md file you wrote once and forgot about? It's stale. Replace it with Cortex β€” a living memory system:

drift memory init
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, learns from corrections, confidence decays on stale knowledge

β†’ Learn about Cortex Memory | Memory CLI Reference


⚑ Quick Start (2 minutes)

# Install
npm install -g driftdetect

# Scan your project
cd your-project
drift init
drift scan

# See what Drift found
drift status

That's it. Drift now understands your codebase.

β†’ Full Getting Started Guide


πŸ€– Connect AI (5 minutes)

# Install MCP server
npm install -g driftdetect-mcp

Add to your AI tool's config:

{
  "mcpServers": {
    "drift": {
      "command": "driftdetect-mcp"
    }
  }
}

β†’ Full MCP Setup Guide


πŸ“Š Current Version: 0.9.40

Package Version npm
CLI (driftdetect) 0.9.40 npm
MCP Server (driftdetect-mcp) 0.9.39 npm
Core (driftdetect-core) 0.9.39 npm
Native (driftdetect-native) 0.9.39 npm

Upgrade: npm install -g driftdetect@latest driftdetect-mcp@latest


The Problem

AI writes code that works but doesn't fit. It ignores your conventions, misses your patterns, and creates inconsistency. You spend more time fixing AI output than you saved.

Drift fixes this.


How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         YOUR CODEBASE                            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        1. DRIFT SCAN                             β”‚
β”‚   $ drift init && drift scan                                     β”‚
β”‚   Analyzes code with Tree-sitter parsing:                        β”‚
β”‚   β€’ Discovers patterns (how YOU write code)                      β”‚
β”‚   β€’ Builds call graph (who calls what, data flow)                β”‚
β”‚   β€’ Maps security boundaries (sensitive data access)             β”‚
β”‚   β€’ Tracks test coverage (which code is tested)                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      2. PATTERN LEARNING                         β”‚
β”‚   Drift discovers YOUR conventions:                              β”‚
β”‚   β€’ API patterns (routes, middleware, response format)           β”‚
β”‚   β€’ Auth patterns (decorators, guards, middleware)               β”‚
β”‚   β€’ Error patterns (try/catch, Result types, boundaries)         β”‚
β”‚   You approve what matters: $ drift approve <pattern-id>         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      3. AI GETS CONTEXT                          β”‚
β”‚   drift_context({ intent: "add_feature", focus: "auth" })        β”‚
β”‚   Returns:                                                       β”‚
β”‚   β€’ Your patterns with examples                                  β”‚
β”‚   β€’ Similar code in your codebase                                β”‚
β”‚   β€’ Files to modify                                              β”‚
β”‚   β€’ Security warnings                                            β”‚
β”‚   β€’ Constraints to satisfy                                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   4. AI WRITES FITTING CODE                      β”‚
β”‚   Generated code matches YOUR patterns automatically             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

What's Included

Category Count Details
Languages 10 TypeScript, JavaScript, Python, Java, C#, PHP, Go, Rust, C, C++
Web Frameworks 21 Express, NestJS, Next.js, Spring Boot, ASP.NET, Laravel, FastAPI, Gin, Echo, Actix, Axum, and more
ORMs 16 Prisma, TypeORM, Sequelize, Django ORM, Entity Framework, Eloquent, SQLAlchemy, and more
Pattern Detectors 400+ API, Auth, Security, Errors, Logging, Testing, Data Access, and more
MCP Tools 50 Organized in 7 layers for efficient AI interaction
CLI Commands 45+ Full analysis and management capabilities

β†’ Full Language Support


Key Features

Feature Description Learn More
Pattern Detection Discovers how YOU write code across 15 categories Pattern Categories
Cortex Memory AI memory system that learns from your codebase Cortex V2 Overview
Call Graph Maps function calls and data flow Call Graph Analysis
Security Analysis Tracks sensitive data access Security Analysis
Test Topology Maps tests to code Test Topology
Coupling Analysis Finds dependency cycles Coupling Analysis
Error Handling Detects unhandled errors Error Handling Analysis
Quality Gates CI/CD integration Quality Gates
MCP Server 50+ tools for AI agents MCP Tools Reference

Documentation

Getting Started

Core Concepts

Cortex Memory System

Analysis Features

AI Tools

Advanced Features

Reference

CI/CD

Community


Architecture Overview

Drift is a monorepo with a Rust core and TypeScript packages:

Rust Core

Crate Purpose
drift-core 12 native analysis modules
drift-napi Node.js bindings via NAPI

TypeScript Packages

Package npm Name Purpose
Core driftdetect-core Analysis orchestration + native bindings
Detectors driftdetect-detectors 400+ pattern detectors
CLI driftdetect Command-line interface
MCP driftdetect-mcp MCP server for AI agents
LSP driftdetect-lsp Language Server Protocol
Dashboard driftdetect-dashboard Web dashboard
Galaxy driftdetect-galaxy 3D visualization

Security & Privacy

Drift runs 100% locally. Your code never leaves your machine.

Aspect Details
Reads Source files in your project directory
Writes .drift/ directory only
Network No outbound calls for analysis
Telemetry Anonymous usage stats, opt-out with drift telemetry disable

License

Open Core model:

  • Core packages: Apache 2.0 (fully open source)
  • Enterprise features: BSL 1.1 (converts to Apache 2.0 after 4 years)

Individual developers and small teams use Drift completely free.

See licenses/LICENSING.md for details.


Links

Clone this wiki locally