Skip to content

sebhaan/drift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Drift

Version Control for the AI Agent Era

DOI

Drift animation


Git was designed in 2005 for a world where humans typed every character of code. Twenty years later, AI coding agents produce a growing share of production software, and the fundamental question of version control has changed.

It is no longer sufficient to track what lines were modified. Teams need to know what was intended, who or what fulfilled that intent, and whether the approach was sound.

Drift is a version control system built from the ground up for this new reality.

Core Ideas

  • Intent-first. The primary object is a goal, not a snapshot. Code changes are downstream artifacts of goals.
  • Session-native. AI agent interactions (conversations, reasoning, tool calls, cost) are first-class data, not metadata bolted onto commits.
  • Semantic, not textual. Drift understands code at the structural level via tree-sitter. It parses, diffs, and merges at the AST level.
  • Multi-agent aware. Multiple agents and humans work concurrently with semantic conflict resolution that understands intent overlap, not just line overlap.
  • No LLM required. Every feature works without a language model. An optional provider interface lets configured models enhance search, suggest merges, and generate summaries. But the tool never breaks because an API is down.
  • Radically simple surface. Twelve commands. One configuration file. Learnable in ten minutes.

Data Model

Drift replaces git's commit with an intent -- a goal plus the work that fulfilled it, plus a status (achieved, abandoned, superseded). Intents are immutable and content-addressable.

Where git sees text diffs, Drift sees structural changes: functions added, types modified, parameters renamed, dependencies upgraded. This makes merging smarter, blame more useful, and review more meaningful.

Workspace
  └── Stream (replaces branches)
        └── Intent (replaces commits)
              ├── Session (agent interaction record)
              │     ├── Conversation trace
              │     ├── Tool calls & results
              │     └── Reasoning steps
              ├── Changeset (semantic diff)
              │     ├── Structural changes (functions added/modified/removed)
              │     ├── Dependency changes
              │     └── Raw file changes (fallback for non-code files)
              └── Snapshot (full state reference, content-addressable)

Architecture

Drift is structured as an eight-layer system, each with a well-defined responsibility:

Layer Responsibilities
CLI / Interface Twelve core commands. Status dashboard. Interactive conflict resolver. IDE plugin API.
Intent Engine Manages the directed acyclic graph of intents. Handles status transitions. Full-text search index.
Session Recorder Captures AI agent interactions via the Drift Agent Protocol. Redaction engine for privacy.
Semantic Engine Parses source code via tree-sitter. Computes semantic diffs. Performs semantic merge. Maintains CodeGraph.
Storage Engine Content-addressable blob store. Tiered lifecycle management (hot, warm, cold). Large file handling.
Sync / Transport Push and pull over HTTPS or SSH. Resumable transfers. Git bridge mode for dual-write compatibility.
Config / Policy Parses drift.toml. Enforces stream policies. Runs automation hooks. File behaviours for lock files.
Identity / Signing SSH-based key management. Multi-party attribution (human + agent + platform). Cryptographic signing.

Implemented in Rust for performance, memory safety, and single-binary distribution.

12 Core Commands

Command Purpose Git Equivalent
drift init Initialize a workspace or clone from remote git init / git clone
drift begin Start a new intent with a goal description (no equivalent)
drift save Create a checkpoint within the current intent git stash (loosely)
drift finish Complete the current intent git add -A && git commit
drift abandon Mark current intent as abandoned (preserved in history) git reset / git revert
drift log Show intent history with goals, status, agents git log
drift replay Replay the session that produced an intent (no equivalent)
drift rewind Jump to a checkpoint within a session git checkout / git reset
drift search Full-text search across intents, sessions, and code git log --grep / git grep
drift stream Create, switch, or list streams git branch / git switch
drift flow Integrate work between streams (semantic merge) git merge
drift sync Push and pull in a single command git push / git pull

What's intentionally missing: No staging area. No rebase. No force push. No detached HEAD. No cherry-pick. History is append-only -- you cannot lose work.

Documentation

Contributing

See CONTRIBUTING.md for how to get involved.

Author

Sebastian Haan

Licence

Code is licensed under the Apache License 2.0. Documentation and whitepaper content are licensed under CC BY 4.0.

About

Drift is a version control system built from the ground up for the AI agent era. It replaces git's commit with an intent, uses a semantic engine to understand code at the structural level, and captures AI agent sessions as first-class data.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors