Skip to main content
plugin

dead-end-registry — Claude Code plugin: what it does, how to install

dead-end-registry stores reverted code changes and alerts you before retrying failed ideas. Keeps track of discarded approaches and detour token costs per repository.

MIT ★ 586 updated 2026-10-26

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add karanb192/claude-code-hooks
/plugin install dead-end-registry@claude-code-hooks
Open on GitHub

What dead-end-registry does

When a run finishes or context compacts, the hook asynchronously parses session transcripts at Stop, SubagentStop, and PreCompact. It catalogs abandoned attempts together with reasons, timestamps, and estimated token costs based on 0.000009 USD per token. Logs live locally in ~/.claude/dead-end-registry/<repo>.jsonl, so no notes leak into version control.

During prompt submission, UserPromptSubmit checks text against recorded dead ends and inserts a warning card if keywords match. When Claude Code tries to edit or write files, PreToolUse halts and demands confirmation via ask if the diff reintroduces a previously removed hunk.

All rules rely on hardcoded defaults rather than environment variables. Entries past 60 days expire automatically, while cards display up to 3 matching items. Run /dead-end-registry:dead-ends at any time to inspect the full list of recorded missteps for your workspace.

What it helps with

  • Prevent repeating discarded code changes and broken architectural paths
  • Intercept edits that reintroduce previously reverted code hunks
  • Track token expenses spent on abandoned experiments across sessions
  • Retain negative knowledge without committing scratchpad notes into git

Example prompts for the agent

  • /dead-end-registry:dead-ends
  • Let's switch this endpoint to use server-sent events
  • Review all discarded approaches for this repository

How to install dead-end-registry

Plugin marketplace

/plugin marketplace add karanb192/claude-code-hooks
/plugin install dead-end-registry@claude-code-hooks

Step by step, with commands for each platform: Claude Code plugins: marketplaces, installing, and building your own

Questions about dead-end-registry

How to install dead-end-registry in Claude Code?

Run /plugin marketplace add karanb192/claude-code-hooks and then execute /plugin install dead-end-registry@claude-code-hooks. Restart Claude Code to complete setup.

What does dead-end-registry do?

It indexes failed and reverted attempts from session transcripts, then flags matching prompts or blocks diffs that resurrect discarded code.

Where does the plugin store its data?

Records stay on your computer under ~/.claude/dead-end-registry/<repo>.jsonl. The tool makes zero outbound network requests.

Source text

dead-end-registry · MIT
# dead-end-registry

> Remembers approaches you tried and reverted (with reason and estimated token cost) and warns before you retry them.

On `Stop`, `SubagentStop`, and `PreCompact` the hook mines the session transcript for approaches you TRIED and then REVERTED or ruled out, recording each with its reason, date, and an estimated token cost of the detour into a per-repo registry. On `UserPromptSubmit` it keyword-matches the new prompt against that registry and injects a "DEAD END: you already tried this" card via `additionalContext`. On `PreToolUse` (Edit|Write) it returns an `ask` decision when the pending diff would reintroduce a previously-reverted hunk. Extraction is deterministic (revert-signal heuristics plus tool-result scanning); an optional model pass is never required and never runs in tests.

## Install

```
/plugin marketplace add karanb192/claude-code-hooks   # once per machine
/plugin install dead-end-registry@claude-code-hooks
```

Restart Claude Code, done. (Or from a shell: `claude plugin install dead-end-registry@claude-code-hooks`.)

## What it does

| Event | Runs | What happens |
|-------|------|--------------|
| UserPromptSubmit | sync | Matches the prompt against the registry; injects a "you already tried this" warning card when it hits a recorded dead end. |
| PreToolUse (Edit\|Write) | sync | Returns permission decision `ask` when the diff would reintroduce a previously-reverted hunk. |
| Stop | async (zero added latency) | Mines the transcript for abandoned approaches into the per-repo registry. |
| SubagentStop | async (zero added latency) | Same mining, at subagent stop. |
| PreCompact | async (zero added latency) | Same mining, before context is compacted away. |

`/dead-end-registry:dead-ends` renders this repo's recorded dead ends, newest first, each with the date tried, why it was walked back, and the estimated token cost of the detour.

## Configuration

No environment variables. Behavior is governed by in-source constants with these defaults:

- `MAX_AGE_DAYS` = 60: entries older than this are ignored on read and dropped at compaction.
- `MAX_CARD_ENTRIES` = 3: entries shown in an injected card.
- `MAX_REGISTRY_ENTRIES` = 500: entries scanned on prompt-submit.
- `MAX_CODE_LINES` = 80 / `MAX_CODE_CHARS` = 4000: truncation caps on stored code snapshots.
- `USD_PER_TOKEN` = 0.000009: rough blended rate for the headline cost figure.

State is stored per-project (keyed by a hash of the repo path) under `~/.claude/dead-end-registry/<repo>.jsonl`, outside the repo so nothing is accidentally committed.

## Data & privacy

Recorded: short summaries and truncated code snapshots of reverted approaches, plus reason, date, and an estimated token cost, all mined from your local transcripts. Everything stays on your machine: the hook makes no network calls.

## Uninstall

```
/plugin uninstall dead-end-registry@claude-code-hooks
```

© Karan Bansal · MIT · karanb192/claude-code-hooks

Similar plugins

All plugins for Agent setup: memory, context, orchestration →

From the same set28

The whole set →
protect-tests protect-tests blocks the "fake green" trap: stops the agent from deleting, renaming, or skipping tests instead of fixing the code. Works with pytest, jest, Go, JUnit, RSpec, and more. ★ 586repo stars git-safety git-safety — a PreToolUse Bash hook for Claude Code that intercepts destructive git and gh CLI actions before execution. ★ 586repo stars protect-secrets protect-secrets — a PreToolUse hook that checks every Read, Edit, Write, Bash and Grep call and blocks .env, SSH keys or cloud credentials — or asks you first. ★ 586repo stars bounty-board bounty-board turns TODO and FIXME comments into bounties that grow in XP value as they age. Scans your repo, prices each debt marker by git-blame age, and feeds the top 3 into your session as side quests. ★ 586repo stars standup-autopilot The standup-autopilot plugin turns agent session transcripts into a daily standup card with tasks, tests, PRs, and blockers. Open blockers carry into the next session. ★ 586repo stars pr-provenance-stamp pr-provenance-stamp appends a provenance receipt to your pull request body: prompts, estimated spend, test exit codes and an agent-versus-human line split. ★ 586repo stars dead-rules-audit dead-rules-audit tracks how Claude Code adheres to CLAUDE.md rules during edits and flags chronically violated items. ★ 586repo stars nerf-receipts The nerf-receipts plugin tracks tool failures, repeated edits to the same file, and tokens per task. Use it to see whether those signals shift when the model changes. ★ 586repo stars

Project sponsors

Companies that keep this analytics open