Docs navigation mb-doctor

Maintain & Repair

mb-doctor

Last updated May 25, 2026

Supported in Codex

Diagnose setup, runtime wiring, drift, and repair paths without mutating state by default.

mb-doctor spans Sense
  1. Sense
  2. Decide
  3. Ship
  4. Reflect

Usage

Use mb-doctor as an agent route. The route should read Main Branch facts before advice, then stay inside the approval gates for the work it recommends.

bash
mb-doctor

# Claude Code, when installed
/mb-doctor

When to use it

Best for

A repair-planning route when Main Branch setup, runtime wiring, or provider posture may be broken.

Use when

  • Status reports drift or mismatch.
  • The CLI, login shell, runtime, or provider wiring seems wrong.
  • The operator asks what to fix before continuing.

Route workflow

  1. Run the repair plan in read-only mode.
  2. Translate the repair findings into business language.
  3. Quote exact safe commands when useful.
  4. Ask before repair apply, migration, or provider mutation.

Safe fact commands

Run only the read-only facts needed for the route before recommending next work. Approval-gated commands belong in the plan, not the first move.

bash
mb doctor repair --plan --json
mb status --json --peek

Command contract

Reads

  • runtime path
  • CLI version
  • repo state
  • provider posture
  • repair plan

Writes

  • none unless repair apply is approved

Approval gates

  • repair apply
  • migration
  • provider mutation

Expected output

Return

  • Diagnosis.
  • Repair plan.
  • Approval-gated commands separated from read-only checks.

Do not

  • Do not apply repair automatically.
  • Do not continue business routing through runtime mismatch.
  • Do not hide the exact command when repair is needed.

Example response

agent
Doctor found a runtime PATH mismatch. Fix the shell path before running business routes so the agent reads the same CLI the terminal sees.