drift-detect

drift-detect is a command for Claude Code from komunite/kalfa. It costs 28 tokens per session (1,096 once invoked), scanned A, original, MIT.

A configuration-audit command that scans Claude Code instructions, memory, settings, command records, and related files for drift. Drift means that stored rules and project files no longer agree with reality.

In plain words
What is it for?
Use it to check for conflicting rules, references to missing files or agents, stale memory, and commands or files that are not recorded properly.
Why use it?
It helps find outdated instructions, contradictions, broken references, and files that are no longer connected to the project configuration.

Command for Claude Code

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/komunite/kalfa/drift-detect
Clone the repo
git clone --depth 1 https://github.com/komunite/kalfa

Made for: Claude Code.

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-detect

README.md
[![agentmods](https://agentmods.dev/badge/commands/komunite/kalfa/drift-detect.svg)](https://agentmods.dev/commands/komunite/kalfa/drift-detect)
Your own site
<a href="https://agentmods.dev/commands/komunite/kalfa/drift-detect"><img src="https://agentmods.dev/badge/commands/komunite/kalfa/drift-detect.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 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,096 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.00028 $0.01096
Opus 5 $0.00014 $0.00548
Sonnet 5 $0.00006 $0.00219
Haiku 4.5 $0.00003 $0.00110

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

Security

Grade A, and why

drift-detect 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 5d 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.

.claude/commands/drift-detect.md · 99 lines

How it starts

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

Öz-izleme komutu. Tüm Claude Code yapılandırmanızı sapma açısından tarar — eski kurallar, çelişkiler, sahipsiz dosyalar ve yapılandırma tutarsızlıkları.

Adımlar

Adım 1: Sistem dosyalarını tara (paralel)

Tüm yapılandırma kaynaklarını eşzamanlı oku:

  • CLAUDE.md — proje talimatları
  • .claude/memory.md — aktif hafıza
  • .claude/knowledge-base.md — öğrenilmiş kurallar
  • .claude/settings.json — hook yapılandırması
  • .claude/command-index.md — komut kaydı (varsa)

Adım 2: Çelişkileri kontrol et

CLAUDE.md içinde:

  • Çelişkili talimatlar var mı? (örn. "her zaman X yap" ve "asla X yapma")
  • Var olmayan dosya veya dizinlere referanslar var mı?
  • Tanımlanmamış komut veya agent'lara referanslar var mı?

CLAUDE.md ve Bilgi Tabanı arasında:

  • Bilgi Tabanı, CLAUDE.md ile çelişen kurallar içeriyor mu?
  • Her iki dosyada tekrarlanan kurallar var mı?

Hafıza ve gerçeklik arasında:

  • Hafıza, artık var olmayan görevlere, dosyalara veya durumlara referans veriyor mu?
  • Açıkça eski olan "mevcut odak" öğeleri var mı?

Adım 3: Sahipsiz dosyaları kontrol et

Şunları tara:

  • Sahipsiz komutlar: .claude/commands/ içinde olup command-index.md'de referans verilmeyen dosyalar
  • Sahipsiz agent'lar: Hiçbir komut veya skill'in çağırmadığı agent tanımları
  • Sahipsiz skill'ler: Hiçbir komut, agent veya CLAUDE.md tarafından referans verilmeyen skill'ler
  • Ölü referanslar: Var olmayan dosya, URL veya yol isimleri
  • Kullanılmayan hook'lar: Var olan ama settings.json'da bağlanmamış hook betikleri

Adım 4: Eskimişliği kontrol et

  • Memory.md: "Şimdi" bölümü 3 günden eski mi?
  • Bilgi Tabanı girdileri: Güncel olmayan araçlara, API'lere veya kalıplara referans veren var mı?
  • Günlük Notlar: Arşivlenmesi gereken 30+ günlük günlük notlar var mı?
  • Görev Panosu: Bir haftadan fazla "devam ediyor" durumunda olan görevler var mı?

Adım 5: Yapılandırma sağlığını kontrol et

  • settings.json: Geçerli JSON mı? Tüm hook betikleri çalıştırılabilir mi?
  • CLAUDE.md boyutu: Çok mu büyüyor? (>500 satır uyarıdır)
  • Memory.md boyutu: Sınırlar içinde mi? (<100 satır hedef)
  • Bilgi Tabanı boyutu: Sınırlar içinde mi? (<200 satır hedef)

Read the full file on GitHub · 99 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. 5d ago First seen · 99 lines · 28 tokens per session scan A 42b82efb5622

Subscribe to this mod's changes

drift-detect is a command published in the GitHub repository komunite/kalfa (244 stars, last pushed 4mo ago), licensed MIT. It adds 28 tokens to every session and 1,096 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.