Agent skill

Debug Sandbox Execution

by HKUDS in HKUDS/OpenSpace

Debug Python code execution failures by capturing partial traces, isolating failing functions, and incrementally verifying outputs

MITAuto-check passedDevelopment

Install Debug Sandbox Execution

skills CLI
$ npx skills add HKUDS/OpenSpace --skill debug-sandbox-execution -a claude-code

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

GitHub CLI
$ gh skill install HKUDS/OpenSpace debug-sandbox-execution --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/debug-sandbox-execution .claude/skills/debug-sandbox-execution && 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
debug-sandbox-execution
GitHub stars
7.7k
Token cost
~843 tokens
SKILL.md length
288 words
Files
2
Skills in repo
199
Repo updated
First seen
Licence
MIT

At a glance

Debug Python code execution failures by capturing partial traces, isolating failing functions, and incrementally verifying outputs

  • Works in 3 steps: Capture Partial Execution Traces → Isolate Failing Functions → Incremental Output Generation
  • Tasks that involve Debugging
  • SKILL.md covers Problem, Solution, Example Workflow and Best Practices, plus 1 more section
  • Calls python

What it does

Debug Sandbox Execution is an agent skill from HKUDS/OpenSpace. Debug Python code execution failures by capturing partial traces, isolating failing functions, and incrementally verifying outputs

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

It sits in Development, covering Debugging. It works with Python. The repository describes itself as: "OpenSpace: The Skill Management Layer for AI Agents" -- https://open-space.cloud/. The licence is MIT.

When your agent uses it

  • Tasks that involve Debugging

Example prompts

  • “/debug-sandbox-execution”

Requirements

  • Python 3

Workflow steps

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

  1. Capture Partial Execution Traces
  2. Isolate Failing Functions
  3. Incremental Output Generation

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

Debug Sandbox Execution loads about 843 tokens when it runs. Until then it costs about 39 tokens; SKILL.md has 288 words of instructions outside code blocks.

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

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). 288 words, ~843 tokens.

Download SKILL.mdSave it as .claude/skills/debug-sandbox-execution/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
debug-sandbox-execution
description
Debug Python code execution failures by capturing partial traces, isolating failing functions, and incrementally verifying outputs

Debug Sandbox Execution Failures

When execute_code_sandbox fails with unknown errors or incomplete output, use this debugging pattern to identify the root cause and recover incrementally.

Problem

The execute_code_sandbox tool may fail silently, truncate output, or produce opaque errors. Complex scripts with multiple file outputs are especially prone to partial failures.

Solution

Use a three-phase debugging approach:

Phase 1: Capture Partial Execution Traces

When a sandbox execution fails, rerun the code using run_shell with output piping to capture whatever output is produced before the failure:

bash
python your_script.py 2>&1 | head -100

This reveals:

  • Which functions/steps executed successfully
  • Where the failure occurred
  • Any error messages that were suppressed
Phase 2: Isolate Failing Functions

Break the script into smaller, testable units. Execute each function or code block independently:

python
# Test individual components
if __name__ == "__main__":
    # Step 1: Test imports
    import numpy as np
    print("Imports OK")
    
    # Step 2: Test function A in isolation
    result_a = function_a()
    print(f"Function A: {result_a}")
    
    # Step 3: Test function B
    result_b = function_b(result_a)
    print(f"Function B: {result_b}")

Run each section with execute_code_sandbox separately to identify which component fails.

Phase 3: Incremental Output Generation

Generate output files one at a time, verifying each before proceeding:

python
import numpy as np
import soundfile as sf

# Generate and save file 1
audio1 = np.random.randn(48000 * 10).astype(np.float32)
sf.write('output_01.wav', audio1, 48000, subtype='FLOAT')

# Verify file 1 exists and has expected properties
import os
assert os.path.exists('output_01.wav'), "File 1 not created"

# Generate and save file 2
audio2 = np.random.randn(48000 * 10).astype(np.float32)
sf.write('output_02.wav', audio2, 48000, subtype='FLOAT')

# Verify file 2
assert os.path.exists('output_02.wav'), "File 2 not created"

Example Workflow

  1. Initial attempt: Run full script with execute_code_sandbox
  2. On failure: Rerun with run_shell and | head -100 to see partial output
  3. Identify breakpoint: Find the last successful operation
  4. Split script: Create separate scripts for each major section
  5. Test incrementally: Run each section, verify outputs, proceed to next
  6. Combine successful sections: Once all pieces work, combine into final script

