--- name: triage description: Triage autoloop fleet health. Reports GREEN/YELLOW/RED per loop with remediation hints. Renamed from 'doctor' to avoid clashing. allowed-tools: Bash argument-hint: "[--json] [--fix]" disable-model-invocation: false --- # autoloop: Triage > **Self-Evolving Skill**: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues. Self-diagnostic for the autoloop fleet. Cross-references registry.json, heartbeat.json files, launchctl list output, plist files, and (lightly) `~/.claude/projects` JSONL transcripts to surface zombies, orphans, label collisions, multi-cwd contamination, stale bindings, and missing heartbeats. ## Arguments - `--json` — emit structured JSON output instead of human-readable terminal report - `--fix` — apply SAFE auto-remediations only (see "What gets fixed" below) ## Severity model - 🔴 **RED** — known-broken state requiring action (zombie launchctl entry, multi-cwd contamination, label collision, contract file missing, cwd_drift_detected) - 🟡 **YELLOW** — probably-OK but worth attention (pending-bind >1h, dead pid + recent heartbeat) - 🟢 **GREEN** — healthy ## Run ```bash PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude/plugins/marketplaces/cc-skills/plugins/autoloop}" # shellcheck source=/dev/null source "$PLUGIN_ROOT/scripts/triage-lib.sh" JSON=false FIX=false for arg in "$@"; do case "$arg" in --json) JSON=true ;; --fix) FIX=true ;; esac done if [ "$FIX" = true ]; then loop_triage_fix else if [ "$JSON" = true ]; then loop_triage_report --json else loop_triage_report fi fi ``` ## What gets fixed automatically (`--fix`) Only operations that are reversible OR have no live side effects: 1. **Unload zombie launchctl entries** — labels matching `com.user.claude.loop.*` with no registry record. Calls `launchctl bootout gui/$(id -u)/