Skip to content

Guide · Agent skill

How to use the run-experiment agent skill for GPU servers

Updated · written with AI from the project's own documentation and checked against our catalogue data

The run-experiment skill is a set of written instructions that an AI coding agent follows when you ask it to launch a machine learning experiment. It covers finding your server or GPU setup in your project's AGENTS.md, checking that a GPU is free, copying only the needed code, and starting the training script in a detached screen session with logging. This guide explains what the skill does, how to install it, how to trigger it, and what it needs before you rely on it.

Run ML Experiments on GPU Serverswanshuiyin/Auto-claude-code-research-in-sleep · MIT

Quick start

  1. 1Download the skill ZIP. Download the run-experiment ZIP from our page. It contains SKILL.md in a run-experiment folder.
  2. 2Unzip into a skills folder. Unzip into ~/.claude/skills/ for all projects, or into the project's .claude/skills/ for one project. In the Claude apps, upload it under Settings → Capabilities → Skills instead.
  3. 3Describe your compute in AGENTS.md. Add SSH alias, GPU details, conda activation command, code directory and code_sync setting to your project's AGENTS.md.
  4. 4Make sure machine prerequisites exist. Confirm SSH access, nvidia-smi, your training framework, and screen, rsync or git on the machines involved.
  5. 5Ask for the experiment in plain language. Use a trigger phrase such as run experiment or deploy to server and name the script and arguments.
  6. 6Review the pre-flight and launch plan. Check the GPU memory results and the proposed commands before approving the launch.
  7. 7Confirm the run and collect results. Use screen -ls and the tee logs to verify progress, and copy results before any cleanup.

What the run-experiment skill makes the agent do

An agent skill is a folder containing a SKILL.md file with instructions the agent reads when a request matches the skill's description. The run-experiment skill's description says it deploys and runs ML experiments on local or remote GPU servers, and it triggers on phrases such as "run experiment", "deploy to server", or a request to launch training jobs.

Once triggered, the skill works as a checklist rather than a blind launch. The agent reads your project's AGENTS.md to learn the environment, checks GPU memory on the target machine, syncs code, optionally adds Weights & Biases logging, starts the job, and reports back which GPU and screen session it used.

  • Detects the environment from AGENTS.md: local GPU, remote SSH server, Vast.ai instance, or Modal serverless
  • Treats a GPU as free when memory used is under 500 MiB
  • Syncs only code files by default, not data or checkpoints
  • Runs each experiment in its own screen session on its own GPU
  • Uses tee to save logs for later inspection
  • Optionally sends a Feishu notification and destroys a Vast.ai instance after results are saved

Install the run-experiment skill

Download the ZIP for this skill from our page. The skill's files are in a folder named run-experiment that contains SKILL.md. Install it in one of two ways.

For Claude Code, unzip the folder into ~/.claude/skills/ to make it available for all your projects, or into a project's .claude/skills/ folder to limit it to that project.

For the Claude apps, upload the skill under Settings → Capabilities → Skills.

  • Personal install: unzip into ~/.claude/skills/
  • Project install: unzip into the project's .claude/skills/
  • Claude apps: Settings → Capabilities → Skills, then upload

Set up your project's AGENTS.md

The skill finds your compute environment by reading AGENTS.md in your project. If it finds no server information, the agent is instructed to ask you. Add a section that describes where experiments run. The skill's own example uses a Remote Server heading with the SSH alias, GPU details, conda activation command, code directory, and code_sync setting.

Other settings the skill looks for include wandb (true or false), and for Vast.ai, gpu: vast, vast_instance, SSH host and port, remote path, and auto_destroy. For Modal, look for gpu: modal and the app or function name.

  • SSH alias, conda activation command, and code directory for a lab server
  • code_sync: rsync (default) or git
  • wandb: true to add Weights & Biases logging
  • gpu: vast with vast_instance and auto_destroy for Vast.ai
  • gpu: modal with app/function name for Modal
## Remote Server - SSH: `ssh my-gpu-server` - GPU: 4x A100 (80GB each) - Conda: `eval "$(/opt/conda/bin/conda shell.bash hook)" && conda activate research` - Code dir: `/home/user/experiments/` - code_sync: rsync # default. Or set to "git" for

Trigger the skill with natural requests

You do not need special syntax. Describe the experiment in plain language and include one of the trigger phrases. The skill accepts the arguments you type after its name as the experiment description.

Be specific about the script, the machine, and any arguments, so the agent does not have to ask. If AGENTS.md is missing details, the agent will ask you for them rather than guess.

  • "Run experiment: train the baseline in train.py on my lab server"
  • "Deploy to server the eval sweep with 3 seeds, one per free GPU"
  • "Launch the training job on the Vast.ai instance and destroy it when results are saved"
  • "跑实验: fine-tune with config configs/base.yaml"

