run-experiment
What it does
This Codex version of the run experiment skill launches training jobs on the compute setup your project uses. It is for researchers who want to run code on a GPU from Codex.
When to use it
- βWhen you want to start a training job on a local GPU or remote server.
- βWhen you need to run an experiment on Vast.ai or Modal.
- βWhen you want an environment checked before a long run starts.
Skill link
https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/blob/main/skills/skills-codex/run-experiment/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βI need my training experiment launched on the remote GPU server described in my project notes.β
5 new skills a week. 1 minute to read.
How it works
The agent reads the project notes to find the environment, checks the GPU, and starts the job. For a new environment, it writes a spec and runs a simple check before trusting the setup.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Run Experiment
Deploy and run ML experiment: $ARGUMENTS
Workflow
Step 1: Detect Environment
Read the project's AGENTS.md to determine the experiment environment:
- Local GPU: Look for local CUDA/MPS setup info
- Remote server: Look for SSH alias, conda env, code directory
- Vast.ai instance: Look for
gpu: vast,vast_instance, SSH host/port, remote path, and optionalauto_destroy - Modal serverless: Look for
gpu: modal, app/function name, image/dependency setup, and secrets
If no server info is found in AGENTS.md, ask the user.
Environment contract (../shared-references/compute-env-contract.md): before
building or trusting any environment, read the provider's env ledger
(.aris/compute/<provider>.md) β an unchanged spec hash means warm-reuse, a
changed one means rebuild. New env β write the declarative spec first, render it
for this provider's shape, and never declare it ready on import-success alone:
run the seeded kernel witness, and after any rebuild/doc edit run the
agent-follows-doc pass (a fresh subagent executes the documented invocation
verbatim and reports doc-vs-reality divergence).
Step 2: Pre-flight Check
Check GPU availability on the target machine:
Remote:
ssh <server> nvidia-smi --query-gpu=index,memory.used,memory.total --format=csv,noheader
Local:
nvidia-smi --query-gpu=index,memory.used,memory.total --format=csv,noheader
# or for Mac MPS:
python -c "import torch; print('MPS available:', torch.backends.mps.is_available())"
Free GPU = memory.used < 500 MiB.
Step 3: Sync Code (Remote Only)
Check the project's AGENTS.md for a code_sync setting. If not specified, default to rsync.
Option A: rsync (default)
Only sync necessary files β NOT data, checkpoints, or large files:
rsync -avz --include='*.py' --exclude='*' <local_src>/ <server>:<remote_dst>/
Option B: git (when code_sync: git is set in AGENTS.md)
Push local changes to remote repo, then pull on the server:
# 1. Push from local
git add -A && git commit -m "sync: experiment deployment" && git push
# 2. Pull on server
ssh <server> "cd <remote_dst> && git pull"
Benefits: version-tracked, multi-server sync with one push, no rsync include/exclude rules needed.
Option C: Vast.ai instance
If gpu: vast is configured, treat the Vast.ai machine as a remote server with an explicit lifecycle:
- Verify the instance is running and reachable.
- Sync code to the configured remote path.
- Confirm data/checkpoints are already mounted or intentionally copied.
- Record the instance id in the launch summary for later cleanup.
Do not silently ignore a requested Vast.ai route. If Vast.ai CLI credentials or instance metadata are missing, stop and ask the user to configure them.
Step 3.5: W&B Integration (when wandb: true in AGENTS.md)
Skip this step entirely if wandb is not set or is false in AGENTS.md.
Before deploying, ensure the experiment scripts have W&B logging:
Check if wandb is already in the script β look for
import wandborwandb.init. If present, skip to Step 4.If not present, add W&B logging to the training script:
import wandb wandb.init(project=WANDB_PROJECT, name=EXP_NAME, config={...hyperparams...}) # Inside training loop: wandb.log({"train/loss": loss, "train/lr": lr, "step": step}) # After eval: wandb.log({"eval/loss": eval_loss, "eval/ppl": ppl, "eval/accuracy": acc}) # At end: wandb.finish()Metrics to log (add whichever apply to the experiment):
train/lossβ training loss per steptrain/lrβ learning rateeval/loss,eval/ppl,eval/accuracyβ eval metrics per epochgpu/memory_usedβ GPU memory (viatorch.cuda.max_memory_allocated())speed/samples_per_secβ throughput- Any custom metrics the experiment already computes
Verify wandb login on the target machine:
ssh <server> "wandb status" # should show logged in # If not logged in: ssh <server> "wandb login <WANDB_API_KEY>"
The W&B project name and API key come from
AGENTS.md(see example below). The experiment name is auto-generated from the script name + timestamp.
Step 4: Deploy
Remote (via SSH + screen)
For each experiment, create a dedicated screen session with GPU binding:
ssh <server> "screen -dmS <exp_name> bash -c '\
eval \"\$(<conda_path>/co
FAQ
Where does it find the server details?
It reads the project's AGENTS.md file, and asks you if no server information is there.
Does it check the GPU first?
Yes. It runs a pre-flight check on GPU availability before starting.
What about Modal?
Modal is handled through its serverless app and dependency setup, as the skill describes.
Details
Original description by the author
Deploy and run ML experiments on local or remote GPU servers. Use when user says \"run experiment\", \"deploy to server\", \"\u8dd1\u5b9e\u9a8c\", or needs to launch training jobs.
Popularity
- GitHub stars
- 18k
- Ranking position
- #10615
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
ablation-planner
18kHelps your agent plan ablation studies for a paper, choosing the tests reviewers are likely to ask for once the main results look good.
alphaxiv
18kLets your agent quickly read one research paper using AlphaXiv summaries, with full text or LaTeX source as backup, from an arXiv link or ID.
analyze-results
18kHelps your agent analyze machine learning experiment results, compare runs against a baseline, and turn the numbers into clear findings and next steps.
arxiv
18kLets your agent search arXiv for academic papers, read their details, and save PDFs to your library for a research topic.
Similar skills
pytorch-patterns
280kHelps your agent use PyTorch for machine learning models. It applies best practices for efficient model training and ensures reproducible results.
evm-token-decimals
280kHelps your agent avoid errors with decimal numbers across different blockchain networks. It ensures token values are accurate in transactions and calculations.
ito-inference
280kLets your agent check the availability of AI models for use. It connects the compute request with the ready model service.