amplihack doctor — Command Reference¶
Synopsis¶
Description¶
Checks the local system for the conditions required to run amplihack correctly and prints a pass/fail summary. Each check is independent: all checks always run regardless of earlier failures. The command exits with code 0 if every check passed, or 1 if any check failed.
doctor is the first thing to run when amplihack behaves unexpectedly. Its output identifies exactly which prerequisite is missing so you can fix it directly.
Options¶
doctor takes no options. The subcommand name alone is sufficient:
Exit Codes¶
| Code | Meaning |
|---|---|
0 |
All 5 checks passed |
1 |
One or more checks failed |
Checks¶
doctor runs 5 checks in order. Each check prints one line of output.
Check 1 — hooks installed¶
Reads ~/.claude/settings.json and verifies that at least one hook command string contains "amplihack". A passing result means the amplihack hook dispatcher is registered in Claude Code's settings.
Check 2 — settings.json valid JSON¶
Reads ~/.claude/settings.json and parses it as JSON. Fails if the file is absent, unreadable, or not valid JSON. This check is independent of Check 1 — both always run.
Check 3 — recipe-runner available¶
Runs recipe-runner-rs --version and checks that the command succeeds. Verifies the binary is on PATH and executable.
Check 4 — tmux installed¶
Runs tmux -V and checks for a zero exit code. tmux is required for amplihack's session management features.
Check 5 — amplihack version¶
Reports the amplihack version from the compiled binary. This check always passes on a valid install; it is informational.
Output Format¶
Each check line starts with ✓ (U+2713 CHECK MARK) for pass or ✗ (U+2717 BALLOT X) for fail, followed by the check name and, on failure, a dash and a short error message.
At the end of all checks, a summary line is printed:
or:
ANSI colour codes are always emitted: green for ✓ lines, red for ✗ lines, and bold for the summary. If you need plain text output (for log ingestion, for example), strip ANSI codes with a tool such as sed 's/\x1b\[[0-9;]*m//g' or ansistrip.
Security Properties¶
- No secrets printed.
settings.jsoncontent is never echoed. Only existence, JSON validity, and the presence of the string"amplihack"inside thehookssection are reported. - Error messages are truncated. stderr from subprocess checks is truncated to the first line, maximum 200 characters, before being included in output. This prevents adversarial error output from flooding logs.
- ANSI stripped on external output. Version strings from
tmux -Vandrecipe-runner-rs --versionhave ANSI escape codes stripped before display. - Compile-time constants only for self-version. amplihack's own version (Check 5) uses the
CARGO_PKG_VERSIONcompile-time constant; the binary does not spawn itself as a subprocess. - All subprocess arguments are compile-time literals. No user input reaches any
Command::new()call.
Example: All Checks Pass¶
$ amplihack doctor
✓ hooks installed
✓ settings.json valid JSON
✓ recipe-runner-rs v0.4.2
✓ tmux 3.4
✓ amplihack v0.9.1
All checks passed.
Example: Two Failures¶
$ amplihack doctor
✓ hooks installed
✓ settings.json valid JSON
✗ recipe-runner available — command not found: recipe-runner-rs
✓ tmux 3.4
✓ amplihack v0.9.1
1 check(s) failed.
$ echo $?
1
Use in CI¶
doctor exits non-zero on any failure, making it safe to use as a readiness gate:
If the job must continue even when checks fail (for example, to collect diagnostic output), use:
Related¶
- How to Diagnose Problems with amplihack doctor — Actionable fix guide for each failing check
- Hook Specifications — What hooks amplihack registers in settings.json
- amplihack install — Installs the prerequisites that doctor verifies