Skip to content
| Marketplace
Sign in
Visual Studio Code>SCM Providers>DriftScopeNew to Visual Studio Code? Get it now.
DriftScope

DriftScope

blueczar

|
4 installs
| (0) | Free
Semantic logic drift detection in your git history — see not just what changed, but what it means.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

◈ DriftScope

Semantic logic drift detection for VS Code — see not just what changed, but what it means.

VS Code Marketplace License: MIT


What is DriftScope?

git diff shows you lines. DriftScope shows you meaning.

It scans your file's entire git history and surfaces risk-prone semantic changes like:

Detection What it catches
🔴 AST Signature/Condition Change Function/condition changes detected via AST
🔴 Return Value Change return { a, b } changed to return { a }
🔴 Condition Added New guard or branch added to logic
🔴 Functional Change Call arguments or signature changed
🟡 Algorithm Change Loop/comparator/recursion changes
🟡 New Function Added New function/method/class introduced
🔴 Dependency Change package.json dependencies changed

No external APIs. Pure static diff heuristics. Fast.


Usage

Right-click any file → DriftScope: Analyze This File

Or open Command Palette → DriftScope: Analyze This File

Or run DriftScope: Compare Branches for This File

Or run DriftScope: Export HTML Timeline after analysis

For AI refinement (beta): run DriftScope: Set OpenAI API Key and enable driftscope.ai.enabled. If AI is off, the panel shows “AI off (quality may vary)”.

Or click the $(history) DriftScope button in the status bar.


Features

  • 🎯 WebView panel with severity-coded event cards (click to expand diffs)
  • 🌲 Activity Bar tree view grouped by detector type
  • 🔦 Inline gutter decorations showing drift severity at a glance
  • 🧭 Severity filters (All/High/Medium/Low) in the panel header
  • 🧾 Blame context on events (author + commit)
  • 🧮 Risk score per commit to highlight riskiest changes
  • 🧠 AST-aware semantic diff for TS/JS (signature/condition/algorithm changes)
  • 🌿 Branch-to-branch mode to compare one file across two branches
  • 📤 HTML timeline export for sharing drift snapshots
  • 🤖 AI-assisted refinement (beta) for severity + reasoning (optional)
  • ✅ Business Logic Change badge (AI only)
  • ⚡ Fast — analyzes 200 commits in under 2 seconds

Configuration

{
  // Max commits to scan per file
  "driftscope.maxCommits": 200,
  "driftscope.analysisScope": "module",

  // Which detectors to run
  "driftscope.enabledDetectors": [
    "astSemantic",
    "returnChange",
    "conditionAdded",
    "algorithmChange",
    "functionalChange",
    "newFunction",
    "dependencyChange",
  ],

  // Show inline editor decorations
  "driftscope.showInlineDecorations": true,

  // Minimum severity to show: "low" | "medium" | "high"
  "driftscope.severityThreshold": "low",

  // File path patterns to ignore during analysis
  "driftscope.ignoreFilePatterns": [
    "/__tests__/",
    "/tests/",
    "/test/",
    ".test.",
    ".spec.",
    "jest.config",
    "vitest.config",
    "tsconfig",
    "webpack.config",
    "vite.config",
    "rollup.config",
    "babel.config",
    "eslint",
    "prettier",
    "postcss.config",
    "tailwind.config",
  ],

  // Function names to ignore when detecting functional changes
  "driftscope.ignoreFunctionNames": ["log", "logger", "console"],

  // Optional AI refinement (beta)
  "driftscope.ai.enabled": false,
  "driftscope.ai.provider": "openai",
  "driftscope.ai.model": "gpt-4o-mini",
  "driftscope.ai.endpoint": "https://api.openai.com/v1/chat/completions",
  "driftscope.ai.maxCommits": 30,
  "driftscope.ai.maxLines": 120,
  "driftscope.ai.timeoutMs": 20000,
  "driftscope.ai.hybrid": true,
  "driftscope.ai.lookbackDays": 180,

  // Optional repo URL for commit links (auto-detected if empty)
  "driftscope.repoUrl": "",

  // Optional GitHub PR diff integration for AI
  "driftscope.github.enabled": false,
  "driftscope.github.apiBase": "https://api.github.com",
  "driftscope.github.usePrDiff": true,
  "driftscope.github.maxDiffChars": 12000,
  "driftscope.github.token": ""
}

Notes:

  • To switch providers, set driftscope.ai.provider to openai, anthropic, or gemini.
  • For anthropic, use an endpoint like https://api.anthropic.com/v1/messages and set the API key.
  • For gemini, use an endpoint like https://generativelanguage.googleapis.com/v1beta/models/<model>:generateContent?key=YOUR_KEY and set the key.
  • If driftscope.ai.hybrid is false, AI generates events directly from diffs and heuristics are skipped.
  • driftscope.ai.lookbackDays controls how far back AI analyzes (default 180 days).
  • driftscope.analysisScope can be file (current file only) or module (entire folder of the file).
  • To use PR diffs automatically, enable driftscope.github.enabled and set a GitHub PAT via DriftScope: Set GitHub Token.

GitHub PAT setup:

  1. Go to GitHub → Settings → Developer settings → Personal access tokens.
  2. Create a token with repo scope (private repos) or public_repo (public only).
  3. In VS Code, run DriftScope: Set GitHub Token and paste the token.
  4. DriftScope stores the token locally in VS Code’s secret storage.

Demo

Workflow

  1. Open any file in your repo.
  2. Right-click → DriftScope: Analyze This File.
  3. Review high/medium/low events in the DriftScope panel.
  4. Click any event to expand its diff.
  5. Use the Activity Bar view to browse events by type.

Screenshots

DriftScope demo

Updating DriftScope

VS Code

  1. Open Extensions (⌘⇧X / Ctrl+Shift+X).
  2. Search for "DriftScope".
  3. Click Update (or run Extensions: Check for Updates).

Cursor

  1. Open Extensions (⌘⇧X / Ctrl+Shift+X).
  2. Search for "DriftScope".
  3. Click Update.

If you're installing from a VSIX:

  1. In VS Code/Cursor, run Extensions: Install from VSIX...
  2. Select the latest .vsix file and reload the window.

Development

git <>
cd driftscope
npm install
npm run compile
# Press F5 in VS Code to launch Extension Development Host

Adding Custom Detectors

  1. Create detectors/yourDetector.ts
  2. Export a function matching DetectorFn from types.ts
  3. Register it in engine.ts
import { CommitContext, DriftEvent, DetectorFn } from "../types";

export const myDetector: DetectorFn = (
  ctx: CommitContext,
): DriftEvent | null => {
  const { removed, added } = ctx.diff;
  // Your heuristic logic here
  return null;
};

Roadmap

  • [x] Severity filters in panel header
  • [x] Core logic detectors (return/condition/function/algorithm)
  • [x] Ignore test/config files and noisy functions
  • [x] Dependency change detection
  • [x] Blame context in event cards
  • [x] Risk score per commit
  • [x] git blame integration for line-level mapping
  • [x] AST-aware semantic diff (Phase 2)
  • [x] Branch-to-branch comparison mode
  • [x] HTML timeline export
  • [x] AI-assisted refinement (beta)
  • [ ] GitHub Actions CI integration

Author

Sagar Jain

License

MIT © Sagar Jain

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft