/superpowers:experiment-worktreefrom superpowers
Use when an experiment plan is about to be executed and code changes need git isolation - creates an isolated git worktree with DL environment verification so failed experiments can be cleanly discarded
Ships in superpowers. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Create an isolated git worktree before making experiment-specific code changes. This ensures failed or inconclusive experiments can be discarded without touching the main branch.
Announce at start: "I'm using the experiment-worktree skill to set up an isolated workspace."
experiment-execution step 2, before any code changes.Run directory setup from the main project root, not from an existing worktree. For this skill:
<project_root> means the original checkout where the user started.<worktree_path> means <project_root>/.worktrees/<topic>..worktrees/<topic>/... path is relative to <project_root> unless the step explicitly says to run inside the worktree..worktrees/ls -d .worktrees 2>/dev/null
If found, use it. If not found, create it.
git check-ignore -q .worktrees
If NOT ignored: add .worktrees/ to .gitignore, commit the change, then proceed.
Default pattern: exp/<YYYY-MM-DD>-<topic>
<topic> comes from the experiment plan filename or the hypothesis summary.experiment-design and experiment-closeout (i.e., YYYY-MM-DD-<topic>).exp/2026-04-11-rotary-embeddingsIf the user provides a branch name, use it as-is.
<project_root>, record pre-worktree state:
git branch --show-current)git rev-parse HEAD)git status --porcelain)<project_root>, create the worktree:
git worktree add .worktrees/<topic> -b exp/<YYYY-MM-DD>-<topic>
<project_root>, create dataset symlinks into <worktree_path> if needed (see below).<worktree_path>.<worktree_path>/.experiment-metadata.json.Auto-detect and run the appropriate setup in priority order:
pyproject.toml with [tool.poetry] -> poetry installpyproject.toml without poetry -> pip install -e .setup.py or setup.cfg -> pip install -e .requirements.txt -> pip install -r requirements.txtenvironment.yml -> conda env updateAfter dependency setup:
python -c "import torch; print(torch.cuda.is_available())" (skip if torch is not installed).Large datasets must never be copied into the worktree. Instead, create symbolic links pointing back to the original project directory so every worktree shares the same data on disk.
Detection — scan the main project root (not the worktree) for data directories in priority order:
.env, config.yaml, *.toml [data] sections, etc.).data/, datasets/, raw_data/, processed_data/.Creation — for every detected data directory <dir>:
# Run from <project_root>, or use absolute paths.
ln -s <resolved_data_path> <worktree_path>/<dir>
<dir> already exists in the worktree (because it is tracked), skip it and warn.<dir> is itself a symlink in the main project, resolve it first (readlink -f) and link to the resolved target.ls <linked_path> > /dev/null.Record — add a "symlinked_data" array to .experiment-metadata.json listing every
path that was symlinked, so finishing-experiment-branch knows not to delete real data
during cleanup.
If no data directories are found, report that no dataset symlinks were created and ask whether the experiment needs data that should be linked manually.
pytest or the project-specific test command if a test suite exists.Write <worktree_path>/.experiment-metadata.json so that a future session can detect and resume:
{
"worktree_path": ".worktrees/<topic>",
"branch_name": "exp/<YYYY-MM-DD>-<topic>",
"base_branch": "main",
"base_commit": "<hash>",
"tree_was_clean": true,
"environment_tool": "pip",
"symlinked_data": ["data/", "datasets/raw"],
"created_at": "<ISO-8601>"
}
Worktree ready at .worktrees/<topic>
Branch: exp/<YYYY-MM-DD>-<topic>
Base commit: <hash>
Environment: <pip/poetry/conda>
CUDA: <available/not available/not checked>
Tests: <N passing / skipped>
.worktrees/ is gitignored.Called by: experiment-execution (step 2)
Pairs with: finishing-experiment-branch (cleanup after experiment)
What SKILL.md sets; muted values are Claude Code's defaults
11 skills in this plugin
/experiment-closeoutUse when an experiment run has finished and you need to decide whether to keep the code changes, revert them safely, and archive the outcome to avoid repeating the same failed experiment/experiment-designUse before changing a model, loss, optimizer, dataset pipeline, augmentation, or evaluation protocol for deep learning research work/experiment-executionUse when carrying out a written deep learning experiment plan, implementing experiment scaffolding, or running batches of research experiments/experiment-planningUse when an approved deep learning experiment design needs a concrete multi-step plan covering code changes, sanity checks, runs, and artifact capture/finishing-experiment-branchUse when an experiment is complete and the user has decided whether to keep or discard the code changes - handles branch merge, PR creation, pause, discard, and worktree cleanup/paper-to-implementationUse when translating a paper idea into code, deciding whether a paper is worth reproducing, or planning a faithful paper-based experimentnpx claudepluginhub shunyangliu/superpowers_dl --plugin superpowersOther plugins' skills for the same job