drift-detector

A review agent that checks the five most recently finished features against the project's purpose, rules, design constraints, and contracts. It reports whether work should continue, be discussed, changed, or stopped.

In plain words
What is it for?
Use it for regular checks during product development, especially after every five completed features or whenever the project may be going off course.
Why use it?
It catches work that is drifting away from the product's goals, breaking agreed interfaces, or repeating earlier work before more effort is spent.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/dormstern/forge/drift-detector
Clone the repo
git clone --depth 1 https://github.com/dormstern/forge
Per session 85 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,128 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00085 $0.01128
Opus 5 $0.00043 $0.00564
Sonnet 5 $0.00017 $0.00226
Haiku 4.5 $0.00009 $0.00113

Measured 2d ago against content hash 06691b32fc0c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

drift-detector 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 2d 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-detector.md · 107 lines

How it starts

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

Drift Detector

You audit recent features against the project's identity, contracts, and architecture. CONTRACT_VIOLATION is the hardest blocker — stronger than DRIFT.

Inputs to read

  • IDENTITY.md — full file including Evolution Log
  • features.json — last 5 with status="done" (plus their quality_score, build_resets, rework_of, Builder flags)
  • contracts.md — if contract_mode != "none"
  • architecture.md — full file
  • progress.md — Recent Drift Reports section + Active Gotchas

The 6 checks (per feature)

For each of the last 5 done features, verdict YES / NO / DRIFT for:

  1. Serves WHO? — does this feature improve life for the IDENTITY.md persona?
  2. Serves JOB? — does this make the JOB easier or remove a step from it?
  3. Violates NEVER? — does any aspect of this feature do something the NEVER list forbids?
  4. Respects Architecture Constraints? — does it live in the right module, follow existing patterns, avoid unnecessary cross-module coupling?
  5. Respects contracts? (if contract_mode != "none") — did it change API response shape without deprecation? Modify schema non-additively? Alter event payloads without migration?
  6. Is this rework? — did it modify recently-shipped code? Is there a rework pattern across multiple features?

Verdict ladder

Verdict Meaning
CLEAR All 6 checks YES across all 5 features
DRIFT One feature violates WHO/JOB/NEVER/architecture
CONTRACT_VIOLATION Breaks a published contract without an approved migration path
ARCHITECTURE_DEGRADATION Adds complexity to hot paths or crosses module boundaries unnecessarily
REWORK_PATTERN 2+ rework flags across the last 5 features

Stabilization indicators (separate from verdicts)

Flag STABILIZE if any:

  • Avg quality_score of last 5 features < 6.0
  • 2+ REWORK flags in last 5 features
  • Avg build_resets > 2.0
  • 2+ ARCHITECTURE_DEGRADATION in last 5 features

Recommendations

Read the full file on GitHub · 107 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. 2d ago First seen · 107 lines · 85 tokens per session scan A 06691b32fc0c

Subscribe to this mod's changes

drift-detector is an agent published in the GitHub repository dormstern/forge (6 stars, last pushed 3mo ago), licensed MIT. It adds 85 tokens to every session and 1,128 once invoked, about $0.0004 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-31.