Creates, pins, and cleans isolated Git worktree pairs to enable parallel execution environments for prompt and skill evaluations.
- GitHub stars
- 21
- Files
- 3
- Last commit
- Oct 29, 2026
- License
- MIT
- Allowed tools
- —
What does the worktree-execution skill do?
worktree-execution is an agent skill. Creates, pins, and cleans isolated Git worktree pairs to enable parallel execution environments for prompt and skill evaluations.
Summary generated from the skill's SKILL.md.
About the worktree-execution skill
Running parallel prompt or skill evaluations requires isolated environments to prevent interference between different versions of code or instructions. This skill manages the creation, pinning, and cleaning of Git worktree pairs located in the system temporary directory. It is designed for developers performing Rashomon prompt trials or skill comparisons where two distinct environments must run simultaneously against a specific base commit.
An agent loads this skill when it needs to set up paired execution environments using the worktree-create.sh script. The process generates two worktrees with detached HEAD branches at a pinned SHA, allowing for side-by-side testing of original versus optimized versions. The infrastructure relies on Git and requires sufficient disk space for the copies. Once the comparison is complete, the worktree-cleanup.sh script removes the directories, including a mechanism to recover orphaned worktrees through lock detection and lease expiry.
What an agent can do with it
- 1Compare prompt versionsRun a trial to see how an original prompt performs against an optimized version in parallel.
- 2Evaluate new skillsTest a new skill implementation against a baseline version using custom labels.
- 3Pin specific commitsEnsure both evaluation environments are locked to the exact same base commit SHA.
- 4Recover failed runsClean up abandoned or crashed worktree environments that were left behind by previous processes.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the worktree-execution skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the worktree-execution skill in Plugin
/plugin marketplace add shinpr/rashomon /plugin install rashomon@rashomon
Install the worktree-execution skill in Claude Code
~/.claude/skills/worktree-execution/SKILL.md
$ npx degit shinpr/rashomon/skills/worktree-execution ~/.claude/skills/worktree-executionInstall the worktree-execution skill in Claude Code (project)
.claude/skills/worktree-execution/SKILL.md
$ npx degit shinpr/rashomon/skills/worktree-execution .claude/skills/worktree-executionInstall the worktree-execution skill in Codex
~/.agents/skills/worktree-execution/SKILL.md
$ npx degit shinpr/rashomon/skills/worktree-execution ~/.agents/skills/worktree-executionInstall the worktree-execution skill in Gemini CLI
~/.gemini/skills/worktree-execution/SKILL.md
$ npx degit shinpr/rashomon/skills/worktree-execution ~/.gemini/skills/worktree-executionInstall the worktree-execution skill in Claude.ai
npx degit shinpr/rashomon/skills/worktree-execution worktree-execution && zip -r worktree-execution.zip worktree-execution # claude.ai → Customize → Skills → + → Create skill → Upload a skill → worktree-execution.zip
Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the scripts before you let an agent run them. How checks work · What to fix for more points
- Source repository linked and reachableshinpr/rashomon/skills/worktree-execution is public and reachablegithub.com/shinpr/rashomon/tree/HEAD/skills/worktree-executi ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit 2026-10-29github.com/shinpr/rashomon/commits ↗Pass
- No download-and-run or credential theft in scripts2 scripts read; no download-and-run, remote eval, base64 execution or credential uploadPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/shinpr/rashomon/blob/HEAD/skills/worktree-executi ↗Pass
- Pre-approved tools are scopedNo pre-approved tools; the agent asks before using onegithub.com/shinpr/rashomon/blob/HEAD/skills/worktree-executi ↗Pass
- SKILL.md follows the Agent Skills formatthe description does not say when to use the skillgithub.com/shinpr/rashomon/blob/HEAD/skills/worktree-executi ↗Finding
SKILL.md
View on GitHubWorktree Execution Skill
Architecture
Two isolated worktrees enable parallel prompt execution.
Orchestrator
│
├── Create Worktrees (in ${TMPDIR:-/tmp}/)
│ ├── worktree-rashomon-original-{timestamp}
│ └── worktree-rashomon-optimized-{timestamp}
│
├── Parallel Execution (Agent tool)
│ ├── Execution 1 → worktree-rashomon-original
│ └── Execution 2 → worktree-rashomon-optimized
│
├── Collect Results (await both)
│
└── Cleanup Worktrees (always)
Worktree Management
Creation
Script: scripts/worktree-create.sh
# Default labels (original/optimized) for prompt eval
./scripts/worktree-create.sh [repo_root]
# Custom labels for skill eval
./scripts/worktree-create.sh [repo_root] baseline with-skill
./scripts/worktree-create.sh [repo_root] old-version new-version
# Pin every pair in an evaluation run to the same commit
./scripts/worktree-create.sh [repo_root] trial-a trial-b [base_sha]
Output (stdout):
/tmp/worktree-rashomon-{label_a}-20260114-123456
/tmp/worktree-rashomon-{label_b}-20260114-123456
Properties:
- Location:
${TMPDIR:-/tmp}/ - Naming:
worktree-rashomon-{label}-{timestamp} - Branch: Detached HEAD at the pinned base commit
- Base commit: Caller-supplied SHA, resolved once per evaluation
- Active marker: Git worktree lock containing run ID, owner PID, start time, and lease expiry
- Labels default to
original/optimizedif not specified
Cleanup
Script: scripts/worktree-cleanup.sh
# Remove all rashomon worktrees
./scripts/worktree-cleanup.sh [repo_root]
# Remove specific worktrees
./scripts/worktree-cleanup.sh [repo_root] path1 path2
# Remove registered orphaned worktrees, including expired Rashomon locks
./scripts/worktree-cleanup.sh --orphans [repo_root]
Cleanup Triggers:
- After successful report generation
- In finally block on any failure
- On timeout
- On startup (orphan detection)
Parallel Execution Principle
Key: To achieve true parallel execution, send both Agent invocations in a single message.
The calling command determines which agents to invoke and how to structure the Agent invocations. This skill provides only the worktree infrastructure.
Error Handling (Worktree Operations)
| Scenario | Behavior |
|---|---|
| Creation fails | Report git error, suggest checking repository state |
| Cleanup fails | Log warning, attempt orphan cleanup on next run |
| Unlocked orphan | Remove registered Rashomon worktree after 1 hour |
| Crashed locked run | Remove after owner disappearance plus orphan age, or after lease expiry |
| Active long run | Set RASHOMON_LEASE_SECONDS before creation so the lease covers the run |
Scripts Reference
worktree-create.sh
| Exit Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Not a git repository |
| 2 | Creation failed |
worktree-cleanup.sh
| Exit Code | Meaning |
|---|---|
| 0 | Success (or nothing to clean) |
| 1 | Not a git repository |
| 2 | Cleanup partially failed |
Constraints
- No concurrent comparisons: One rashomon execution per repository
- Git required: A version supporting
git worktree lock - Disk space: Sufficient space for worktree copies
Files in this skill
3worktree-execution skill questions
How do I install the worktree-execution skill in Claude Code?
Run npx degit shinpr/rashomon/skills/worktree-execution ~/.claude/skills/worktree-execution. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the worktree-execution skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
How can I ensure both worktrees in an evaluation run use the same commit?
You can pin every pair to the same commit by providing a base SHA when running the creation script.
What happens if a worktree process crashes or leaves an orphan?
The system can remove registered orphaned worktrees, including those with expired locks, using the cleanup script.