Diagnose and fix Maestro installation issues
Diagnose installation issues, detect configuration drift, and auto-fix common problems.
[--fix] — Auto-fix issues that have safe automatic remediation.[--check <name>] — Run only one check.Valid check names:
agent-teamshooksstate-dirsstale-statepluginclaude-mdpermissionsorphaned-teamsIf --check is provided with an unknown name, stop and show valid options.
--check <name> is specified.--fix mode, auto-apply only safe fixes. For destructive fixes, ask first.Run each check below and capture status + details.
agent-teams)Check that CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS is set to "1" in ~/.claude/settings.json.
jq -r '.env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS // empty' ~/.claude/settings.json
"1""1" (Agent Teams disabled)--fix remediation:
env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS to "1" in ~/.claude/settings.json.hooks)Verify .claude/hooks/hooks.json is valid JSON and all referenced scripts exist and pass shell syntax check.
jq . .claude/hooks/hooks.json > /dev/null
For each script command reference in hooks.json, validate:
bash -n <script_path>
bash -n checks pass--fix remediation:
state-dirs)Check required Maestro state directories:
.maestro/plans/
.maestro/archive/
.maestro/wisdom/
.maestro/drafts/
.maestro/handoff/
.maestro/research/
OK: All directories exist
WARN: One or more directories missing
--fix remediation:
mkdir -p .maestro/plans .maestro/archive .maestro/wisdom .maestro/drafts .maestro/handoff .maestro/research
stale-state)Check for stale files:
.maestro/handoff/*.json) older than 24 hours where status is "executing" or "designing".maestro/drafts/*) older than 48 hoursfind .maestro/handoff -name "*.json" -mtime +0 2>/dev/null
find .maestro/drafts -type f -mtime +2 2>/dev/null
For handoff candidates, read JSON and include only statuses executing or designing.
--fix remediation:
plugin)Verify .claude-plugin/plugin.json is valid JSON.
jq . .claude-plugin/plugin.json > /dev/null
--fix remediation:
claude-md)Check project CLAUDE.md for expected Maestro markers:
grep -q "## Commands" CLAUDE.md
grep -q "## Architecture" CLAUDE.md
--fix remediation:
permissions)Check that all scripts in .claude/scripts/*.sh are executable.
find .claude/scripts -name "*.sh" ! -perm -u+x
--fix remediation:
chmod +x on each non-executable script.orphaned-teams)Check for team directories that may be stale:
ls ~/.claude/teams/ 2>/dev/null
Treat team directories as suspicious if they do not correspond to active work in the current session.
--fix remediation:
/reset for cleanup.Display results as:
## Maestro Doctor Report
### Summary
[HEALTHY / ISSUES FOUND (N warnings, M critical)]
### Checks
| # | Check | Status | Details |
|---|-------|--------|---------|
| 1 | Agent Teams | OK | Enabled in settings.json |
| 2 | Hooks Integrity | OK | hooks.json valid, scripts valid |
| 3 | State Directories | WARN | Missing: research/ |
| 4 | Stale State | OK | No stale files |
| 5 | Plugin Manifest | OK | Valid JSON |
| 6 | CLAUDE.md | OK | All markers present |
| 7 | Script Permissions | OK | All scripts executable |
| 8 | Orphaned Teams | WARN | Found team dirs: ... |
If issues exist, append:
### Issues Found (bullet list)### Recommended Actions (manual next steps)--fix flag)When --fix is present and issues were found:
### Auto-Fix Result
Fixed N issues. M issues require manual intervention.
If no fixable issues are found, say so explicitly.