code-runner
Skill16 starsChanged 11 months agoMITView on GitHub
Run code snippets in 30+ programming languages including JavaScript, Python, TypeScript, Java, C, C++, Go, Rust, Ruby, PHP, and more. Use when the user wants to execute code, test algorithms, verify output, run scripts, or check code behavior. Supports both interpreted and compiled languages.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- TaiMaBenJi/taima-skillstheir own version, first seen Oct 11, 2026
- fastclaw-ai/fastclawtheir own version, first seen Oct 8, 2026
- yanggujun/open-axletheir own version, first seen Sep 5, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- fastclaw-ai/fastclaw★ 1.4ksame name
- TaiMaBenJi/taima-skills★ 1same name
- yanggujun/open-axle★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Use this skill when:
- Distinctive: line 74
⚠️ Important for AI Agents: Use stdin to avoid escaping issues with quotes, backslashes, and special characters.
- Distinctive: line 124
If there are errors (stderr), explain what went wrong
- Very specific: line 130
Use cmd /c for batch scripts
- Very specific: line 137
Use #!/usr/bin/env shebang for portable scripts
- Distinctive: line 169
Consider running in a sandboxed environment for untrusted code
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Code Runner Skill
This skill enables you to run code snippets in multiple programming languages directly from the command line.
When to Use This Skill
Use this skill when:
- The user wants to run or execute a code snippet
- Testing algorithm implementations or logic
- Verifying expected output of code
- Running quick scripts or one-liners
- Checking syntax or runtime behavior
- Demonstrating code functionality
Supported Languages
The following languages are supported (requires the interpreter/compiler to be installed):
| Language | Command | File Extension |
| JavaScript | node | .js |
| TypeScript | ts-node | .ts |
| Python | python | .py |
| Java | java (compile & run) | .java |
| C | gcc (compile & run) | .c |
| C++ | g++ (compile & run) | .cpp |
| Go | go run | .go |
| Rust | rustc (compile & run) | .rs |
| Ruby | ruby | .rb |
| PHP | php | .php |
| Perl | perl | .pl |
| Lua | lua | .lua |
| R | Rscript | .r |
| Swift | swift | .swift |
| Kotlin | kotlin | .kts |
| Scala | scala | .scala |
| Groovy | groovy | .groovy |
| Dart | dart | .dart |
| Julia | julia | .jl |
| Haskell | runhaskell | .hs |
| Clojure | clojure | .clj |
| F# | dotnet fsi | .fsx |
| C# | dotnet script | .csx |
| PowerShell | pwsh | .ps1 |
| Bash | bash | .sh |
| Batch | cmd /c | .bat |
| CoffeeScript | coffee | .coffee |
| Crystal | crystal | .cr |
| Elixir | elixir | .exs |
| Nim | nim compile --run | .nim |
| OCaml | ocaml | .ml |
| Racket | racket | .rkt |
| Scheme | scheme | .scm |
| Lisp | sbcl --script | .lisp |
See references/LANGUAGES.md for detailed language configuration.
How to Run Code
Step 1: Identify the Language
Determine the programming language from:
- User's explicit request (e.g., "run this Python code")
- File extension if provided
- Code syntax patterns
Step 2: Execute Using the Runner Script
⚠️ Important for AI Agents: Use stdin to avoid escaping issues with quotes, backslashes, and special characters.
Recommended Method (stdin):
echo "<code>" | node scripts/run-code.cjs <languageId>Alternative Method (CLI argument - for simple code only):
node scripts/run-code.cjs <languageId> "<code>"Example - JavaScript:
echo "console.log('Hello, World!')" | node scripts/run-code.cjs javascriptExample - Python:
echo "print('Hello, World!')" | node scripts/run-code.cjs pythonExample - Java (multi-line):
echo "public class Test {
public static void main(String[] args) {
System.out.println(\"Hello from Java!\");
}
}" | node scripts/run-code.cjs javaExample - Multi-line code from variable:
# In bash
CODE='import math
print("Pi:", math.pi)
print("Result:", math.factorial(5))'
echo "$CODE" | node scripts/run-code.cjs python
# In PowerShell (inline here-string)
@"
import math
print("Pi:", math.pi)
print("Result:", math.factorial(5))
"@ | node scripts/run-code.cjs pythonStep 3: Return Results
- Show the output (stdout) to the user
- If there are errors (stderr), explain what went wrong
- Suggest fixes for common errors
Platform Notes
Windows
- Use
cmd /cfor batch scripts - PowerShell scripts require
pwshorpowershell - Path separators use backslash
\
macOS / Linux
- Bash scripts work natively
- Swift available on macOS
- Use
#!/usr/bin/envshebang for portable scripts
Error Handling
Common issues and solutions:
- Command not found: The language interpreter is not installed or not in PATH
- Suggest installing the required runtime
- Provide installation instructions
- Syntax errors: Code has syntax issues
- Show the error message
- Point to the line number if available
- Runtime errors: Code runs but fails during execution
- Display the stack trace
- Explain the error type
- Timeout: Code takes too long (default: 30 seconds)
- Warn about infinite loops
- Suggest optimizations
Security Considerations
⚠️ Important: Running arbitrary code can be dangerous. Always:
- Review the code before execution
- Be cautious with code that:
- Accesses the file system
- Makes network requests
- Executes system commands
- Modifies environment variables
- Consider running in a sandboxed environment for untrusted code
Examples
Example 1: Run a JavaScript calculation
echo "console.log(Array.from({length: 10}, (_, i) => i * i))" | node scripts/run-code.cjs javascriptOutput: [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
Example 2: Run Python with imports
echo "import math; print(math.factorial(10))" | node scripts/run-code.cjs pythonOutput: 3628800
Example 3: Test a Go function
echo 'package main; import "fmt"; func main() { fmt.Println("Hello from Go!") }' | node scripts/run-code.cjs goOutput: Hello from Go!
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

