/ Annuaire / Playground / drift
● Communauté dadbodgeoff ⚡ Instantané

drift

par dadbodgeoff · dadbodgeoff/drift

Give Claude long-term memory of your codebase's conventions and past decisions — across every session, not just today's.

drift is a codebase-intelligence MCP server. It scans your repo, extracts patterns and conventions (naming, error handling, layering), and remembers architectural decisions across sessions so every new chat inherits your team's context. Works offline as a CLI too.

Pourquoi l'utiliser

Fonctionnalités clés

Démo en direct

Aperçu en pratique

drift.replay ▶ prêt
0/0

Installer

Choisissez votre client

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "drift": {
      "command": "uvx",
      "args": [
        "drift"
      ],
      "_inferred": true
    }
  }
}

Ouvrez Claude Desktop → Settings → Developer → Edit Config. Redémarrez après avoir enregistré.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "drift": {
      "command": "uvx",
      "args": [
        "drift"
      ],
      "_inferred": true
    }
  }
}

Cursor utilise le même schéma mcpServers que Claude Desktop. La config projet l'emporte sur la globale.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "drift": {
      "command": "uvx",
      "args": [
        "drift"
      ],
      "_inferred": true
    }
  }
}

Cliquez sur l'icône MCP Servers dans la barre latérale Cline, puis "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "drift": {
      "command": "uvx",
      "args": [
        "drift"
      ],
      "_inferred": true
    }
  }
}

Même format que Claude Desktop. Redémarrez Windsurf pour appliquer.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "drift",
      "command": "uvx",
      "args": [
        "drift"
      ]
    }
  ]
}

Continue utilise un tableau d'objets serveur plutôt qu'une map.

~/.config/zed/settings.json
{
  "context_servers": {
    "drift": {
      "command": {
        "path": "uvx",
        "args": [
          "drift"
        ]
      }
    }
  }
}

Ajoutez dans context_servers. Zed recharge à chaud à la sauvegarde.

claude mcp add drift -- uvx drift

Une seule ligne. Vérifiez avec claude mcp list. Supprimez avec claude mcp remove.

Cas d'usage

Usages concrets : drift

Onboard an AI assistant to your codebase's conventions

👤 Tech leads tired of reminding Claude 'no, we don't use classes here' ⏱ ~20 min beginner

Quand l'utiliser : First session on a new repo, or after a big refactor that changed conventions.

Prérequis
  • drift installed — uvx drift or install globally
Déroulement
  1. Run the initial scan
    Run drift scan on this repo. Tell me what patterns you detected around error handling, module structure, and naming.✓ Copié
    → Concrete convention summary with examples
  2. Record decisions you want preserved
    Record these team decisions: we use Result<T,E> not exceptions, one controller per feature folder, snake_case for file names. Tag them 'conventions'.✓ Copié
    → Confirmation; entries queryable later
  3. Verify future sessions pick it up
    In a new session: what conventions does this repo follow?✓ Copié
    → Claude recites the decisions you recorded

Résultat : Every future AI session starts with your team's conventions loaded — fewer corrections, more productive chats.

Pièges
  • Patterns are inferred from existing code, including bad code — Review the initial scan and delete any 'conventions' that are actually tech debt you're trying to escape
  • Decision memory drifts from reality if you forget to update it — Treat memory entries like docs — review quarterly
Combiner avec : filesystem · github

Enforce team conventions during PR review

👤 Code reviewers ⏱ ~10 min intermediate

Quand l'utiliser : Before approving a PR, check it didn't silently break team patterns.

Déroulement
  1. Load this PR's diff
    Load the diff for PR #213 and compare it against the conventions drift has recorded.✓ Copié
    → List of convention-matches and misses
  2. Draft review comments for deviations
    For each deviation, draft a polite review comment citing the convention.✓ Copié
    → Comment text per finding

Résultat : Consistent PR reviews without the reviewer having to remember every unwritten rule.

Pièges
  • New patterns may be intentional — don't be dogmatic — Let the author override with a 'new pattern' decision that gets recorded for future PRs
Combiner avec : github

Maintain a lightweight architecture decision log

👤 Any team that keeps forgetting why choices were made ⏱ ~5 min beginner

Quand l'utiliser : Instead of a formal ADR folder no one updates.

Déroulement
  1. Record a decision when made
    Record decision: we picked Postgres over DynamoDB because of ad-hoc query needs. Date today. Tags: db, architecture.✓ Copié
    → Entry saved with ID
  2. Query later when the question returns
    Why did we pick Postgres?✓ Copié
    → The stored decision surfaces

Résultat : Institutional memory that survives turnover.

Combinaisons

Associez-le à d'autres MCPs pour un effet X10

drift + filesystem

drift knows the conventions, filesystem does the edits

Using the conventions drift has recorded, refactor src/api/users.ts to match. Use filesystem to apply edits.✓ Copié
drift + github

Review incoming PRs against recorded conventions

Fetch PR #88, check it against drift conventions, draft review comments for any drift.✓ Copié

Outils

Ce que ce MCP expose

OutilEntréesQuand appelerCoût
scan_codebase path: str First session, or after large refactors free; CPU-bound
list_conventions tag?: str Load context at session start free
record_decision title: str, body: str, tags?: str[] When team agrees on something non-obvious free
query_memory query: str When Claude should recall past context free (local embeddings)
detect_pattern area: str Ad-hoc 'how do we normally do X here?' free

Coût et limites

Coût d'exécution

Quota d'API
None — fully local
Tokens par appel
Convention summaries: ~1k tokens. Full scan dumps can be 10k+
Monétaire
Free and open source
Astuce
Load summary conventions at session start, not the full scan. Full scan only on refactor.

Sécurité

Permissions, secrets, portée

Stockage des identifiants : Local SQLite or filesystem only
Sortie de données : None by default — runs fully offline

Dépannage

Erreurs courantes et correctifs

Scan hangs on a large monorepo

Exclude generated and vendor directories via .driftignore (same syntax as .gitignore).

Vérifier : drift scan --dry-run
Memory query returns nothing relevant

Rebuild local embeddings index; new decisions don't surface until indexed.

Vérifier : drift reindex
Claude doesn't use recorded conventions

Make sure the MCP is listed first in your client config so its context loads at the start of every session.

Vérifier : claude mcp list

Alternatives

drift vs autres

AlternativeQuand l'utiliserCompromis
MARM-SystemsYou want general cross-session memory not specific to codeLess code-aware; more general notes
llm-context.pyYou want rule-driven code bundling rather than memoryNo persistence layer
Plain ADRs in the repoYou prefer docs-as-codeAI has to read them each session — higher token cost

Plus

Ressources

📖 Lire le README officiel sur GitHub

🐙 Voir les issues ouvertes

🔍 Parcourir les 400+ serveurs MCP et Skills