drift-analyst

drift-analyst is an agent for Claude Code from Redtropig/harness-anchor. It costs 93 tokens per session (2,697 once invoked), scanned A, original, MIT.

A read-only code review agent that looks for code drift: changes away from the project's written rules, duplicated logic, inconsistent error handling, stale documentation, and other maintenance problems.

In plain words
What is it for?
Use it after implementation to inspect changed code, compare it with golden-rules.md, find duplication or dead code, and recommend specific cleanup.
Why use it?
It provides an independent review after code is written, when the original author may overlook repeated or inconsistent patterns. It separates maintainability checks from tests and build checks.

Agent for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: mentions subagents; mentions AGENTS.md.

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 harness-anchor plugin — 14 skills, 9 commands, 5 agents, 5 hooks shipped together

Good fit Use it after implementation to inspect changed code, compare it with golden-rules.md, find duplication or dead code, and recommend specific cleanup.

Compare 6 agents 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 Redtropig/harness-anchor
Claude Code
/plugin install harness-anchor

Made for: Claude Code.

Or install harness-anchor, the plugin that ships this one along with the rest of its 14 skills, 9 commands, 5 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-analyst

README.md
[![agentmods](https://agentmods.dev/badge/agents/redtropig/harness-anchor/drift-analyst.svg)](https://agentmods.dev/agents/redtropig/harness-anchor/drift-analyst)
Your own site
<a href="https://agentmods.dev/agents/redtropig/harness-anchor/drift-analyst"><img src="https://agentmods.dev/badge/agents/redtropig/harness-anchor/drift-analyst.svg" alt="Measured on agentmods" height="20"></a>
Per session 93 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,697 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.00093 $0.02697
Opus 5 $0.00046 $0.01349
Sonnet 5 $0.00019 $0.00539
Haiku 4.5 $0.00009 $0.00270

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

Security

Grade A, and why

drift-analyst 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 8d 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.

agents/drift-analyst.md · 181 lines

How it starts

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

Drift Analyst

You are an independent, fresh-context drift / entropy scanner. You run after code is written and report where it has drifted from the project's golden rules or accumulated AI "slop" — with a concrete evidence path — then recommend fixes. You never refactor; you recommend.

Fresh context is the design: the agent who wrote the slop won't recognize it as slop. You did NOT write this code, so you read it adversarially for drift.

Where you sit (don't duplicate the other sensors)

Three read-only sensors divide the work; stay in your lane:

  • verification-runner (/verify) — does build / test / lint pass? (back-pressure)
  • coverage-analyst (/test-plan) — are the right things tested and actually run? (behaviour)
  • you (/gc) — has the code drifted: dead code, duplication, taste / golden-rule violations, doc-drift? (maintainability)

If a concern is really "is it tested?" or "does it build?", say so and defer to that sensor.

Your job

Known blind spot (doc-drift). The stale-claim check only extracts CALL/DEFINITION-SHAPED symbols — an identifier immediately followed by (. Two things fall outside it: a doc sentence that names no symbol at all ("the pool is fast", "startup is instant"), AND a doc claim naming a changed global variable, macro, enum constant, struct field, or typedef — none of those produce an extracted symbol either, so they're just as invisible. Language coverage is a whitelist, not everything: doc-drift-scan.sh diffs the extensions in its SCAN_PATHSPEC (C/C++, Python, JS/TS, Go, Rust, Ruby, Java, Kotlin, C#, shell as of v0.17.0). A change in a language off that list yields no symbol even when it IS call/definition-shaped — a language-scope gap, not a symbol-shape gap. Symbols under 3 characters are never searched either (v0.17.1): prefix matching makes their rows undecidable, so at() or id() changing is invisible here — the script names them on stderr rather than pretending it looked. Unlike v0.16.0, none of these gaps is silent: the script announces each on stderr, and step 4 below requires you to read it. A clean doc-drift section therefore means "no doc claim about a changed, 3+ character, function-shaped symbol in a scanned language looks stale", not "the docs were verified". Say it that way in the report.

Read the full file on GitHub · 181 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. 8d ago First seen · 181 lines · 93 tokens per session scan A 5a6d1af7f97d

Subscribe to this mod's changes

drift-analyst is an agent published in the GitHub repository Redtropig/harness-anchor (13 stars, last pushed 1mo ago), licensed MIT. It adds 93 tokens to every session and 2,697 once invoked, about $0.0005 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.

Related

Other agents, from other repositories

agent-reviewer

Senior Technical Lead and Security Auditor specializing in code quality, correctness, and security audits.

guanyang/open-agent-hub · 21 tokens

agent-refactorer

Principal Clean Code Specialist specializing in code simplification, performance tuning, and refactoring loops.

guanyang/open-agent-hub · 23 tokens

verifier

Fresh-eyes, coverage-first quality judge for sweep passes on any deliverable (code, UI, copy, video frames, research, prompts). Use PROACTIVELY after producing work, one invocation per dimension or lens. Give it the rubric (or the craft file path), the evidence (file paths, screenshot paths, run output), and the lens…

apoorvjain25/frontier · 87 tokens

star-chamber

Advisory multi-LLM craftsmanship council. Invoked for significant architectural decisions, design trade-off analysis, and multi-perspective code review of complex implementations.

peteski22/agent-pragma · 36 tokens

bug-hunter

Bug detection agent that analyzes code for potential bugs, logic errors, race conditions, edge cases, and reliability issues. Use after code is written or during review to find defects before they reach production.

rootwarp/claude-code-plugins-monorepo · 43 tokens

code-reviewer

Code review agent that reviews code changes for quality, correctness, security, and adherence to project conventions. Spawns bug-hunter and security-auditor in parallel for comprehensive review. Merges into develop when all findings are resolved. Use after code is written, before merging.

rootwarp/claude-code-plugins-monorepo · 59 tokens