Drift
Drift is the byte-level difference between what’s currently in .claude/
and what the active profile’s source files would resolve to. Drift accrues
when you (or a tool) edit files inside .claude/ directly instead of editing
the profile source — the live tree pulls away from the canonical bytes.
C3P treats drift as a first-class signal. Two mechanisms surround it:
- The drift report — a read-only inspection produced by
c3p driftand summarised inc3p status. - The drift gate — a prompt or hard refusal that blocks
c3p useandc3p syncwhen drift exists, so an unconscious swap can’t silently throw away your edits.
How drift is detected
Section titled “How drift is detected”For each file in .claude/:
- Compute the resolved-and-merged bytes the active profile would produce.
- Compare to the bytes on disk.
- If they differ, mark the file as drifted; record the contributing profile in the drift report.
The check is read-only and never writes to disk.
The drift gate
Section titled “The drift gate”When a swap is requested:
| Drift state | Interactive (TTY) | Non-interactive (CI) |
|---|---|---|
| No drift | Swap proceeds. | Swap proceeds. |
| Drift present | Prompt: discard / persist / abort. | Refuses with exit 1 unless --on-drift=<choice> is passed. |
The three choices:
discard— drop the drifted edits; resolve the active profile fresh and overwrite.persist— write the drifted bytes back into the active profile’s source tree first, then proceed with the swap so nothing is lost.abort— make no change.
The non-TTY refusal is intentional: a CI script that doesn’t pass
--on-drift would otherwise hang on a hidden prompt.
What drift is not
Section titled “What drift is not”Drift is not the same as a stale source. Stale source means the
active profile’s source bytes have changed (e.g. via git pull) and
.claude/ hasn’t picked them up yet — fixed by c3p sync.
Drift means the live tree was edited directly. Status surfaces both as
distinct signals.
See also
Section titled “See also”c3p drift— per-file reportc3p status— short summaryc3p use— drift-gated swapc3p sync— drift-gated re-materialize