how-it-works

how-it-works is a skill for Claude Code from cmg8431/claude-dejavu. It costs 40 tokens per session (505 once invoked), scanned A, original, MIT.

An explanation of how claude-dejavu watches coding-agent sessions for repeated mistakes and suggests rules. It describes detectors for repeated errors, edit-and-revert cycles, and quiet corrections, then tracks whether the rules help.

In plain words
What is it for?
Use it when someone asks how claude-dejavu works, why it suggested a rule, or how session mistakes become rules in CLAUDE.md.
Why use it?
It makes the tool’s pattern detection and rule-learning process understandable instead of leaving its decisions unexplained.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions CLAUDE.md; mentions Claude Code.

Part of the claude-dejavu plugin — 6 skills, 4 hooks shipped together

Good fit Use it when someone asks how claude-dejavu works, why it suggested a rule, or how session mistakes become rules in CLAUDE.md.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cmg8431/claude-dejavu/how-it-works
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.

Any agent
npx skills add cmg8431/claude-dejavu --skill how-it-works
Clone the repo
git clone --depth 1 https://github.com/cmg8431/claude-dejavu

Made for: Claude Code.

Or install claude-dejavu, the plugin that ships this one along with the rest of its 6 skills, 4 hooks.

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 how-it-works

README.md
[![agentmods](https://agentmods.dev/badge/skills/cmg8431/claude-dejavu/how-it-works/github.svg)](https://agentmods.dev/skills/cmg8431/claude-dejavu/how-it-works)
Your own site
<a href="https://agentmods.dev/skills/cmg8431/claude-dejavu/how-it-works"><img src="https://agentmods.dev/badge/skills/cmg8431/claude-dejavu/how-it-works/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 how-it-works

Your own site · 80×15
<a href="https://agentmods.dev/skills/cmg8431/claude-dejavu/how-it-works"><img src="https://agentmods.dev/badge/skills/cmg8431/claude-dejavu/how-it-works.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 505 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.00040 $0.00505
Opus 5 $0.00020 $0.00253
Sonnet 5 $0.00008 $0.00101
Haiku 4.5 $0.00004 $0.00051

Measured 11d ago against content hash ba9d6edd5bac, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

how-it-works 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 11d 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.

plugin/skills/how-it-works/SKILL.md · 49 lines

What it actually says

How claude-dejavu works

Explain the following to the user:

What it does

claude-dejavu watches your Claude Code sessions for repeated mistakes. When it detects a pattern — like the same error happening across sessions, or code being reverted back and forth — it creates a rule and patches your CLAUDE.md so Claude doesn't make that mistake again.

The 3-step loop

[Session Logs]          [Pattern Detection]        [Rule Suggestion]
tool usage data  ──▶  antipattern detectors  ──▶  CLAUDE.md patch
     ▲                                                  │
     │               [Effectiveness Tracking]            │
     └──────  rule fire counting  ◀─────────────────────┘

3 Detectors (v0)

  1. Revert Cycle — Claude edits a file, then someone reverts it, then Claude edits it again. Sign that Claude isn't checking existing logic before changing things.

  2. Repeated Error — The same error message keeps appearing across sessions (e.g., "command not found: npm" in a pnpm project). Claude keeps falling into the same trap.

  3. Silent Fix — Claude finishes work, then the user quietly edits the same file without saying anything. The user is correcting Claude's output through action, not words. This is the killer feature that differentiates dejavu from other tools.

Where data lives

  • Rules database: ~/.local/share/claude-dejavu/dejavu.db (SQLite)
  • Session buffers: ~/.local/share/claude-dejavu/buffers/ (temporary)
  • Output: CLAUDE.md in your project root

Rule format in CLAUDE.md

<!-- dejavu:rule id=r-001 -->
<!-- dejavu:evidence sessions=[a3f, 9d2] confidence=0.91 fires=4 -->

- This project uses pnpm, not npm. Run pnpm install not npm install.
  ↳ Learned from 4 repeated errors across 3 sessions.

The HTML comments are metadata that Claude ignores but dejavu reads/writes for tracking.

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. 11d ago First seen · 49 lines · 40 tokens per session scan A ba9d6edd5bac

Subscribe to this mod's changes

how-it-works is a skill published in the GitHub repository cmg8431/claude-dejavu (2 stars, last pushed 3mo ago), licensed MIT. It adds 40 tokens to every session and 505 once invoked, about $0.0002 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.

Related

Other skills, from other repositories

ccs-align

Run the CCS Align seat's hourly breathing cycle — prove the local claude-mem worker is healthy, pull needle observations through search → timeline → getobservations, land them in a seat-owned middle cache via atomic grab → append → filter exclude-marks → replace, manage exclude marks, and walk house → project → seat…

thedotmack/claude-mem · 136 tokens

design-is

Audit a design against Dieter Rams' ten "Good design is..." principles, then hand off a /make-plan prompt for one of three outcomes — new design, refine design, or redesign. Use when the user says "audit this design", "design review", "check this UI against Rams", "is this UI good", "critique this design", "design…

thedotmack/claude-mem · 91 tokens

timeline-report

Generate a "Journey Into [Project]" narrative report analyzing a project's entire development history from claude-mem's timeline. Use when asked for a timeline report, project history analysis, development journey, or full project report.

thedotmack/claude-mem · 47 tokens

weekly-digests

Generate a serial week-by-week narrative digest of a project's full claude-mem timeline. Splits the timeline into per-ISO-week files, then runs one consecutive subagent per week — each receiving the prior week's carry-forward block — to produce one chapter per ISO week of data. Use when asked for "weekly digests"…

thedotmack/claude-mem · 93 tokens

mode-creator

Interactively create, install, activate, and verify custom claude-mem modes, including domain-specific observation types, concept tags, optional Telegram alerts, bot setup, worker restart, and startup-context verification. Use this whenever someone asks to customize what claude-mem remembers, create or change a mode…

thedotmack/claude-mem · 94 tokens

smart-explore

Token-optimized structural code search using tree-sitter AST parsing. Use instead of reading full files when you need to understand code structure, find functions, or explore a codebase efficiently.

thedotmack/claude-mem · 41 tokens