Skip to main content
Glama
  1. Your AI gets stuck on the same problems again and again: a port already in use, an expired token giving a 401, a database that isn't running, a shell quoting error.

  2. Every new session works the fix out from scratch, spending your time and tokens on a problem someone already solved last week.

  3. Nobody writes the fix down, or it ends up in one person's notes where no agent ever finds it.

dejafix keeps the fix the first time it's found, and hands it to every agent and every person after that. Agents look up errors and propose the fixes they confirm, people review them in a web dashboard, and the runbook lives in your repo as plain Markdown, reviewed and kept in git like code.

It works with any app that supports MCP: Claude Code, Cursor, VS Code with Copilot, Codex, Windsurf and others. It also has a CLI for people and scripts.

Why dejafix

  • Local-first. No hosted service, no account, no network calls, no telemetry. The dashboard listens on localhost only.

  • Team-owned. One Markdown file per problem in .dejafix/ in your repo. Fixes go through review, then through your normal pull requests.

  • Reviewed by a person. What an agent proposes waits in the review queue. Lookups return only approved fixes unless you ask for more.

  • Safe to save. Before anything is written, tokens, keys, passwords, emails and connection strings are redacted. If something looks like a secret it can't classify, it refuses to save and says why.

  • No duplicates. A new fix that matches an existing one is caught, so you merge instead of piling up copies.

  • A proper dashboard. Review, search, edit, merge and retire fixes in a page that updates live.

Related MCP server: mcp-error-handler

Quick start

npx dejafix init          # creates .dejafix/ and prints the MCP config for your AI tool
npx dejafix dashboard     # opens the dashboard at http://localhost:4660

init lists what it will change and asks once (--yes skips the question). Add --hook to let Claude Code look up failed shell commands by itself, and --global to set up a runbook in ~/.dejafix that all your projects share.

Connect your AI tool

Claude Code

claude mcp add dejafix -- npx -y dejafix

or in .mcp.json at the root of your project:

{
  "mcpServers": {
    "dejafix": { "command": "npx", "args": ["-y", "dejafix"] }
  }
}

Cursor: .cursor/mcp.json

{
  "mcpServers": {
    "dejafix": { "command": "npx", "args": ["-y", "dejafix"] }
  }
}

VS Code: .vscode/mcp.json

{
  "servers": {
    "dejafix": { "type": "stdio", "command": "npx", "args": ["-y", "dejafix"] }
  }
}

On Windows, use "command": "cmd" with "args": ["/c", "npx", "-y", "dejafix"] (and claude mcp add dejafix -- cmd /c npx -y dejafix). dejafix init prints the right one for your computer.

How it works

 agent hits an error ──► lookup ──► known fix? ──yes──► tries it ──► record_use
                                        │
                                        no
                                        ▼
                         works it out ──► propose_fix ──► review queue ──► a person approves
                                                                                │
                                         every agent and person after that ◄───┘

The MCP server gives agents three tools, with one-line descriptions to keep their context small:

Tool

What it does

lookup

Takes an error message or raw error output and returns the best matching approved fixes. The error is normalized first (paths, ports, timestamps and ids are stripped), then matched against each fix's symptoms and title.

propose_fix

Records a fix the agent has just confirmed, as proposed, for a person to review. Similar existing fixes are returned instead of saving a duplicate.

record_use

