Agent skill

Shell Error Debug Workflow

by HKUDS in HKUDS/OpenSpace

Systematic workflow for diagnosing and resolving unknown errors from runshell commands

MITAuto-check passed

Install Shell Error Debug Workflow

skills CLI
$ npx skills add HKUDS/OpenSpace --skill shell-error-debug-workflow -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install HKUDS/OpenSpace shell-error-debug-workflow --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/HKUDS/OpenSpace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/benchmarks/gdpval/skills/shell-error-debug-workflow .claude/skills/shell-error-debug-workflow && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
shell-error-debug-workflow
GitHub stars
7.7k
Token cost
~1.1k tokens
SKILL.md length
361 words
Files
2
Skills in repo
199
Repo updated
First seen
Licence
MIT

At a glance

Systematic workflow for diagnosing and resolving unknown errors from runshell commands

  • Works in 6 steps: Capture Explicit Stderr → Verify Working Directory → Check Tool/Command Availability → …
  • SKILL.md covers When to Use This Skill, Step-by-Step Troubleshooting…, Complete Diagnostic Sequence and Common Causes and Solutions, plus 3 more sections
  • Calls python

What it does

Shell Error Debug Workflow is an agent skill from HKUDS/OpenSpace. Systematic workflow for diagnosing and resolving unknown errors from runshell commands

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file.

The repository describes itself as: "OpenSpace: The Skill Management Layer for AI Agents" -- https://open-space.cloud/. The licence is MIT.

Example prompts

  • “/shell-error-debug-workflow”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Capture Explicit Stderr
  2. Verify Working Directory
  3. Check Tool/Command Availability
  4. Use Absolute Paths
  5. Test with Minimal Command
  6. Check Environment Variables

What it can do on your machine

Read from SKILL.md and the folder at commit 3827781. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Shell Error Debug Workflow loads about 1.1k tokens when it runs. Until then it costs about 29 tokens; SKILL.md has 361 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~29
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from HKUDS/OpenSpace at commit 3827781, republished under its MIT licence (© HKUDS). 361 words, ~1,096 tokens.

Download SKILL.mdSave it as .claude/skills/shell-error-debug-workflow/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
shell-error-debug-workflow
description
Systematic workflow for diagnosing and resolving unknown errors from run_shell commands

Shell Error Debug Workflow

When run_shell returns an 'unknown error' or ambiguous failure, apply this systematic troubleshooting workflow to diagnose and resolve the issue.

When to Use This Skill

  • run_shell returns an 'unknown error' message
  • Shell command fails without clear error output
  • Command works locally but fails in the agent environment
  • Intermittent or unexplained shell failures

Step-by-Step Troubleshooting Workflow

Step 1: Capture Explicit Stderr

Redirect stderr to stdout to capture all error output:

bash
# Instead of:
run_shell command="some-command"

# Use:
run_shell command="some-command 2>&1"

This ensures error messages are captured in the output rather than being lost.

Step 2: Verify Working Directory

Confirm the current working directory and its contents:

bash
run_shell command="pwd && ls -la"

Check that:

  • You're in the expected directory
  • Required files/directories exist
  • Permissions are correct
Step 3: Check Tool/Command Availability

Verify the required command or tool exists and is accessible:

bash
run_shell command="which some-command || command -v some-command || type some-command"

If the tool is not found, check PATH or install the required package.

Step 4: Use Absolute Paths

Replace relative paths with absolute paths to avoid directory-related issues:

bash
# Instead of:
run_shell command="python script.py"

# Use:
run_shell command="$(pwd)/script.py"
# or
run_shell command="/absolute/path/to/script.py"
Step 5: Test with Minimal Command

Isolate the issue by running a minimal version of the command:

bash
# Test basic functionality first
run_shell command="echo 'test'"

# Then gradually add complexity
run_shell command="some-command --version"
run_shell command="some-command --help"
Step 6: Check Environment Variables

Some commands depend on specific environment variables:

bash
run_shell command="env | grep -i relevant_var"

