Skip to main content

Code Drift

Code drift is how far a codebase — and the AI writing in it — has moved away from current, correct, well-understood truth: versions, APIs, and structure.

Code drift is the distance between a codebase and current, correct, well-understood truth. It is not one gap but three: the versions you run fall behind current releases (dependency drift), the context your AI assistant works from falls behind the versions you actually run (AI context drift), and the team's — and the AI's — picture of the code's structure falls behind what the code has become.

This is drift in code: it is not infrastructure or configuration drift, and not ML model drift.

Why It Matters Now

AI assistants write a large and growing share of production code, at machine speed, against "latest", generic, or hallucinated context. Every generated change can widen the gap: code that targets deprecated APIs, pulls stale dependencies, or misreads the structure of the very repository it is editing. Codebases drift from supported truth faster than teams can see it happening.

Measuring It

Code drift becomes manageable when it becomes a number. Vibgrate measures the dependency axis as a 0–100 DriftScore, maps the structural axis as a deterministic code graph, and closes the context axis by serving version-correct library docs to the AI from your own lockfile. Measured drift can be tracked, budgeted, and gated in CI.

Related Terms

Code drift is the umbrella over dependency drift and AI context drift; DriftScore quantifies the dependency axis, and the practice of measuring and acting on all three is Code Drift Intelligence.