experiment-code — Claude Code skill: ML experiment code
Writes and iterates on ML experiment code for a research paper: training, evaluation, debugging, plots. Useful when you need a batch of runs and a comparison.
npx skills add lingzhi227/agent-research-skills --skill experiment-code -a claude-codeWhat experiment-code does
The skill has four actions. generate plans every run first — hyperparameter sweeps, ablations, baselines — then writes self-contained code inside the project directory, with no imports from reference repos. improve reads the current code and results, makes targeted edits, and keeps the best-scoring variant. debug reads the error message and applies a minimal fix, up to 4 retries before switching approach. plot pulls numbers from run_*/final_info.json and builds publication figures.
The project layout is fixed: experiment.py, plot.py, notes.txt, and run_1, run_2 folders holding final_info.json. Each run goes through python experiment.py --out_dir=run_i. Placeholder code such as pass or raise NotImplementedError is off the table, and the data has to be real rather than toy. PyTorch or scikit-learn are the preferred frameworks.
A few rules catch people out. The method must not land at 0% accuracy, so accuracy calculations get checked — a zero usually means a bug, not a failed idea. Seeds are required for reproducibility. Before each experiment the code needs a print statement saying what the results are supposed to show. One more thing for long logs: the error message is truncated to the last 1500 characters.
What it helps with
- plan a run set: sweeps, ablations, baselines
- generate a training and evaluation pipeline in one directory
- fix a crashing experiment from the error text
- raise the score of a working model with small edits
- build comparison plots from run results
Example prompts for the agent
- /experiment-code generate — build the training and evaluation pipeline for my experiment plan
- /experiment-code debug — here is the error, find the cause and fix it minimally
- /experiment-code improve — read the current code and results, propose edits and rerun
How to install experiment-code
1Skills CLI (Vercel)
npx skills add lingzhi227/agent-research-skills --skill experiment-code -a claude-code2Manually: put the files in place
~/.claude/skills/experiment-code/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/experiment-code/
1Skills CLI (Vercel)
npx skills add lingzhi227/agent-research-skills --skill experiment-code -a codex2Manually: put the files in place
.agents/skills/experiment-code/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add lingzhi227/agent-research-skills --skill experiment-code -a cursor2Manually: put the files in place
.cursor/skills/experiment-code/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install lingzhi227/agent-research-skills experiment-code2Manually: put the files in place
.github/skills/experiment-code/SKILL.md1Skills CLI (Vercel)
npx skills add lingzhi227/agent-research-skills --skill experiment-code -a gemini-cli2Platform CLI
gemini skills install https://github.com/lingzhi227/agent-research-skills --path skills/experiment-codeManually: put the files in place
.devin/skills/experiment-code/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add lingzhi227/agent-research-skills --skill experiment-code -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about experiment-code
How do I install experiment-code in Claude?
Run npx skills add lingzhi227/agent-research-skills --skill experiment-code -a claude-code. The skill file then lands at ~/.claude/skills/experiment-code/SKILL.md.
What does experiment-code do?
It generates ML experiment code, improves it across runs, debugs errors, and produces plots. It targets experiments for a research paper.
Which frameworks does it support?
PyTorch or scikit-learn are preferred. TensorFlow and Keras are not used.