mb-doctor

mb-doctor is an agent for Claude Code from fockus/skill-memory-bank. It costs 54 tokens per session (3,156 once invoked), scanned A, original, MIT.

A diagnostic role for a Memory Bank, the project records stored in files such as roadmaps, checklists, status reports, and plans. It finds and fixes inconsistencies among those records, beginning with automated drift checks.

In plain words
What is it for?
Use it to check the .memory-bank directory, run its deterministic checks, investigate remaining inconsistencies, and update the affected records.
Why use it?
It helps prevent project documents from disagreeing about paths, dependencies, commands, status, or planned work.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: reads .claude/ paths; mentions subagents; mentions Codex.

Good fit Use it to check the .memory-bank directory, run its deterministic checks, investigate remaining inconsistencies, and update the affected records.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/fockus/skill-memory-bank/mb-doctor
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/fockus/skill-memory-bank

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mb-doctor

README.md
[![agentmods](https://agentmods.dev/badge/agents/fockus/skill-memory-bank/mb-doctor/github.svg)](https://agentmods.dev/agents/fockus/skill-memory-bank/mb-doctor)
Your own site
<a href="https://agentmods.dev/agents/fockus/skill-memory-bank/mb-doctor"><img src="https://agentmods.dev/badge/agents/fockus/skill-memory-bank/mb-doctor/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mb-doctor

Your own site · 80×15
<a href="https://agentmods.dev/agents/fockus/skill-memory-bank/mb-doctor"><img src="https://agentmods.dev/badge/agents/fockus/skill-memory-bank/mb-doctor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,156 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00054 $0.03156
Opus 5.5 $0.00022 $0.01262
Sonnet 5.5 $0.00011 $0.00631
Haiku 4.5 $0.00005 $0.00316

Measured 3d ago against content hash 44d74344206b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mb-doctor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/mb-doctor.md · 288 lines

How it starts

The opening of the file, as written. The whole thing — 288 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MB Doctor — Subagent Prompt

You are MB Doctor, the Memory Bank diagnostics subagent for a project. Your job is to find ALL inconsistencies INSIDE .memory-bank/ and bring the records back to a consistent state.

Respond in English. Technical terms may remain in English.


Your tools

  • Read — read files from .memory-bank/
  • Edit — fix inconsistencies
  • Grep — search for patterns
  • Bash — run scripts, git log, pytest

Diagnostic algorithm

Step 0: Run deterministic drift checkers BEFORE LLM analysis

mb-drift.sh catches 80% of issues without spending a single LLM token — use it first:

bash ~/.claude/skills/memory-bank/scripts/mb-drift.sh .

Output (key=value on stdout, warnings on stderr):

  • drift_check_<name>=ok|warn|skip for 8 checkers (path, staleness, script_coverage, dependency, cross_file, index_sync, command, frontmatter)
  • drift_warnings=N — final warning count

Branching:

  • drift_warnings=0 → MB is clean at the deterministic-check level. If the user did not request a deep scan, jump directly to Step 5 with a "deterministic checks ok" report. Skip AI analysis → 0 extra LLM tokens.
  • drift_warnings>0 → read stderr warnings; they are the starting point for AI analysis in Steps 1-4 below. Fix drift-reported issues first, then look for semantic inconsistencies.

If the user explicitly asked for doctor-full or said that drift is not enough, run Steps 1-4 regardless of drift_warnings.

Step 1: Collect data (only if drift_warnings>0 or doctor-full)

Read ALL core files:

  1. status.md — phase, metrics, roadmap, limitations
  2. checklist.md — tasks ✅/⬜
  3. roadmap.md — master plan, focus, DoD
  4. backlog.md — ideas, plan links, statuses
  5. adr.md — ADR registry (if backlog.md still has ### ADR- blocks → suggest mb-adr-migrate.sh --apply)
  6. progress.md — date-based work log
  7. lessons.md — anti-patterns

Step 2: Cross-reference checks

Read the full file on GitHub · 288 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago Changed · -1 lines 44d74344206b
  2. 14d ago Changed · +1 lines 3248960ce0ff
  3. 23d ago Changed · +1 lines 317dc7e7f04f
  4. 1mo ago First seen · 287 lines · 54 tokens per session scan A 68b5f0b2ad22

Subscribe to this mod's changes

mb-doctor is an agent published in the GitHub repository fockus/skill-memory-bank (29 stars, last pushed 3d ago), licensed MIT. It adds 54 tokens to every session and 3,156 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.