-
Notifications
You must be signed in to change notification settings - Fork 59
Configuration
Customize Drift for your project.
Drift stores configuration in .drift/config.json:
{
"version": "2.0.0",
"project": {
"id": "uuid-generated-on-init",
"name": "my-project",
"description": "Optional project description",
"initializedAt": "2024-01-01T00:00:00.000Z"
},
"severity": {},
"ignore": [
"node_modules/**",
"dist/**",
"**/*.test.ts"
],
"ci": {
"failOn": "error",
"reportFormat": "text"
},
"learning": {
"autoApproveThreshold": 0.95,
"minOccurrences": 3,
"semanticLearning": true
},
"performance": {
"maxWorkers": 4,
"cacheEnabled": true,
"incrementalAnalysis": true,
"cacheTTL": 3600
},
"features": {
"callGraph": true,
"boundaries": true,
"dna": true,
"contracts": true
}
}| Option | Type | Default | Description |
|---|---|---|---|
project.id |
string | auto-generated | Unique project identifier (UUID) |
project.name |
string | folder name | Project display name |
project.description |
string | - | Optional project description |
project.initializedAt |
string | auto-set | ISO timestamp of initialization |
| Option | Type | Default | Description |
|---|---|---|---|
ignore |
array | see below | Glob patterns to exclude from scanning |
include |
array | - | Glob patterns to include (allowlist mode) |
Default ignore patterns:
[
"node_modules/**",
"dist/**",
"build/**",
".git/**",
"coverage/**",
"*.min.js",
"*.bundle.js",
"vendor/**",
"__pycache__/**",
".venv/**",
"target/**",
"bin/**",
"obj/**"
]Allowlist mode: If include is specified, ONLY those paths are scanned. This takes precedence over ignore patterns.
| Option | Type | Default | Description |
|---|---|---|---|
ci.failOn |
string | "error" |
Severity that causes CI failure: error, warning, info, none
|
ci.reportFormat |
string | "text" |
Output format: text, json, sarif, github
|
ci.uploadResults |
boolean | false |
Upload results to dashboard |
| Option | Type | Default | Description |
|---|---|---|---|
learning.autoApproveThreshold |
number | 0.95 |
Auto-approve patterns above this confidence (0-1) |
learning.minOccurrences |
number | 3 |
Minimum occurrences before pattern is detected |
learning.semanticLearning |
boolean | true |
Enable semantic learning |
Note: learning.autoApproveThreshold is the recommended way to auto-approve patterns. Set to 1.0 to disable auto-approval, or lower (e.g., 0.8) to be more permissive.
| Option | Type | Default | Description |
|---|---|---|---|
performance.maxWorkers |
number | 4 |
Maximum parallel workers |
performance.cacheEnabled |
boolean | true |
Enable caching |
performance.incrementalAnalysis |
boolean | true |
Enable incremental scanning |
performance.cacheTTL |
number | 3600 |
Cache TTL in seconds |
| Option | Type | Default | Description |
|---|---|---|---|
features.callGraph |
boolean | true |
Enable call graph analysis |
features.boundaries |
boolean | true |
Enable data boundary scanning |
features.dna |
boolean | true |
Enable styling DNA analysis |
features.contracts |
boolean | true |
Enable API contract verification |
Exclude files from scanning. Uses the same syntax as .gitignore.
Important: Drift automatically respects your .gitignore patterns. You don't need to duplicate them in .driftignore. The .driftignore file is for additional exclusions specific to Drift scanning.
# .driftignore - Additional exclusions for Drift
# (Your .gitignore patterns are already respected automatically)
# Test files (if you don't want patterns from tests)
*.test.ts
*.spec.ts
__tests__/
# Generated files
*.generated.ts
*.d.ts
# Large data files Drift shouldn't analyze
*.sql
*.csv
fixtures/How it works:
- Drift reads both
.gitignoreand.driftignore - Patterns from both files are combined
- Files matching EITHER pattern are excluded from scanning
- This is the default behavior β no configuration needed
| Variable | Description |
|---|---|
DRIFT_CONFIG |
Path to config file |
DRIFT_CACHE_DIR |
Cache directory |
DRIFT_LOG_LEVEL |
Log level: debug, info, warn, error |
DRIFT_NO_COLOR |
Disable colored output |
DRIFT_PARALLEL |
Number of parallel workers |
Register multiple projects:
drift projects add ~/code/backend --name backend
drift projects add ~/code/frontend --name frontendEach project has its own .drift/ directory and configuration.
drift projects switch backend
drift status # Shows backend status- name: Drift Check
run: |
npm install -g driftdetect
drift init --yes
drift scan
drift check --ci --fail-on warning --format githubdrift:
script:
- npm install -g driftdetect
- drift init --yes
- drift scan
- drift check --ci --fail-on warning --format gitlab# .husky/pre-commit
drift check --staged --fail-on error{
"mcp": {
"rateLimit": {
"global": 100,
"expensive": 10
}
}
}{
"mcp": {
"cache": {
"enabled": true,
"ttl": 300000,
"maxSize": 100
}
}
}By default, Drift automatically detects your project's languages and only exposes relevant MCP tools. A TypeScript project won't see Go, Rust, C++, PHP, or Java tools β reducing AI context overhead from 49 tools to ~35.
How it works:
- On MCP server startup, Drift scans for language markers (package.json, Cargo.toml, go.mod, etc.)
- Only language-specific tools for detected languages are exposed
- Core tools (patterns, status, context, etc.) are always available
Override detection:
{
"mcp": {
"tools": {
"languages": ["typescript", "python"],
"include": ["drift_go"],
"exclude": ["drift_wpf"],
"all": false
}
}
}| Option | Type | Description |
|---|---|---|
languages |
array | Override detected languages |
include |
array | Additional tools to include |
exclude |
array | Tools to exclude |
all |
boolean | Set true to disable filtering (expose all 49 tools) |
Supported languages: typescript, javascript, python, java, php, go, rust, cpp, csharp, wpf
{
"boundaries": {
"sensitiveFields": [
"ssn",
"social_security",
"tax_id",
"bank_account"
]
}
}{
"boundaries": {
"categories": {
"pii": ["email", "phone", "address"],
"financial": ["credit_card", "bank_account"],
"health": ["diagnosis", "prescription"],
"credentials": ["password", "api_key", "token"]
}
}
}# Reset to defaults
rm -rf .drift
drift init
# Keep patterns, reset config only
rm .drift/config.json
drift init --yes- Cortex V2 Overview
- Memory Setup Wizard
- Memory CLI
- Universal Memory Types
- Learning System
- Token Efficiency
- Causal Graphs
- Code Generation
- Predictive Retrieval
- Architecture
- Call Graph Analysis
- Impact Analysis
- Security Analysis
- Data Boundaries
- Test Topology
- Coupling Analysis
- Error Handling Analysis
- Wrappers Detection
- Environment Variables
- Constants Analysis
- Styling DNA
- Constraints
- Contracts
- Decision Mining
- Speculative Execution
- Watch Mode
- Trends Analysis
- Projects Management
- Package Context
- Monorepo Support
- Reports & Export
- Dashboard
- 10 Languages
- 21 Frameworks
- 16 ORMs
- 400+ Detectors
- 50+ MCP Tools
- 60+ CLI Commands
- 23 Memory Types