drift-scan

drift-scan is a command for Claude Code from felvieira/claude-skills-fv. It costs 59 tokens per session (1,027 once invoked), scanned A, original, Apache-2.0.

A codebase-wide scan for gradual maintenance problems, such as unused code, oversized files, old TODOs, outdated dependencies, documentation mismatches, and missing tests.

In plain words
What is it for?
Use it periodically for a full scan or run selected checks with options such as custom file-size thresholds and JSON output.
Why use it?
It finds issues that change-based checks may miss because they have accumulated across the whole codebase over time.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the dev-team-kit-fv plugin — 72 skills, 45 commands, 16 agents, 5 hooks shipped together

Good fit Use it periodically for a full scan or run selected checks with options such as custom file-size thresholds and JSON output.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add felvieira/claude-skills-fv
Claude Code
/plugin install dev-team-kit-fv

Made for: Claude Code.

Or install dev-team-kit-fv, the plugin that ships this one along with the rest of its 72 skills, 45 commands, 16 agents, 5 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for drift-scan

README.md
[![agentmods](https://agentmods.dev/badge/commands/felvieira/claude-skills-fv/drift-scan/github.svg)](https://agentmods.dev/commands/felvieira/claude-skills-fv/drift-scan)
Your own site
<a href="https://agentmods.dev/commands/felvieira/claude-skills-fv/drift-scan"><img src="https://agentmods.dev/badge/commands/felvieira/claude-skills-fv/drift-scan/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for drift-scan

Your own site · 80×15
<a href="https://agentmods.dev/commands/felvieira/claude-skills-fv/drift-scan"><img src="https://agentmods.dev/badge/commands/felvieira/claude-skills-fv/drift-scan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,027 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00059 $0.01027
Opus 5 $0.00030 $0.00513
Sonnet 5 $0.00012 $0.00205
Haiku 4.5 $0.00006 $0.00103

Measured 12d ago against content hash e7a6439034dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

drift-scan scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/drift-scan.md · 89 lines

How it starts

The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/drift-scan — Continuous Drift Detection

Objetivo: detectar drift gradual que os hooks no change-time (PreToolUse, PostToolUse) não pegam. Rodar contra todo o codebase periodicamente.

Inspirado em Birgitta Böckeler (Thoughtworks) — "continuous drift sensors that monitor what gradually accumulates: dead code, dependency staleness, test coverage degradation". Ver docs/inspiration/harness-engineering.md.

Sensores disponíveis

Sensor O que detecta Custo
large-files Arquivos > 400 linhas (configurável) s
dead-code Arquivos com exports sem importadores detectados s-min
stale-todos TODOs/FIXMEs > 90 dias (via git blame) min
dep-staleness Deps com major version atrasada (npm outdated) min
doc-code-drift Docs referenciando arquivos que não existem mais s
test-coverage Arquivos sem teste correspondente s

Como invocar

/drift-scan                                     # full scan, todos os sensores
/drift-scan --only large-files,stale-todos      # apenas 2 sensores
/drift-scan --threshold-lines 500               # threshold custom
/drift-scan --format json                       # output JSON

Execute

Rode o script e mostre o output:

node "${CLAUDE_PLUGIN_ROOT}/scripts/drift-scan.mjs" $ARGUMENTS

Após o output, interprete os 3 maiores insights:

  1. Categoria com mais findings — sugerir próxima ação
  2. Finding crítico individual — se há finding de alta severity em arquivo central, destacar
  3. Tendência (se rodou antes) — comparar com scans anteriores se disponível

Quando rodar

  • Semanal durante desenvolvimento ativo
  • Antes de release (gate adicional além dos quality-gates normais)
  • Após mergir branch grande (drift acumulado durante o branch)
  • Sob suspeita — quando algo parece estranho mas você não sabe o quê

Pareando com outros comandos

Finding Próximo comando
Muitos large-files /simplify ou /run-program refactor-safely
Muitos dead-code Revisão manual (sensor pode ter false positives) — verificar dynamic imports antes de deletar
Muitos stale-todos /auto pra resolver os críticos ou converter em issues
dep-staleness com major bumps /run-program refactor-safely por dep
doc-code-drift /auto para atualizar docs ou deletar referências
Pouca cobertura Skill 05 (/test) ou skill 37 (TDD)

Read the full file on GitHub · 89 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 89 lines · 59 tokens per session scan A e7a6439034dc

Subscribe to this mod's changes

drift-scan is a command published in the GitHub repository felvieira/claude-skills-fv (23 stars, last pushed today), licensed Apache-2.0. It adds 59 tokens to every session and 1,027 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.