/diagnose — Hook & State Health Check
Validates the entire hook/state system is healthy. Run this when hooks behave unexpectedly, after configuration changes, or as a periodic sanity check.
Process
Step 1: Run the diagnostic script
bash
bash ~/.claude/skills/diagnose/scripts/diagnose.sh
The script checks:
- •Hook file integrity — all scripts referenced in settings.json exist and are executable
- •Shared library health — log.sh and context-lib.sh source without errors
- •State file validation — .plan-drift, .proof-status, .test-status formats
- •Settings consistency — valid JSON, no duplicate hook registrations
- •MASTER_PLAN.md status — phase statuses, DEC-ID format, REQ-ID format
- •Git health — orphaned worktrees, uncommitted changes
Step 2: Interpret results
- •PASS — check passed, no action needed
- •WARN — non-critical issue; explain the risk to the user
- •FAIL — critical issue; suggest specific remediation steps
Step 3: Remediation
For any FAILs, provide the user with:
- •What is broken and why it matters
- •The exact command or edit to fix it
- •Whether the fix requires a worktree (Sacred Practice #2)
For WARNs, explain:
- •What the risk is if left unaddressed
- •Whether it is safe to ignore for now