Detects intent drift in AI-assisted development by comparing the original goal against the current plan and execution context. Evaluates whether ongoing work has drifted from what was asked.
Ships in shauryagangrade-intent-drift-skill. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A skill that uses the Intent Alignment Engine to detect whether an AI coding agent's current work has drifted from the user's original goal.
0. Gather inputs (ask only what you cannot infer from the repo):
--original-goal (required): the user's stated objective, or infer from the
conversation / issue / PR description if available.--current-plan (required): what is actually being built right now (steps, branch
purpose, recent edits), or infer from git state + recent messages.--context / --auto-context: execution evidence (edited files, git diff, recent
commands). With --auto-context, collect automatically (see scripts/collect_context.py).
Auto-context is repo-only by default: git diff, commits, edited files, and file
changes. Your shell history is never read unless you pass --include-shell-history.
That opt-in is deliberate — .bash_history / .zsh_history can contain credentials
typed into a shell and commands unrelated to the current repo, so it stays off unless
explicitly requested. Auto-collected context is also scrubbed by default: secret-like
content (tokens, password=/api_key= assignments, Authorization: headers, long
base64 blobs) is masked before it reaches the analyzer and report exporters. To disable
the scrub (not recommended), construct ContextCollector(sanitize_secrets=False).--format (text | markdown | json): output format.--threshold (default 75): minimum alignment % to be considered "on track".Do NOT ask if enough is inferable from the repo + conversation — infer and state your assumptions.
1. Build the context and call the analyzer:
python3 ~/.claude/skills/intent-drift/analyzer.py \
--original-goal "Reduce memory usage" \
--current-plan "Optimize startup latency" \
--context "Edited: main.py, startup.py. Recent: pip install numpy, cProfile main.py" \
--format text
Or in Python:
sys.path.insert(0, str(Path.home() / ".claude" / "skills" / "intent-drift"))
from analyzer import IntentDriftAnalyzer
a = IntentDriftAnalyzer()
rep = a.analyze(a.parse_arguments([
"--original-goal", "Reduce memory usage",
"--current-plan", "Optimize startup latency",
]))
print(a.export_report(rep, "text"))
2. Report to the user:
3. If drift is detected, surface it clearly and suggest pausing to confirm intent before continuing — do not silently keep building the off-track plan.
Nine evidence providers each inspect the same context and emit weighted Evidence
(value 0–100, confidence 0–1). The engine computes a weighted score, a consistency-based
confidence, a status band, and a recommendation. Providers live in providers/,
exporters in exporters/, and auto context collection in scripts/collect_context.py.
| Provider | Weight | What it checks |
|---|---|---|
| goal_provider | 0.25 | Semantic overlap between goal and plan |
| constraint_provider | 0.20 | Constraints satisfied / violated |
| scope_provider | 0.15 | Scope expansion or reduction |
| execution_provider | 0.15 | Commands / edits / reasoning vs goal |
| file_graph_provider | 0.10 | File relationships and patterns |
| dependency_provider | 0.10 | Dependency install/remove vs goal |
| architecture_provider | 0.10 | Architectural change patterns |
| requirement_coverage_provider | 0.08 | Success criteria coverage |
| problematic_findings_provider | 0.07 | Cross-provider problematic patterns |
--auto-context so evidence reflects real repo state, not just prose.| File | Purpose |
|---|---|
analyzer.py | CLI + IntentDriftAnalyzer (parse → analyze → export) |
providers/ | 9 evidence providers + base.py |
exporters/ | text / markdown / json report exporters |
scripts/collect_context.py | Repo-only context collection (git diff, commits, edited files, file changes) with default-on secret scrubbing; shell history is opt-in via --include-shell-history |
config/defaults.yaml | Thresholds, weights, enabled providers |
metadata.json | Importable skill metadata (params, deps) |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/shauryagangrade-intent-drift-skill:intent-driftfrom shauryagangrade-intent-drift-skill
shauryagangrade-intent-drift-skill@awesome-skills-plugins-for-students is listed by studentsuite/awesome-skills-plugins-for-students — review the source before installing
npx claudepluginhub studentsuite/awesome-skills-plugins-for-students --plugin shauryagangrade-intent-drift-skillOther plugins' skills for the same job