Marks that a fix worked again (or didn't). It feeds the use count and the dashboard.

With dejafix init --hook, Claude Code runs a lookup itself whenever a Bash command fails, and shows any match to the agent before it starts digging.

Here is the whole loop with real MCP calls. The agent's build fails and lookup knows nothing, so it works the fix out and calls propose_fix. The fix appears in the open dashboard at once; a person approves it, and the next lookup for that error returns it.

An agent calls lookup, finds nothing, proposes a fix; it appears live in the review queue, is approved, and the next lookup returns it

Also as MP4. More in docs/tools.md.

The dashboard

npx dejafix dashboard opens it in your browser. It updates by itself when files change, and switches between the project runbook, the global one or both.

One dashboard for all your projects. Every project where you run dejafix init (or where your AI app uses dejafix) joins the list, and the one dashboard at http://localhost:4660 shows them all: switch from the sidebar or the top bar, or see every project at a glance on All projects. Running npx dejafix dashboard in another project opens it in the dashboard that is already running, instead of starting a second one.

All projects, opening one, switching from the top bar, folding the sidebar and going dark

All projects, then billing-api, then docs-site from the top-bar picker; [ folds the sidebar; the theme button goes dark.

Home: counts, most-used fixes, recent lookups and the problems seen most this week

Review queue: a fix an agent proposed, with Approve, Edit and Reject

Home. How many fixes are approved, waiting or stale, the most-used fixes, recent lookups and the problems seen most often this week.

Review queue. Every fix an agent proposed, with the error, the cause and the fix. Approve, Edit or Reject: this is the dashboard's main job.

Search: paste error output and see ranked matches and what the agent sees

An entry with its fix, use history and similar entries to merge

Search. Paste any error output and see the matches ranked, exactly as an agent would see them.

Entry. View and edit a fix, its use history, and similar entries to merge.

Reviewing takes a click (or a key): approve a fix, or merge a near-duplicate into the entry it repeats.

Review queue: approving a fix, then merging a near-duplicate into the existing entry

Add a fix: title, symptoms, cause and fix filled in

Stale: fixes unused for months or found on an older tool version, with Keep and Retire

Add a fix by hand, and edit any fix in place (see it).

Stale fixes: unused for 90 days, or found on a tool version that has since changed.

The dashboard in dark mode

Home with the sidebar folded away

Light and dark, following your system or your choice.

Fold the sidebar with ☰ or [ for more room.

On a phone the sidebar becomes a drawer:

The dashboard on a phone: Home, the menu drawer and the review queue

See docs/dashboard.md.

The CLI

dejafix                      run the MCP server on stdio (what your AI tool starts)
dejafix init [folder]        set up .dejafix/ and print MCP config   [--global] [--hook] [--yes]
dejafix dashboard            open the web dashboard                  [--port n] [--no-open] [--global]
dejafix lookup "<error>"     find known fixes (or pipe output in)    [--all] [--json]
dejafix add                  add a fix (asks questions with no flags)
dejafix review               approve or reject proposed fixes        [--list]
dejafix list                 list fixes                              [--status s] [--global] [--json]
dejafix stats                counts, top problems, lookups           [--json]

Pipe output straight in: npm run dev 2>&1 | npx dejafix lookup. lookup exits with 0 when something matched and 2 when nothing did, so scripts can use it. More in docs/cli.md.

npm run dev output piped into dejafix lookup prints the team's fix for the port-in-use error

dejafix init creates .dejafix and prints the MCP config

dejafix add asks for the title, symptoms, cause and fix

init sets up the runbook and prints your MCP config.

add asks for each part when run without flags.

dejafix review approves one fix, skips one, quits

dejafix stats shows counts, top problems and lookups with no answer

review goes through proposed fixes: approve, reject, skip.

stats shows the most-used fixes and what had no answer.

An entry

Each fix is one Markdown file, .dejafix/<id>.md. Edit it by hand, review it in a pull request, or use the dashboard.

---
id: port-already-in-use
title: Port already in use
status: approved
symptoms:
  - "EADDRINUSE: address already in use"
  - "/Port \\d+ is (already )?in use/i"
tags:
  - tool:node
found_by: agent:claude-code
created: 2026-12-04T10:37:24.455Z
last_used: 2026-12-05T08:12:03.120Z
use_count: 7
---

## Cause

A dev server from an earlier session is still running and holds the port.

## Fix

Find and stop the process that holds the port:

- macOS / Linux: `lsof -ti tcp:3000 | xargs kill`
- Windows (PowerShell): `Stop-Process -Id (Get-NetTCPConnection -LocalPort 3000).OwningProcess`

Or start on another port: `PORT=3001 npm run dev`.

## Notes

Happens most after a session was stopped mid-run.
  • symptoms: error text as it appears, or a /regex/flags pattern. Paths, ports, timestamps and ids are ignored when matching, so :::3000 and 127.0.0.1:5173 both match.

  • tags: free words; by convention os:windows, tool:npm, service:postgres.

  • status: proposed (waiting for review), approved (returned by lookup) or retired (kept for history).

  • found_by: agent:<name> or person:<name>. use_count and last_used are kept up to date by record_use.

  • Usage logs live in .dejafix/log/, which git ignores.

The project runbook is .dejafix/ at the root of your repo. The optional global runbook, ~/.dejafix (or $DEJAFIX_HOME), holds fixes for your machine that every project shares. Lookups search both.

Safety

  • Redaction before every save, from an agent, the dashboard or the CLI: private keys, cloud and API keys (AWS, GitHub, GitLab, Slack, Stripe, OpenAI, Anthropic, Google, npm), JWTs, Bearer/Basic credentials, password=/token:/api_key assignments, credentials in connection strings (the host is kept) and email addresses. Anything that still looks like a secret makes it refuse to save, and say where.

  • Duplicates are caught on save: you get the similar fixes and can merge, or save anyway.

  • Local only: the dashboard binds 127.0.0.1, checks the Host header, and accepts changes only from its own page (a per-run token). No telemetry and no network calls.

Docs

Contributing

Bug reports, ideas and pull requests are welcome: see CONTRIBUTING.md and the Code of Conduct. Report security problems privately, as SECURITY.md explains. What changed in each release is in the changelog.

Later

  • Import from and export to Progressor, so a Progressor project can show its dejafix entries.

  • Share a global runbook across a team through a git repo.

License

Copyright (C) 2026 Rachit Asthana

dejafix is licensed under the PolyForm Noncommercial License 1.0.0.

  • Free, no need to ask: personal use with no commercial application (your own projects, study, research, hobbies), and use by charities, schools, public research bodies and government institutions. You may use, change and share it for these.

  • Needs a commercial license from the author: any other use. That includes using it in or for a company, for paid client work, and selling it, hosting it for others, or building a product or service on it, changed or not. A commercial license may come with a fee, which we work out together when you ask. Ask for a commercial license.

Without that license, commercial use is not allowed. See LICENSE.md for the full terms.

If dejafix saves you time, you can buy me a coffee.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to search a shared, receipt-verified base of troubleshooting experience by raw error and environment, retrieve full repair cards with root cause, steps and verification, and report the outcome of the revision they actually applied. Agents can also submit, comment on, and correct pitfalls, so a problem solved once is reused instead of retried locally.
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Persists the decisions, rules, bugs, to-dos and dead ends from your AI coding chats into a markdown file in your repo and recalls the relevant lines in later sessions, while checking commands and file edits against those saved rules before they run.
      759 npm
      MIT