troubleshoot
Skill3 starsChanged 3 months agoMITView on GitHub
Diagnose agent dispatch failures for a specific issue, or run a system health check across the runner environment.
- Reads credentials
34 other projects use a version of this.
Adopted by
Most recently taken up by
- agent-substrate/substratetheir own version, first seen Nov 29, 2026
- microsoft/Copilot-Managed-Runtimetheir own version, first seen Nov 29, 2026
- Folken2/skillstheir own version, first seen Nov 29, 2026
- marshal-org/runleasetheir own version, first seen Nov 29, 2026
- nexus-a1/claude-skillstheir own version, first seen Nov 29, 2026
- mystilleef/spae-frameworktheir own version, first seen Nov 24, 2026
Used with
Projects with it also use ecosystem-reference, fractal-delegation and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
naman10parikhSkillecosystem-reference
Quick-access directory of Claude Code ecosystem repos, skills, plugins, MCPs, and patterns. Use when improving the harness.
Also in 5 projects that use this
naman10parikhSkillfractal-delegation
Also in 5 projects that use this
roronoazoroshao369Skillmemory-compression
Also in 5 projects that use this
MicrosoftSkillact-on-feedback
Act on user feedback attached to the current session. Use when the user submits feedback on the session's changes via the Submit Feedback button.
Also in 4 projects that use this
MicrosoftSkillgenerate-run-commands
Generate or modify run commands for the current session. Use when the user wants to set up or update run commands that appear in the session's Run button.
Also in 4 projects that use this
sublimotionSkillagent-runtime
Launch and manage detached agent runs on EKS via the agent-runner CLI. Use when the user says "launch an agent run", "agent runtime", "agent-runner", "run this spec on the cluster", "check run status", "agent run logs", or "stop a run". Do NOT use for writing the agent-runner code itself (edit the sibling ../agent-runner repo), Terraform of the foundation (use terraform-automation), or GPU serving deployments (use infra-deployer).
Also in 5 projects that use this
- +5 more from naman10parikh
Other versions34 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 34
- microsoft/vscode★ 196ksame name
- agent-substrate/substrate★ 8.6ksame name
- DeL-TaiseiOzaki/claude-code-orchestra★ 199same name
- serithemage/serverless-openclaw★ 196same name
- Azure-Samples/art-voice-agent-accelerator★ 74same name
- cafferychen777/ChatSpatial★ 45same name
- microsoft/Employee-Self-Service-Agent-Developer-Kit★ 32same name
- laaielichter/Reverseport★ 28same name
- google/ml-workload-debugging-wiki★ 21same name
- jamie8johnson/cqs★ 18same name
24 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- discord-bot/AGENTS.mdAGENTS.md
- prompts/AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- slack-bot/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- discord-bot/CLAUDE.mdCLAUDE.md
- prompts/CLAUDE.mdCLAUDE.md
- scripts/CLAUDE.mdCLAUDE.md
- slack-bot/CLAUDE.mdCLAUDE.md
- setupSkill
- sp-post-mergeSkill
- sp-reviseSkill
- sp-statusSkill
- sp-workSkill
- testSkill
- updateSkill
- sp-cleanupSkill
- sp-implementSkill
- sp-reviewSkill
- sp-reviseSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 6 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 28 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 32
If the argument is owner/repo#42, use that owner/repo and issue number
- Distinctive: line 33
If the argument is just a number, infer the repo from the current directory's git remote:
- Distinctive: line 37
If no argument is provided, proceed to the System Health Check (Step 6)
- Distinctive: line 93
If no known pattern matches, report the raw data and suggest manual investigation.
- Very specific: line 135
Run all 6 area checks. Report pass/warn/fail for each area.
- Distinctive: line 139
Check that required tools are installed and accessible:
- Very specific: line 154
Pass: all tools present and gh authenticated
- Distinctive: line 160
Check that config files exist and required variables are set:
- Distinctive: line 202
Check systemd services for notification bots:
- Very specific: line 229
If failures exist, briefly note the issue numbers and failure categories (timeout, circuit breaker, etc.) so the user can run /troubleshoot …
“Common” is measured: kept by at least 6 in 10 of the 28 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Troubleshoot: Diagnose Agent Failures and System Health
Two modes:
/troubleshoot <number>or/troubleshoot owner/repo#42— investigate a specific issue/troubleshoot(no argument) — system health check across 6 areas
Step 1: Detect Environment
Determine whether you are running on the self-hosted runner or a remote machine:
ls ~/.claude/agent-logs/ 2>/dev/null- Runner mode (directory exists): full diagnostics from local files +
ghCLI - Remote mode (directory does not exist):
gh-only diagnostics with limited visibility
Note which mode you are in. If remote mode, skip any step that requires local file access and note "not available in remote mode" in the report.
Step 2: Determine Repo Context
Infer the repository from the argument or current directory:
- If the argument is
owner/repo#42, use that owner/repo and issue number - If the argument is just a number, infer the repo from the current directory's git remote:
git remote get-url origin 2>/dev/null - If no argument is provided, proceed to the System Health Check (Step 6)
Step 3: Gather Issue Data
Collect data from all available sources. Adapt to the detected environment.
3a: GitHub data (both modes)
# Issue details, labels, and body
gh issue view <NUMBER> --repo OWNER/REPO --json title,body,state,labels,comments,createdAt,updatedAt
# Check for associated PR
gh pr list --repo OWNER/REPO --head "agent/issue-<NUMBER>" --json number,state,title,url
# Recent workflow runs triggered by issue events
gh run list --repo OWNER/REPO --limit 20 --json databaseId,status,conclusion,event,createdAt,name3b: Local logs (runner mode only)
# Dispatch log entries for this issue
grep "#<NUMBER>" ~/.claude/agent-logs/sandbox-pal-dispatch.log | tail -80
# Claude stderr log (most recent for this issue)
ls -t ~/.claude/agent-logs/claude-stderr-*<NUMBER>* 2>/dev/null | head -3
# Read the most recent one if it exists3c: Worktree state (runner mode only)
# Check if a worktree exists for this issue
ls -la ~/.claude/worktrees/*/\*-issue-<NUMBER> 2>/dev/null
# Check the branch
git log --oneline origin/agent/issue-<NUMBER> 2>/dev/null | head -10Step 4: Match Known Failure Patterns
Compare the gathered data against these known failure patterns. Multiple patterns may match — report all that apply.
| Pattern | Detection Signal | Category |
| Timeout | Exit code 124, "timed out" in log | Resource limit |
| Circuit breaker | "halted: too many comments" in log, agent:failed label | Loop detection |
| PR creation failure | "Failed to create PR" in log, branch exists but no PR | Permission/state |
| Worktree conflict | "already checked out" in stderr | Stale state |
| Parse failure | "Could not parse" in log | Prompt/output issue |
| Permission denied | "Permission denied" or HTTP 403 in stderr | Auth/PAT |
| No commits | "No commits made" in log | Scope/complexity |
| Test gate failure | "Test Failure (Pre-PR Gate)" in issue comments or log | Test issue |
| Runner offline | No workflow run found for the label event | Infrastructure |
If no known pattern matches, report the raw data and suggest manual investigation.
Step 5: Produce Issue Diagnostic Report
Assemble findings into this structured format:
## Troubleshooting Report: #<NUMBER>
### Summary
One or two sentences: what happened and the likely root cause.
### Timeline
Numbered list of events in chronological order. Include:
- When the agent label was added (from issue events/comments)
- Label transitions (from issue labels and log entries)
- Key dispatch log events (triage, plan, implementation start/end)
- Exit conditions (timeout, error, success)
- PR creation (if applicable)
Include timestamps where available.
### Diagnosis
Which known failure pattern(s) matched and why. Reference specific
log lines or state that led to this conclusion.
If remote mode, note which data sources were unavailable and how
that limits confidence in the diagnosis.
### Suggested Fix
Actionable steps to resolve the issue. Be specific:
- If timeout: suggest scope reduction or AGENT_TIMEOUT increase with the exact config line
- If circuit breaker: explain what caused the loop and how to prevent it
- If permission: specify which PAT scope is likely missing
- If worktree conflict: give the exact cleanup commands
- If test failure: suggest checking AGENT_TEST_COMMAND
- If no pattern matched: suggest gathering more data or checking specific logsStop here — do not proceed to the system health check. The report is complete.
Step 6: System Health Check (no argument mode)
Run all 6 area checks. Report pass/warn/fail for each area.
6a: Runner Environment
Check that required tools are installed and accessible:
# Claude Code CLI
claude --version 2>/dev/null
# GitHub CLI and auth
gh auth status 2>/dev/null
# Other required tools
git --version
jq --version 2>/dev/null
curl --version 2>/dev/null | head -1- Pass: all tools present and
ghauthenticated - Warn: optional tools missing
- Fail:
claude,gh,git, orjqmissing orghnot authenticated
6b: Config Validation
Check that config files exist and required variables are set:
# Check for config files in common locations
# Standalone mode:
ls .sandbox-pal-dispatch/config.env 2>/dev/null
ls .sandbox-pal-dispatch/config.defaults.env 2>/dev/null
# Infrastructure mode:
ls config.env 2>/dev/null
ls config.defaults.env 2>/dev/nullSource the config and check:
AGENT_BOT_USERis set (required)AGENT_TIMEOUTis a positive integer if setAGENT_MAX_TURNSis a positive integer if setAGENT_CIRCUIT_BREAKER_LIMITis a positive integer if setAGENT_TEST_COMMAND, if set, is a valid command (check withwhichorcommand -von the first word)- Pass: required vars set, optional vars well-formed
- Warn: optional vars missing or
AGENT_TEST_COMMANDnot set (no pre-PR test gate) - Fail:
AGENT_BOT_USERnot set or config file missing
6c: Disk and Worktree Health
# Disk space
df -h ~ | tail -1
# List worktrees and check for stale ones
find ~/.claude/worktrees/ -maxdepth 2 -mindepth 2 -type d 2>/dev/null
# Count worktrees
ls ~/.claude/worktrees/*/ 2>/dev/null | wc -l- Pass: disk >10% free, 0 worktrees or all recently active
- Warn: disk <10% free, or >5 worktrees present (possible stale worktrees)
- Fail: disk <2% free
6d: Bot Services
Check systemd services for notification bots:
# Discord bot
systemctl --user is-active pennyworth-discord.service 2>/dev/null
# Check if notification backend is configured
# (from config: AGENT_NOTIFY_BACKEND)- Pass: configured notification services are running
- Warn: notification backend configured but service not running, or no notification backend configured
- Fail: service is in failed state
6e: Recent Failures
# Check for agent:failed entries in the last 48 hours
grep "agent:failed\|agent_failed\|\[failed\]" ~/.claude/agent-logs/sandbox-pal-dispatch.log 2>/dev/null | tail -20Review recent dispatch log entries for failure patterns. Count failures in the last 48 hours.
- Pass: 0 failures in last 48 hours
- Warn: 1-2 failures in last 48 hours
- Fail: 3+ failures in last 48 hours (may indicate systemic issue)
If failures exist, briefly note the issue numbers and failure categories (timeout, circuit breaker, etc.) so the user can run /troubleshoot <number> on specific ones.
6f: File Permissions
# config.env should not be world-readable (contains no secrets in gitignored file, but good practice)
stat -c '%a' config.env 2>/dev/null || stat -c '%a' .sandbox-pal-dispatch/config.env 2>/dev/null
# Log directory writable
test -w ~/.claude/agent-logs/ && echo "writable" || echo "not writable"
# Worktree directory writable (or creatable)
test -w ~/.claude/worktrees/ 2>/dev/null && echo "writable" || echo "not writable or missing"- Pass: config not world-readable (perms not
*4or*6or*7in the others column), log and worktree dirs writable - Warn: config is world-readable
- Fail: log or worktree directory not writable
6g: Produce Health Report
## System Health Report
| Area | Status | Details |
|------|--------|---------|
| Runner environment | PASS/WARN/FAIL | ... |
| Config validation | PASS/WARN/FAIL | ... |
| Disk / worktrees | PASS/WARN/FAIL | ... |
| Bot services | PASS/WARN/FAIL | ... |
| Recent failures | PASS/WARN/FAIL | ... |
| File permissions | PASS/WARN/FAIL | ... |
### Recommendations
(Only if any area is WARN or FAIL — list specific actions to take)Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

