ctx-drift

A comparison command for AI context files used by different coding tools. It looks for contradictions, missing information, and inconsistencies between files such as CLAUDE.md, GEMINI.md, and AGENTS.md.

In plain words
What is it for?
Use it to compare named files, one file against all discovered files, or context files belonging to selected tool ecosystems.
Why use it?
Keeping several instruction files aligned is difficult, and disagreements can make different coding agents behave differently in the same project.

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/knitli/toolshed/ctx-drift
Clone the repo
git clone --depth 1 https://github.com/knitli/toolshed
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 667 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.00667
Opus 5 $0.00008 $0.00333
Sonnet 5 $0.00003 $0.00133
Haiku 4.5 $0.00002 $0.00067

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

Security

Grade A, and why

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

plugins/ctx/commands/ctx-drift.md · 60 lines

How it starts

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

/ctx:drift — Cross-Document Drift Detection

Find contradictions, gaps, and inconsistencies between AI context files from different tool ecosystems.

Arguments

$ARGUMENTS

  • No arguments: discover all context files, then compare every pair.
  • File paths (e.g., /ctx:drift CLAUDE.md GEMINI.md AGENTS.md): compare only the named files against each other. At least two files are needed for a meaningful comparison.
  • Ecosystem names (e.g., /ctx:drift claude-code cursor): compare all context files belonging to those ecosystems.
  • Single file (e.g., /ctx:drift CLAUDE.md): compare that file against every other discovered context file to find where it disagrees.

Instructions

First, identify all memory and instruction files in the repo (run discovery if needed). If the user provided arguments above, restrict comparison to the specified files or ecosystems. Then compare them against each other.

Comparison process

For each pair of context files that describe the same project:

1. Identify shared topics. Do both files discuss: project architecture? Dependencies? Build commands? Directory structure? Language support? Deployment targets? Testing approach?

2. Compare factual claims on shared topics.

  • Version numbers: do they cite the same versions?
  • Architecture descriptions: do they describe the same patterns?
  • Technology references: do they name the same tools/frameworks?
  • Path references: do they point to the same locations?
  • Command references: do they list the same commands?

3. Flag contradictions. Where file A explicitly says X and file B explicitly says Y about the same thing. Include both quotes and explain the conflict.

4. Flag gaps. Where file A covers a significant topic (a core dependency, a major architectural decision, a deployment model) that file B omits entirely. This usually means file B predates a change. Note which file is likely more current based on modification dates and content depth.

Also check for

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

Subscribe to this mod's changes

ctx-drift is a command published in the GitHub repository knitli/toolshed (1 stars, last pushed 4mo ago), licensed MIT. It adds 16 tokens to every session and 667 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-31.