ctx-drift

ctx-drift is a command for Claude Code from knitli/toolshed. It costs 16 tokens per session (667 once invoked), scanned A, original, MIT.

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 for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: mentions CLAUDE.md; mentions AGENTS.md; mentions Gemini CLI.

Part of the ctx plugin — 2 skills, 5 commands, 2 agents shipped together

Good fit Use it to compare named files, one file against all discovered files, or context files belonging to selected tool ecosystems.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/knitli/toolshed/ctx-drift
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.

Clone the repo
git clone --depth 1 https://github.com/knitli/toolshed

Made for: Claude Code.

Or install ctx, the plugin that ships this one along with the rest of its 2 skills, 5 commands, 2 agents.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/knitli/toolshed/ctx-drift/github.svg)](https://agentmods.dev/commands/knitli/toolshed/ctx-drift)
Your own site
<a href="https://agentmods.dev/commands/knitli/toolshed/ctx-drift"><img src="https://agentmods.dev/badge/commands/knitli/toolshed/ctx-drift/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 ctx-drift

Your own site · 80×15
<a href="https://agentmods.dev/commands/knitli/toolshed/ctx-drift"><img src="https://agentmods.dev/badge/commands/knitli/toolshed/ctx-drift.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. 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.00016 $0.00667
Opus 5.5 $0.00006 $0.00267
Sonnet 5.5 $0.00003 $0.00133
Haiku 4.5 $0.00002 $0.00067

Measured 1mo ago against content hash 4e18e06d4635, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 yesterday), licensed MIT. It adds 16 tokens to every session and 667 once invoked, about $0.0001 per session on Opus 5.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.