exp-run

A command that starts training for the current machine-learning experiment branch. It checks the branch, prepares a remote computing instance, synchronises the code, and launches training in tmux, a persistent terminal session.

In plain words
What is it for?
Use it to provision an experiment machine, choose a training configuration, sync the experiment code, and start training.
Why use it?
It combines the setup steps needed to begin a training run and prevents training from being started from the main branch. It also handles the remote environment instead of requiring the training to run on the developer’s computer.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/zhyx12/projtool/exp-run
Clone the repo
git clone --depth 1 https://github.com/zhyx12/projtool
Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 548 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00027 $0.00548
Opus 5 $0.00014 $0.00274
Sonnet 5 $0.00005 $0.00110
Haiku 4.5 $0.00003 $0.00055

Measured yesterday against content hash 21c0d65706db, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

exp-run scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/projtool/assets/project_templates/claude/commands/exp-run.md · 50 lines

How it starts

The opening of the file, as written. The whole thing — 50 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are running the user's /exp-run command. Treat this as a request to launch training, end-to-end, with minimal back-and-forth. Read .proj-tool/project.toml for paths and entrypoint conventions.

Steps

  1. Verify branch + cleanliness.

    • Call mcp__projtool__worktree_status. If the current worktree is the main branch, refuse — training only happens on exp/* branches. Tell the user to mcp__projtool__new_experiment first.
    • If dirty: ask the user whether to commit-and-train or abort. Don't pass allow_dirty=true unless the user explicitly says so.
  2. Provision the instance.

    • Call mcp__projtool__instance_up with the experiment_id from the branch name (exp/<topic>exp-<topic>).
    • The pre-tool hook may warn if a binding already exists; act on its output.
  3. Pick a config.

    • List .proj-tool/project.toml [entrypoint].config_dir.
    • If the user provided a config in the slash-command argument, use it. Otherwise ask which config to run.
  4. Start training.

    • Call mcp__projtool__start_training with experiment_id and config_path. The tool flushes the code sync, writes the manifest stub, and starts a tmux session on the remote.
    • Report the run_id and the predicted duration (read it from the config if present, otherwise say "unknown — I'll poll").
  5. Hand back to the user.

    • Tell them whether you're going to poll proactively or wait for them to come back.
    • Do NOT block the conversation by polling in a tight loop.

On failure

  • start_training returning a hook block: explain the block (dirty worktree / unpushed commit / no instance), do not retry blindly.
  • instance_up failing on quota: tell the user, don't loop.
  • sync_flush taking >2min: ask the user whether to continue waiting or diagnose with mcp__projtool__diagnose.

Reminder

The full workflow rules live in .claude/skills/ml-research-workflow/. Load that skill if anything below the surface is unclear.

Read the full file on GitHub · 50 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 50 lines · 27 tokens per session scan A 21c0d65706db

Subscribe to this mod's changes

exp-run is a command published in the GitHub repository zhyx12/projtool (1 stars, last pushed 19d ago), licensed MIT. It adds 27 tokens to every session and 548 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.