Agent skill

Python Debug Execution 911f17

by HKUDS in HKUDS/OpenSpace

Debug Python script execution failures by capturing full tracebacks and verifying working directory

MITAuto-check passedDevelopment

Install Python Debug Execution 911f17

skills CLI
$ npx skills add HKUDS/OpenSpace --skill python-debug-execution-911f17 -a claude-code

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

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

At a glance

Debug Python script execution failures by capturing full tracebacks and verifying working directory

  • Works in 2 steps: Execute with Full Traceback Capture → Verify Working Directory Before File…
  • Tasks that involve Debugging
  • SKILL.md covers Core Pattern, Usage Examples, Troubleshooting Checklist and When to Apply This Pattern
  • Calls python3

What it does

Python Debug Execution 911f17 is an agent skill from HKUDS/OpenSpace. Debug Python script execution failures by capturing full tracebacks and verifying working directory

Its SKILL.md is about 890 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

  • “/python-debug-execution-911f17”

Requirements

  • Python 3

Workflow steps

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

  1. Execute with Full Traceback Capture
  2. Verify Working Directory Before File Operations

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:

    • python3

    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

Python Debug Execution 911f17 loads about 892 tokens when it runs. Until then it costs about 32 tokens; SKILL.md has 266 words of instructions outside code blocks.

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

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). 266 words, ~892 tokens.

Download SKILL.mdSave it as .claude/skills/python-debug-execution-911f17/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
python-debug-execution-911f17
description
Debug Python script execution failures by capturing full tracebacks and verifying working directory

Python Debug Execution

This skill provides a pattern for debugging Python script execution failures. It ensures you capture actual tracebacks instead of opaque errors and verifies the working directory before file operations.

Core Pattern

1. Execute with Full Traceback Capture

Always run Python scripts with stderr redirected and exit code reported:

bash
python3 script.py 2>&1 ; echo Exit code: $?

This pattern:

  • 2>&1 - Redirects stderr to stdout so all output (including tracebacks) is captured together
  • echo Exit code: $? - Reports the exit code to distinguish between successful runs and failures

Why this matters: Opaque errors without tracebacks make it impossible to identify the root cause. The exit code tells you if the script succeeded (0) or failed (non-zero).

2. Verify Working Directory Before File Operations

Before any file read/write operations in your Python script, add:

python
import os
print(f"Current working directory: {os.getcwd()}")

Or for debugging, add at the start of your script:

python
import os
import sys

# Debug: show execution context
print(f"Script path: {__file__}")
print(f"Working directory: {os.getcwd()}")
print(f"Python version: {sys.version}")

Why this matters: File operations often fail due to incorrect assumptions about the current working directory. Verifying os.getcwd() helps diagnose path-related errors.

Usage Examples

Example 1: Running a Script with Debug Output
bash
# Instead of:
python3 analyze.py

# Use:
python3 analyze.py 2>&1 ; echo Exit code: $?
Example 2: Script with Directory Verification
python
#!/usr/bin/env python3
import os
import pandas as pd

# Verify execution context
print(f"Working directory: {os.getcwd()}")

# Now safe to do file operations
data_path = "data/input.csv"
print(f"Attempting to read: {data_path}")

# Check if file exists before reading
if os.path.exists(data_path):
    df = pd.read_csv(data_path)
    print(f"Successfully loaded {len(df)} rows")
else:
    print(f"ERROR: File not found at {os.path.abspath(data_path)}")
    print(f"Directory contents: {os.listdir('.')}")
Example 3: Debug-First Script Template
python
#!/usr/bin/env python3
"""Template for debuggable Python scripts."""

import os
import sys
import traceback

def main():
    # Debug: execution context
    print("=" * 50)
    print(f"Script: {__file__}")
    print(f"Working directory: {os.getcwd()}")
    print(f"Python: {sys.version}")
    print("=" * 50)
    
    try:
        # Your main logic here
        pass
    except Exception as e:
        print(f"ERROR: {type(e).__name__}: {e}")
        traceback.print_exc()
        sys.exit(1)

if __name__ == "__main__":
    main()

Troubleshooting Checklist

When a Python script fails:

  1. Check the exit code - Non-zero means failure
  2. Read the full traceback - Look for the actual error message and line number
  3. Verify working directory - Use os.getcwd() to confirm file paths are correct
  4. Check file existence - Use os.path.exists() before operations
  5. Use absolute paths - Consider os.path.abspath() for clarity

When to Apply This Pattern

  • Running any Python script from the command line
  • Debugging script execution failures in automated agents
  • Writing scripts that perform file I/O operations
  • Creating reproducible execution environments

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

  • SKILL.md
  • .skill_id

Open the folder on GitHubat commit 3827781

Compare with similar skills

Python Debug Execution 911f17 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.

Python Debug Execution 911f17 compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Python Debug Execution 911f17 this skillHKUDS/OpenSpace7.7k—~892Automated safety check: PassMIT
LangBot Plugin Developmentlangbot-app/LangBot18k—~3.9kAutomated safety check: PassApache-2.0
Python Performance Optimizationwshobson/agents40k13 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 13 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 2 days ago
    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 yesterday
    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 Python Debug Execution 911f17

What does Python Debug Execution 911f17 do?

Debug Python script execution failures by capturing full tracebacks and verifying working directory. Python Debug Execution 911f17 is an agent skill from HKUDS/OpenSpace.

When should I use Python Debug Execution 911f17?

Python Debug Execution 911f17 fits situations like: tasks that involve Debugging.

How do I install Python Debug Execution 911f17 in Claude Code?

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

How do I install Python Debug Execution 911f17 in Codex?

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

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

What does Python Debug Execution 911f17 need to run?

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

Does Python Debug Execution 911f17 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 Python Debug Execution 911f17 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 Python Debug Execution 911f17 use?

Python Debug Execution 911f17 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 Python Debug Execution 911f17 use?

About 892 tokens (SKILL.md is roughly 3.6k 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 Python Debug Execution 911f17?

Skills that share tags, products or a category with Python Debug Execution 911f17: 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 Python Debug Execution 911f17?

HKUDS (a GitHub organization) maintains it in HKUDS/OpenSpace, which has 7,749 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.