From ClaudeDrift
Audit this project's Claude artifacts (CLAUDE.md, skills, commands, agents, hooks/settings, .mcp.json, and native/MCP memory) for drift from the project's actual reality — both broken references AND context drift (stale architecture/workflow/convention descriptions) — using Claude's reasoning via subagents, then produce a ranked report and offer to apply fixes.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-drift:drift-check [--user] [--apply] [--changed] [path][--user] [--apply] [--changed] [path]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Audit every Claude artifact that steers this project and report where it has
Audit every Claude artifact that steers this project and report where it has drifted from the project's actual reality. The source of truth is the codebase you are invoked from. This is done by reasoning, not by a deterministic script — Claude reads the artifacts and the real code and judges drift, via subagents.
Three kinds of drift matter:
Arguments ($ARGUMENTS):
--user — also audit ~/.claude artifacts (separate, clearly-marked section).--changed — only audit artifacts changed since the last commit (git diff),
for cheap re-runs.--forward-only — spotlight only the Legacy narration class: a focused
forward-looking cleanup that reports the ⚪ band alone (broken/stale findings are
suppressed). Use when the goal is to make artifacts read present-tense, not to
chase broken references.--apply — apply accepted fixes without a second prompt.$CLAUDE_PROJECT_DIR.The target project dir is $ARGUMENTS's path, else $CLAUDE_PROJECT_DIR, else the
current working directory.
Spawn the claude-flow-mapper subagent (Task tool, subagent_type: "claude-flow-mapper") on the project dir (pass --user if given). It returns the
artifact inventory, a projectReality grounding summary, install-state caveats,
a driftLikelihood rating per artifact, and a memorySystems list — the memory
systems it inferred from the project's own artifacts + MCP config (native file
memory under ~/.claude/projects/<proj>/memory/ and/or memory MCP servers). Native
memory files come back as normal artifacts of type: "memory" and are audited like
any other; MCP-backed memory has no files, so its drift is caught when docs that
route to it are audited against the MCP config.
If it finds no Claude artifacts, say so and stop. If installState has caveats
(deps not installed, submodule uninitialized), surface them first — note that
findings may include false positives until installed, and offer to run the install
(don't run it without the user's go-ahead).
If --changed was passed, intersect the inventory with git -C <dir> diff --name-only
(and untracked) to keep only artifacts that changed.
Spawn a drift-auditor subagent per artifact (Task tool, in parallel — one
message, multiple Task calls), passing artifactPath, projectDir, and the
projectReality summary from Step 1.
Prioritize and budget — don't blindly spawn dozens:
high/medium drift-likelihood.low/none too, but in later batches; cap concurrency to ~8 at a time.Each auditor reasons about the artifact against the real code and returns findings
(reference, context, and legacy-narration drift) with evidence and an exact
old → new edit.
If --forward-only was passed, tell each auditor in its prompt to focus on the
Legacy narration class and skip reference/context findings — the goal is a
present-tense cleanup, not a reference hunt.
Collect every auditor's findings and reason over them yourself — merge duplicates, drop anything an auditor already judged a false positive, and rank by severity and confidence. Group:
--forward-only, show only this band.For each finding show: the artifact (relative path), the claim, the reality, the
evidence (file:line), and the proposed edit. Keep project-scope and --user
scope in separate sections. End with per-severity counts; if there are no findings,
report "✅ No significant drift detected." Optionally write the report to
.claude/drift-report.md.
If memorySystems came back from Step 1, add a one-line "Memory systems detected"
note to the report (e.g. "native auto-memory (12 topic files) + qdrant MCP") so the
user can see what was covered. Memory findings themselves slot into the normal
severity bands; flag a memory file naming a moved/removed file/function as 🔴/🟠 just
like any other artifact.
List the findings that carry a concrete suggestedEdit. If --apply was given,
apply them; otherwise ask which to apply (all / by number / none).
To apply: re-read the artifact, then use Edit with old_string = suggestedEdit.old, new_string = suggestedEdit.new. Apply one at a time; if the
old_string isn't an exact unique match (e.g. a prior edit shifted things), skip
it and flag for manual fixing — never apply a fuzzy edit, never apply a finding
with no suggestedEdit. After applying, briefly re-verify the edited artifacts
(re-read, or re-spawn an auditor on them) and report what changed and what still
needs manual attention.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub marky291/claude-drift --plugin claude-drift