What the agent does during a run

For a remote server, the agent first checks GPUs with nvidia-smi over SSH, then syncs code and starts the job in a named screen session with the GPU bound through CUDA_VISIBLE_DEVICES. It then confirms the session is running with screen -ls and reports back.

If you ask for Weights & Biases logging and the script lacks it, the agent adds wandb.init, wandb.log, and wandb.finish calls, then checks wandb status on the target machine. Metrics it may log include train/loss, train/lr, eval metrics and throughput.

  • Pre-flight: nvidia-smi query for memory used and total per GPU
  • Sync: rsync with include rules for *.py, or git push and pull
  • Launch: screen session per experiment, output piped through tee to a log file
  • Verify: screen -ls on the remote machine
  • Notify: Feishu message only if ~/.codex/feishu.json is configured and not off
ssh <server> "screen -ls"

Examples of experiments the skill handles

The skill is most useful when you have several runs to place across GPUs. It can launch them in parallel on different GPUs, one screen session each, and report which GPU each run uses. For cloud use, it records the Vast.ai instance id and estimated hourly cost before launch so cleanup is traceable.

For Modal, the skill runs a modal run command after checking secrets, volumes, image dependencies, and output persistence. It records the app or function name, GPU type, timeout, and where results will be stored.

  • Three seeds of one training script, each on a free GPU of a shared lab server
  • A git-based sync to a server that pulls the latest committed code
  • A Vast.ai run that copies logs and checkpoints, then destroys only its recorded instance
  • A Modal serverless training run with mounted volumes for outputs

Safety notes: scripts and network

This skill runs scripts and uses the network. It runs SSH, rsync or git commands, and screen on the machines you configure, and it can call Vast.ai and Modal CLIs if you have credentials. It can also post to Feishu if you have that config. Review the commands it proposes before you approve them, especially on paid cloud GPUs.

Auto-destroy is the risky part. The skill is written to destroy a Vast.ai instance only after the process has exited and results are copied to a durable location. If any copy fails, it should not destroy the instance. Unless AGENTS.md explicitly says auto_destroy: true, it asks for confirmation first.

  • Do not enable auto_destroy until you trust your copy destinations
  • If the command fails to start or the instance is unreachable, the skill says not to relaunch blindly
  • Keep API keys out of AGENTS.md where possible; the skill uses wandb login with a key you supply

Tips for getting reliable results

Keep data and checkpoints out of the sync path. The rsync default only includes Python files, so put large data on the machine itself or mount it. Confirm the conda activation line in AGENTS.md works in a plain SSH session before you rely on the skill.

Record which GPU and screen session each run uses, since the skill reports these. Use the logs written by tee to check progress rather than re-launching a run.

  • Test the SSH alias and conda command manually first
  • Prefer code_sync: git when you run the same code on several servers
  • Use a different screen name for each experiment so sessions do not collide
  • Check nvidia-smi yourself if a GPU looks busy but you expect it free

What people use it for

  • Launching a training script on a free GPU of a shared lab server reached by SSH
  • Running several seeds of one experiment in parallel, each in its own screen session
  • Syncing only Python code to a remote machine without moving data or checkpoints
  • Adding Weights & Biases logging to a training script that lacks it
  • Running a Vast.ai training job and destroying the instance only after results are saved
  • Starting a Modal serverless training run with a recorded app, GPU type and volume

Frequently asked questions

How do I install the run-experiment agent skill?

Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. In the Claude apps, upload it under Settings → Capabilities → Skills.

What does the run-experiment skill need to work?

It needs SSH access to the target server with nvidia-smi on that machine, Python with PyTorch or your project's framework, and screen, rsync or git on the machines involved. Your project should also have an AGENTS.md file describing the environment.

Is the run-experiment skill free?

The skill is released under the MIT licence, as stated on its source page. Cloud services it can use, such as Vast.ai, Modal and Weights & Biases, have their own accounts and costs that this page does not cover.

Can the skill run experiments on Vast.ai or Modal?

Yes, if your AGENTS.md configures them. For Vast.ai it uses an instance id and SSH endpoint and can destroy the instance after results are saved. For Modal it runs modal run after checking secrets, volumes and output persistence.

Does the skill work without a GPU server?

It only automates launching on machines you already control. If no server is configured, the agent is instructed to ask you for the details rather than invent them.

What should I do if the skill will not launch a job?

Check the SSH alias and conda command in AGENTS.md by running them manually. The skill is designed to preserve exact errors and stop rather than relaunch blindly, so read the captured logs before retrying.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use run-experiment if you train models on a GPU machine you already control, or on rented Vast.ai or Modal GPUs, and want the agent to check GPU availability and keep a clear launch record. Skip it if you have no GPU access, want unattended paid cloud runs without review, or need help with non-ML tasks.

Download the skill