Complete Diagnostic Sequence

For persistent unknown errors, run this complete diagnostic:

bash
# 1. Capture full environment
run_shell command="pwd && echo '---' && ls -la && echo '---' && env"

# 2. Test command with full error capture
run_shell command="your-command 2>&1 | head -50"

# 3. Check command availability
run_shell command="which your-command || echo 'Command not found in PATH'"

# 4. Try with absolute path
run_shell command="/full/path/to/your-command 2>&1"
Show full SKILL.md (166 more words)Show less

Common Causes and Solutions

SymptomLikely CauseSolution
No output, unknown errorstderr not capturedAdd 2>&1 to command
File not foundWrong working directoryUse pwd to verify, use absolute paths
Permission deniedFile/directory permissionsCheck with ls -la, adjust permissions
Command not foundTool not installed or not in PATHUse which to check, install or specify full path
Intermittent failuresRace conditions or timingAdd delays, check for file locks

Example: Troubleshooting a Python Script Failure

bash
# Initial failing command
run_shell command="python process.py"
# Returns: unknown error

# Apply diagnostic workflow:
# Step 1: Capture stderr
run_shell command="python process.py 2>&1"

# Step 2: Verify directory
run_shell command="pwd && ls -la"

# Step 3: Check Python availability
run_shell command="which python && python --version"

# Step 4: Use absolute path
run_shell command="$(pwd)/process.py 2>&1"
# or
run_shell command="/usr/bin/python3 $(pwd)/process.py 2>&1"

Best Practices

  1. Always capture stderr when debugging: 2>&1
  2. Verify assumptions about working directory and file locations
  3. Start simple before running complex commands
  4. Use absolute paths in production/repeatable scripts
  5. Check tool versions when behavior seems inconsistent
  6. Document environment when errors are hard to reproduce

When to Escalate

If this workflow does not resolve the issue:

  • The error may be environmental (container/runtime specific)
  • Consider using shell_agent for complex shell tasks that require autonomous error handling
  • Check for resource constraints (disk space, memory, timeouts)

© HKUDS, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in benchmarks/gdpval/skills/shell-error-debug-workflow of HKUDS/OpenSpace.

  • SKILL.md
  • .skill_id

Open the folder on GitHubat commit 3827781

Compare with similar skills

Shell Error Debug Workflow next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Shell Error Debug Workflow compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Shell Error Debug Workflow this skillHKUDS/OpenSpace7.7k—~1.1kAutomated safety check: PassMIT
Debugging and Error Recoveryaddyosmani/agent-skills102k1 repos~2.6kAutomated safety check: PassMIT
Debugasgeirtj/system_prompts_leaks69k—~439Automated safety check: PassCC0-1.0
Systematic DebuggingChrisWiles/claude-code-showcase6.1k3 repos~1.2kAutomated safety check: PassNone
Systematic DebuggingjnMetaCode/superpowers-zh8.3k—~1.1kAutomated safety check: PassMIT
Systematic Debuggingforyourhealth111-pixel/Vibe-Skills3.6k—~2.6kAutomated safety check: PassApache-2.0

Similar skills

  • Debugging and Error Recovery

    addyosmani/agent-skills

    Applies a stop-the-line rule and a step-by-step triage when tests fail, builds break or something stops working, aiming at the root cause instead of guesses.

    102k GitHub starsUsed in 1 repo~2.6k tokens
    DevelopmentAuto-check passed
  • Debug

    asgeirtj/system_prompts_leaks

    Enable debug logging for this session and help diagnose issues

    69k GitHub stars~439 tokensUpdated yesterday
    Auto-check passed
  • Systematic Debugging

    ChrisWiles/claude-code-showcase

    Applies a four-phase debugging routine that finds the root cause of a bug or failing test before any fix is written.

    6.1k GitHub starsUsed in 3 repos~1.2k tokens
    DevelopmentAuto-check passed
  • Systematic Debugging

    jnMetaCode/superpowers-zh

    遇到任何 bug、测试失败或异常行为时使用,在提出修复方案之前执行

    8.3k GitHub stars~1.1k tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • Systematic Debugging

    foryourhealth111-pixel/Vibe-Skills

    Root-cause route for actual bugs, failing tests, build errors, crashes, stack traces, and unexpected behavior.

    3.6k GitHub stars~2.6k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Debug Systematically

    aiming-lab/MetaClaw

    A skill your agent uses when diagnosing a bug, unexpected behavior, test failure, or any situation where code does not behave as expected.

    3.5k GitHub stars~234 tokensUpdated 4 mo ago
    DevelopmentAuto-check passed

