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.
- Sense
- Decide
- Ship
- 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.
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
- Run the repair plan in read-only mode.
- Translate the repair findings into business language.
- Quote exact safe commands when useful.
- 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.
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
Doctor found a runtime PATH mismatch. Fix the shell path before running business routes so the agent reads the same CLI the terminal sees.