How it works
๐ฎ Claude Code antipattern detector & auto-patcher โ learns from session logs, patches CLAUDE.md, tracks rule effectiveness
npx -y skills add cmg8431/claude-dejavu --skill how-it-worksAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Explain how claude-dejavu detects antipatterns and learns rules. Use when the user asks "how does dejavu work?" or "what is this thing doing?".
SKILL.md
2.1 KB, as published. Nobody here has run it
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)
-
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.
-
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.
-
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.mdin 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.