Skip to content
Back to skills

How It Works

ASecurity

Explain how claude-dejavu detects antipatterns and learns rules. Use when the user asks "how does dejavu work?" or "what is this thing doing?".

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added May 26, 2026
ai-agentssqldatabase

Works with

  • claude code

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned May 27, 2026

npx -y skills add cmg8431/claude-dejavu --skill how-it-works --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of How It Works?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for How It Works
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/cmg8431-how-it-works/badge)](https://www.skillsdirectory.com/skills/cmg8431-how-it-works)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: how-it-works
description: Explain how claude-dejavu detects antipatterns and learns rules. Use when the user asks "how does dejavu work?" or "what is this thing doing?".
---

# 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

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

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.