Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By carloluisitov0.1.0MITIn 1 marketplace
Tells Claude when the git repository moved — branch, HEAD, or an in-progress merge or rebase — since your previous turn in the session. Local only, no network.
Run automatically on Claude Code events. Claude doesn't decide.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Tells Claude when the git repository moved under it — a different branch, a different commit, or a merge or rebase now in progress — since your previous turn in the same session.
The problem it solves is narrow. You switch branches in another terminal, or finish a rebase, and then keep talking to a session that still believes it is on the branch it saw twenty minutes ago. Nothing on screen says otherwise, so the next answer is reasoned from a tree that no longer exists: files it read are stale, a patch it offers does not apply, a "you already have that function" is about code that is now on a different branch. This plugin notices the move and states it, once, before your next prompt is answered.
/plugin marketplace add https://github.com/carloluisito/claude-plugins
/plugin install repo-drift@carloluisito-plugins
Requires node and git on your PATH. Nothing else — no dependencies, no
config.
Restart Claude Code after installing. Hooks are registered when a session starts, so in the session where you install the plugin nothing is tracked.
One UserPromptSubmit hook, and nothing
else. Every time you submit a prompt it takes a fingerprint of the repository —
HEAD points at,detached HEAD,— compares it against the fingerprint from your previous turn in this session, and if anything differs, prepends a short note to the model's context:
Repository state changed since your previous turn in this session:
branch: main -> feat/auth
HEAD: a1b2c3d -> 9f8e7d6
Files read earlier in this session may no longer match what is on disk.
You do not see this. It goes to the model, not to your terminal.
Then it stores the new fingerprint, so the same move is reported once and not on every subsequent prompt.
The note is phrased as an observation, never as an instruction. Injected context is invisible, and an instruction that steers a turn with nothing on screen to explain why is worse than no note at all. The model is free to decide the change is irrelevant — which it often is.
Reported:
| Change | Example |
|---|---|
| Branch | git checkout -b feat/auth, git switch main |
HEAD commit | a new commit, git pull, reset --hard, rebase finishing |
Detached HEAD | git checkout <sha> or a tag |
| Operation started | a merge that stopped on conflicts, a paused rebase |
| Operation ended | that rebase being finished or aborted |
Not reported:
If Claude runs git checkout on your behalf, the next prompt reports that as
drift. There is no attempt to distinguish changes Claude caused from changes you
caused, and the hook has no way to: it sees the repository, not the reason.
This is mildly redundant rather than wrong — the model reading that HEAD moved
to the commit it just created costs a line of context. Suppressing it would mean
inferring intent from tool history, which risks the failure that matters more:
silently swallowing a real change because something adjacent looked deliberate.
The hook is on the interactive path — every prompt you submit waits for it — so what it costs is part of its contract.
It makes one git rev-parse call, which reads refs, and four stat calls.
Both are O(1) in the size of your worktree. git status would answer more
questions and is deliberately not used: it walks the whole tree, so the cost
would scale with the repository and the plugin would get slower exactly where
people need their editor to stay fast. That is the trade for not reporting
uncommitted edits.
Measured on Windows with tests/bench.mjs (20 invocations, median of the whole
hook process — spawn, stdin, git, state write, exit):
| Repository | Median |
|---|---|
| 1 tracked file | 173 ms |
| 30,000 tracked files | 137 ms |
The two are the same number within noise — the larger repository measured
faster — which is the claim being checked. Nearly all of it is Node process
startup, not git. For contrast, a single git status --porcelain in that 30,000
file repository takes 82 ms on top of the same startup, and unlike the above it
grows with the tree.
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub carloluisito/claude-plugins --plugin repo-driftPlugins from other owners that cover similar ground