Code runner

From ericwang915/PythonClaw · View interactive version

Code runner is an AI agent skill from the GitHub repository ericwang915/PythonClaw. Execute Python code snippets safely in an isolated subprocess with timeout protection. Use when: the user asks to run, test, or evaluate Python code, calculate expressions, or prototype logic. NOT for: running shell commands, executing other languages, or code that needs filesystem/network access.

How to use this skill

Skill file

Code Runner

When to Use

When NOT to Use

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 | --code "print(2+2)" |

| From file | --file script.py |

| Stdin | Pipe code via stdin |

Options:

| Option | Description | Default |

|--------|-------------|---------|

| --timeout N | Max execution time (seconds) | 30 |

| --format json | Output as JSON (stdout, stderr, exit_code) | text |

| --no-capture | Stream output directly | off |

Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.