dead-end-registry · Hooks para Claude Code | Prompt Studio
    1. Claude Code
    2. Hooks
    3. dead-end-registry
    Claude Code · HooksUserPromptSubmit

    dead-end-registry

    Recuerda los enfoques que ya fallaron.

    por Karan Bansal

    UserPromptSubmitPreToolUseStop

    Licencia: MITVer original

    Instalación

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

    Contenido

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

    Más en Hooks

    • Formatear al editar

      Ejecuta Prettier sobre cada archivo que Claude edita o crea.

    • Bloquear archivos .env

      Impide que Claude lea o edite archivos de secretos.

    • Aviso al terminar

      Notificación de escritorio en macOS cuando Claude termina.

    • Chequeo de tipos al editar

      Corre tsc después de editar archivos TypeScript y muestra los errores.

    • Contexto al iniciar

      Carga la rama y los últimos commits al abrir una sesión.

    • Registro de comandos

      Guarda cada comando de shell en un log para auditoría.

    Ver todo en Hooks (621) →

    Tu colección definitiva de prompts de IA. Inspírate, explora ejemplos y crea con IA.

    Hubs principales

    • Prompts
    • Imágenes
    • Videos
    • Generar Videos
    • Plantillas
    • Animaciones
    • Precios
    • Conoce
    • Afiliado

    Explorar por tipo

    • Kits de componentes
    • Etiquetas de imagen
    • Etiquetas de video
    • Webs

    Temas populares

    • Música
    • Portafolio
    • Gaming
    • Viajes
    • Nano Banana Pro

    Legal

    • Términos de uso
    • Política de privacidad
    • Política de cookies
    • Política de licencias
    • Política de reembolsos
    • Términos del programa de afiliados
    • Términos de Crowdfunding

    Magzin LLC, 800 Third Avenue Associates, New York, NY, 10022, United States

    © 2026 Prompt Studio by Magzin. Todos los derechos reservados.