smithery/butanium

repl

Persistent Python REPL server that avoids reloading heavy packages (torch, transformers, nnterp, vllm). Use when running multiple Python commands with heavy imports, loading ML models, or doing iterative testing where variables should persist between executions.

Installation

$ npx skills add smithery/butanium --skill repl

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,401 B
  • docs SUMMARY.md 274 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Python REPL - Persistent Session

Keeps Python interpreter running between commands, avoiding 20+ second package reload overhead.

When to use this skill

Use the REPL when you're about to:

  • Import heavy packages: torch, transformers, nnterp, vllm, diffusers
  • Run multiple Python commands that share state
  • Do iterative testing/debugging with ML models
  • Execute multi-step workflows (load model → compile config → query)

Don't use for one-off simple Python commands.

Setup (once per project)

uv add --editable ~/projects/research-libs/claude-repl

Quick check: Is server running?

echo '{"action":"ping"}' | timeout 2 nc -U /run/user/$(id -u)/claude-repl.sock

Start server

uv run claude-repl server &

Create session with imports

cat > /run/user/$(id -u)/session.json << 'EOF'
{
  "action": "create_session",
  "session_id": "main",
  "python_path": ["./src"],
  "preload_code": "import torch\nfrom mylib import Model\nprint('Ready')"
}
EOF
cat /run/user/$(id -u)/session.json | nc -U /run/user/$(id -u)/claude-repl.sock

Execute code

For simple code:

echo '{"action":"execute","session_id":"main","code":"print(model.num_layers)"}' | nc -U /run/user/$(id -u)/claude-repl.sock

For complex code (avoids shell escaping issues):

cat > /run/user/$(id -u)/code.py << 'EOF'
# Your code here
result = model.forward(x)
print(result.shape)
EOF

uv run python -c "
import json
code = open('/run/user/$(id -u)/code.py').read()
print(json.dumps({'action': 'execute', 'session_id': 'main', 'code': code}))
" | nc -U /run/user/$(id -u)/claude-repl.sock

Export to Jupyter notebook

Convert your session history to a notebook for sharing/reproducibility:

echo '{"action":"export_notebook","session_id":"main","path":"./experiment.ipynb"}' | nc -U /run/user/$(id -u)/claude-repl.sock

Key points