PythonClaw code_runner
install
source · Clone the upstream repo
git clone https://github.com/ericwang915/PythonClaw
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ericwang915/PythonClaw "$T" && mkdir -p ~/.claude/skills && cp -r "$T/pythonclaw/templates/skills/dev/code_runner" ~/.claude/skills/ericwang915-pythonclaw-code-runner && rm -rf "$T"
manifest:
pythonclaw/templates/skills/dev/code_runner/SKILL.mdsource content
Code Runner
When to Use
- Run or test Python code snippets
- Evaluate expressions (e.g., "calculate 2^100")
- Prototype logic or verify algorithms
- Execute user-provided Python code safely
When NOT to Use
- Running shell commands or external programs — use
/ terminalrun_command - Executing non-Python code (JavaScript, etc.)
- Code requiring heavy I/O, network calls, or persistent state
- Editing or analyzing code without running it
Setup
No API keys or credentials needed. Uses the bundled
run_code.py script.
Usage/Commands
python {skill_path}/run_code.py [options]
Input methods:
| Method | Example |
|---|---|
| Inline code | |
| From file | |
| Stdin | Pipe code via stdin |
Options:
| Option | Description | Default |
|---|---|---|
| Max execution time (seconds) | 30 |
| Output as JSON (stdout, stderr, exit_code) | text |
| Stream output directly | off |
Notes
- Code runs in a subprocess (not eval/exec in the agent process) for safety
- Timeout prevents infinite loops
- Working directory is the project root
- For shell commands or other languages, use the terminal directly