A Claude Code skill that runs a Python script inside an existing GNU Screen session with output logging.
Useful for launching long-running jobs (e.g. ML training) in persistent terminal sessions, capturing full logs, and getting an immediate sanity check on startup errors.
- Resolves the Python binary from the given Conda environment
- Injects a new window into the target screen session running the script with unbuffered output piped to a log file
- Waits 8 seconds, then tails the log to surface any startup errors (missing packages, CUDA OOM, etc.)
Copy SKILL.md into your Claude Code skills directory (typically ~/.claude/skills/).
/screen-run [session-name] [conda-env] [log-file] [script.py and args...]
/screen-run training myenv /tmp/train.log train.py --epochs 100 --lr 0.001
This will:
- Attach to the screen session named
training - Use the Python binary from the
myenvConda environment - Log all output (stdout + stderr) to
/tmp/train.log - Report the first few lines of output after startup
Apache 2.0