More from HKUDS/OpenSpace

All 199 skills in this repo
  • Walks through producing a master audio track plus stems in Python, from checking a reference file and timing sections by BPM to effects, a zip archive and final verification.

    7.7k GitHub stars~2.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Handle cascading data retrieval tool failures by falling back to embedded knowledge generation

    7.7k GitHub stars~765 tokensUpdated 1 mo ago
    Auto-check passed
  • Gives an agent a workaround when its code-execution sandbox keeps failing: save the Python script to a file and run it through the shell instead.

    7.7k GitHub stars~588 tokensUpdated 1 mo ago
    Auto-check passed
  • A recovery routine for agents whose sandboxed code runner keeps failing: save the Python script to disk, then run it through the shell and read the output.

    7.7k GitHub stars~652 tokensUpdated 1 mo ago
    Auto-check passed
  • Fallback ladder for failed sandboxed code runs, plus the habit of fixing the working directory first so generated files land in the right place.

    7.7k GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Fallback workflow for executing Python code when executecodesandbox fails repeatedly

    7.7k GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Shell Error Debug Workflow

What does Shell Error Debug Workflow do?

Systematic workflow for diagnosing and resolving unknown errors from runshell commands. Shell Error Debug Workflow is an agent skill from HKUDS/OpenSpace.

How do I install Shell Error Debug Workflow in Claude Code?

Run `npx skills add HKUDS/OpenSpace --skill shell-error-debug-workflow -a claude-code`. Or copy the skill folder (benchmarks/gdpval/skills/shell-error-debug-workflow in HKUDS/OpenSpace) into .claude/skills/shell-error-debug-workflow in your project. Claude Code loads it when a task matches its description.

How do I install Shell Error Debug Workflow in Codex?

Run `npx skills add HKUDS/OpenSpace --skill shell-error-debug-workflow -a codex`. Or copy the skill folder (benchmarks/gdpval/skills/shell-error-debug-workflow in HKUDS/OpenSpace) into .agents/skills/shell-error-debug-workflow in your project. Codex loads it when a task matches its description.

Can I use Shell Error Debug Workflow in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add HKUDS/OpenSpace --skill shell-error-debug-workflow -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/shell-error-debug-workflow, .gemini/skills/shell-error-debug-workflow, .github/skills/shell-error-debug-workflow and .opencode/skills/shell-error-debug-workflow in your project.

What does Shell Error Debug Workflow need to run?

Going by SKILL.md and its folder, Shell Error Debug Workflow needs the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Shell Error Debug Workflow access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Shell Error Debug Workflow safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Shell Error Debug Workflow use?

Shell Error Debug Workflow is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Shell Error Debug Workflow use?

About 1.1k tokens (SKILL.md is roughly 4.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Shell Error Debug Workflow?

Skills that share tags, products or a category with Shell Error Debug Workflow: Debugging and Error Recovery (addyosmani/agent-skills, 102k stars), Debug (asgeirtj/system_prompts_leaks, 69k stars), Systematic Debugging (ChrisWiles/claude-code-showcase, 6.1k stars) and Systematic Debugging (jnMetaCode/superpowers-zh, 8.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Shell Error Debug Workflow?

HKUDS (a GitHub organization) maintains it in HKUDS/OpenSpace, which has 7,743 GitHub stars. The repository holds 199 skills in this directory. The repository was last updated on August 12, 2026.

Source: HKUDS/OpenSpace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.