How drift works
From a local checkout,driftless context get --diff matches changed files against workspace topics using their explicit paths and glob anchors. With --mark, matching reviewed topics are marked drifted with a human-readable reason.
For example, if local work changes src/auth/guard.ts and src/auth/service.ts, the auth-flow topic anchored to src/auth/** can become:
Drifted: local changes touchsrc/auth/guard.tsandsrc/auth/service.ts.
Explicit local drift
The CLI reports drift from your local checkout:--mark is opt-in and explicit. Plain --diff only displays, so work-in-progress never flips team state unless you ask. It’s idempotent (already-drifted topics are left alone).
A nudge, not an alarm
Drift is a nudge, not an error: “the code under this topic moved, worth a look.” It tolerates false positives by design: trust the code, and only update the topic if the change actually altered how the area works. A deleted anchor file produces a distinct nudge: “anchored file deleted: re-anchor or archive this topic.”Lifecycle
driftless syncsurfaces persisted drift to every team member- An agent or human reviews the change
- If the context still holds, add it to knowledge (
--status reviewed) to make it fresh again - If no repo claims the topic anymore, it becomes orphaned
Checking for drift
What triggers drift?
What triggers drift?
Only an explicit local
context get --diff --mark call. Plain --diff retrieves matching context without changing workspace state.Can I manually mark a topic as drifted?
Can I manually mark a topic as drifted?
Yes. Run
driftless context get --diff --mark from the relevant checkout. Update the topic when its durable explanation changed; otherwise confirm that it is still current.What happens if a topic's anchored files are deleted?
What happens if a topic's anchored files are deleted?
Local pattern validation catches missing anchors when you write from the CLI.
context doctor also flags a zombie, an anchor pointing at nothing. Fix the patterns or archive the topic.