Best Practices

  • Always verify file creation immediately after writing: assert os.path.exists(path)
  • Check file properties (size, duration, format) before assuming success
  • Use print statements liberally to mark progress through the script
  • Save intermediate outputs so failures don't require restarting from scratch
  • Test audio/video generation with short samples first (1-2 seconds) before full-length content

When to Use

  • Complex scripts with multiple file outputs
  • Audio/video generation pipelines
  • Scripts with external library dependencies
  • Any execute_code_sandbox call that produces incomplete or no output

© 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/debug-sandbox-execution of HKUDS/OpenSpace.

  • SKILL.md
  • .skill_id

Open the folder on GitHubat commit 3827781

Compare with similar skills

Debug Sandbox Execution 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.

Debug Sandbox Execution compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Debug Sandbox Execution this skillHKUDS/OpenSpace7.7k—~843Automated safety check: PassMIT
LangBot Plugin Developmentlangbot-app/LangBot18k—~3.9kAutomated safety check: PassApache-2.0
Python Performance Optimizationwshobson/agents40k12 repos~814Automated safety check: PassMIT
Git History Bug Auditben-manes/caffeine18k—~3.3kAutomated safety check: PassApache-2.0
Keybase RPC Log Analysiskeybase/client9.3k—~3kAutomated safety check: PassBSD-3-Clause
The Art of Debuggingstas00/the-art-of-debugging1.7k—~6.1kAutomated safety check: NotesCC-BY-SA-4.0

Similar skills

  • LangBot Plugin Development

    langbot-app/LangBot

    Guides building, debugging and testing LangBot plugins: components, SDK calls, README and locale rules, SDK pitfalls and WebSocket-based testing.

    18k GitHub stars~3.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Profiles slow Python code with cProfile and memory profilers, then applies targeted fixes for CPU, memory, I/O and query bottlenecks.

    40k GitHub starsUsed in 12 repos~814 tokens
    DevelopmentAuto-check passed
  • Git History Bug Audit

    ben-manes/caffeine

    Audits a module by walking its git history commit by commit, tracking unresolved issues forward, and reporting the ones that survive to HEAD as findings.

    18k GitHub stars~3.3k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Captures a clean Keybase service log and analyzes it for redundant, duplicated or looping RPCs, then checks whether a caching fix reduced the calls.

    9.3k GitHub stars~3k tokensUpdated today
    DevelopmentAuto-check passed
  • The Art of Debugging

    stas00/the-art-of-debugging

    Condensed debugging method and tool recipes for Unix, Python and PyTorch programs: crashes, hangs, segfaults, wrong output, CUDA OOM, NaN values and slowness.

    1.7k GitHub stars~6.1k tokensUpdated today
    DevelopmentAuto-check: notes
  • Adk Setup

    google/adk-python

    Official

    Sets up a local ADK Python development environment in a git clone of the open-source adk-python repository: a uv virtual environment, all dependency extras, pre-commit hooks, and a first unit-test…

    22k GitHub stars~993 tokensUpdated today
    DevelopmentAuto-check: notes

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

Works with

Categories

Questions about Debug Sandbox Execution

What does Debug Sandbox Execution do?

Debug Python code execution failures by capturing partial traces, isolating failing functions, and incrementally verifying outputs. Debug Sandbox Execution is an agent skill from HKUDS/OpenSpace.

When should I use Debug Sandbox Execution?

Debug Sandbox Execution fits situations like: tasks that involve Debugging.

How do I install Debug Sandbox Execution in Claude Code?

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

How do I install Debug Sandbox Execution in Codex?

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

Can I use Debug Sandbox Execution 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 debug-sandbox-execution -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/debug-sandbox-execution, .gemini/skills/debug-sandbox-execution, .github/skills/debug-sandbox-execution and .opencode/skills/debug-sandbox-execution in your project.

What does Debug Sandbox Execution need to run?

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

Does Debug Sandbox Execution 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 Debug Sandbox Execution 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 Debug Sandbox Execution use?

Debug Sandbox Execution 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 Debug Sandbox Execution use?

About 843 tokens (SKILL.md is roughly 3.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 Debug Sandbox Execution?

Skills that share tags, products or a category with Debug Sandbox Execution: LangBot Plugin Development (langbot-app/LangBot, 18k stars), Python Performance Optimization (wshobson/agents, 40k stars), Git History Bug Audit (ben-manes/caffeine, 18k stars) and Keybase RPC Log Analysis (keybase/client, 9.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Debug Sandbox Execution?

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.