drift

A post-implementation check that compares code with OpenSpec specifications, which are written descriptions of how the project should behave. It reports gaps, outdated references, and files not covered by the specifications.

In plain words
What is it for?
Use it after tests pass and an OpenSpec baseline exists to check whether the implementation still matches the project's specifications.
Why use it?
It helps identify when the finished code and the project's documented expectations have drifted apart.

Command

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 commands/clay-good/openlore/drift
Clone the repo
git clone --depth 1 https://github.com/clay-good/OpenLore
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 751 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.00016 $0.00751
Opus 5 $0.00008 $0.00376
Sonnet 5 $0.00003 $0.00150
Haiku 4.5 $0.00002 $0.00075

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

Security

Grade A, and why

drift 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.

examples/spec-kit/commands/drift.md · 88 lines

How it starts

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

openlore: Drift Check

Run this command after /speckit.implement and only once tests are green.

It compares the implementation against existing OpenSpec specifications and reports gaps, stale references, and uncovered files.

No specs yet? If openlore generate has not been run on this project, this command will report everything as uncovered — that is expected and not a problem.

What to do: Run openlore generate $PROJECT_ROOT now to create a spec baseline from the current codebase. Once generated, re-run this command — future drift checks will be meaningful. A baseline only needs to be created once.

Prerequisites

  1. openlore MCP server configured in your AI agent settings
  2. Tests passing — do not run drift check on a red test suite
  3. openlore analyze run at least once (same requirement as orient)

User Input

$ARGUMENTS

If a project directory is provided, use it. Otherwise use the current working directory.

Step 1 — Check spec baseline

ls $PROJECT_ROOT/openspec/specs/ 2>/dev/null | wc -l

If 0 specs found:

"No OpenSpec specs exist yet. Running check_spec_drift now will flag all files as uncovered, which is not actionable.

Run openlore generate $PROJECT_ROOT first to create a spec baseline, then re-run this command. The generate step takes a few minutes and only needs to be done once."

Ask: "Run openlore generate now? (yes/no)"

  • Yes → trigger generate, then proceed to Step 2
  • No → stop here, remind user to run it before next drift check

If specs exist: proceed.

Step 2 — Confirm tests are green

Ask the user: "Are all tests passing?"

If the answer is no: "Run tests first and fix any failures. Drift check is only meaningful on a green test suite." Stop here.

Step 3 — Run drift check

openlore check_spec_drift
  directory: $PROJECT_ROOT

Step 4 — Interpret results

Drift type Meaning Action
uncovered on new files New code not yet in any spec Note for post-sprint spec update
gap on existing domain Existing spec missing coverage of new behaviour Run openlore generate --domains $DOMAIN
stale Spec references a function that no longer exists Fix the reference in the spec file
No drift ✅ Implementation matches specs Done

Read the full file on GitHub · 88 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 · 88 lines · 16 tokens per session scan A 4d2bd3661079

Subscribe to this mod's changes

drift is a command published in the GitHub repository clay-good/OpenLore (290 stars, last pushed 2d ago), licensed MIT. It adds 16 tokens to every session and 751 once invoked, about $0.0001 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.