
Isolate subagent verification from live worktree
Keeps a verification subagent from measuring your uncommitted edits by mistake
Isolate subagent verification from live worktree is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 5
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Isolate subagent verification from live worktree
This skill documents a failure mode where a gate-running or verification subagent dispatched into a worktree you are still editing silently measures the branch plus your uncommitted changes, then reports those counts as the branch's result. Nothing errors, so the numbers look legitimate while describing a tree that will never be merged.
The guidance centers on giving a verifying agent its own checkout that no one else writes to. The skill shows creating a detached worktree at an explicit commit inside the agent's prompt, optionally linking the tooling environment, running the gates there, and removing the worktree afterward. It also suggests pinning the expected SHA and requiring the agent to report an empty git status and the HEAD commit alongside every count, or sequencing verification after commits are pushed.
The skill also covers detection after the fact: re-running the same commands in a fresh detached worktree at the same SHA and comparing totals against the earlier report. It expects a git repository, the shell, and the worktree commands; it contains no bundled scripts.
When your agent uses it
A verification / gate-running subagent you dispatched into YOUR OWN worktree silently measures the branch PLUS your uncommitted edits, and reports the mixture as the branch's result. Nothing is clobbered and nothing errors — the suite really ran, the counts are real, they are just counts of a tree nobody will ever merge. Use when: (1) you dispatched an agent to "run the gates" / "verify main" / "check the suites" and pointed it at the directory you are still editing or committing in; (2) an agent reports a total that does not match the same command run before or after it (a task/decision/test count that moved with no merge between); (3) an agent reports the working tree as modified with files it did not write, or says HEAD advanced under it mid-run; (4) you are about to write "all suites green at <sha>" on evidence gathered while your own edits were unstaged. Fix: a verifying agent needs a checkout nobody else writes to — `git worktree add --detach /tmp/<name> <sha>` in the agent's own prompt, or finish and p
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (6 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the agent-traffic-control plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add wan-huiyan/agent-traffic-control
/plugin install agent-traffic-control@wan-huiyan-agent-traffic-controlOr copy only this skill to ~/.claude/skills/isolate-subagent-verification-from-live-worktree:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/isolate-subagent-verification-from-live-worktree &&
cp -R "$tmp/plugins/agent-traffic-control/skills/isolate-subagent-verification-from-live-worktree" ~/.claude/skills/isolate-subagent-verification-from-live-worktree &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/isolate-subagent-verification-from-live-worktree inside it instead.
Copy the skill folder to ~/.agents/skills/isolate-subagent-verification-from-live-worktree to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/isolate-subagent-verification-from-live-worktree &&
cp -R "$tmp/plugins/agent-traffic-control/skills/isolate-subagent-verification-from-live-worktree" ~/.agents/skills/isolate-subagent-verification-from-live-worktree &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/isolate-subagent-verification-from-live-worktree inside it instead.
Copy the skill folder to ~/.cursor/skills/isolate-subagent-verification-from-live-worktree to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/isolate-subagent-verification-from-live-worktree &&
cp -R "$tmp/plugins/agent-traffic-control/skills/isolate-subagent-verification-from-live-worktree" ~/.cursor/skills/isolate-subagent-verification-from-live-worktree &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/isolate-subagent-verification-from-live-worktree inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/wan-huiyan/agent-traffic-control.git --path plugins/agent-traffic-control/skills/isolate-subagent-verification-from-live-worktreeOr copy the folder to ~/.gemini/skills/isolate-subagent-verification-from-live-worktree yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/isolate-subagent-verification-from-live-worktree:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/isolate-subagent-verification-from-live-worktree &&
cp -R "$tmp/plugins/agent-traffic-control/skills/isolate-subagent-verification-from-live-worktree" ~/.copilot/skills/isolate-subagent-verification-from-live-worktree &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/isolate-subagent-verification-from-live-worktree inside it instead.
Get the folder:
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.gitThen copy agent-traffic-control/plugins/agent-traffic-control/skills/isolate-subagent-verification-from-live-worktree into your agent's skills folder as isolate-subagent-verification-from-live-worktree. Agents that support SKILL.md read one folder per skill.
What it does
- Dedicated verification checkout
- Shows how to create a detached worktree at a fixed commit so the agent never touches the tree you are editing.
- Commit pinning
- Has the agent confirm HEAD matches the expected SHA before any suite runs.
- Clean-tree evidence
- Requires git status and HEAD output in every verification report so counts can be traced to a commit.
- Mid-run drift detection
- Explains the symptoms of contamination, such as totals moving between identical runs or unexpected modified files.
- After-the-fact recheck
- Describes re-measuring suspect results in a clean worktree and superseding wrong numbers.
Good for
- Verify that main is green before merging a batch of pull requests
- Run the test suites against a specific commit while I keep editing
- Check whether a verification agent's reported test counts reflect the branch
- Recheck suspicious gate results in a clean temporary worktree
Isolate subagent verification from live worktree FAQ
What does Isolate subagent verification from live worktree change in my repository?
The guidance has the agent create a temporary detached git worktree under /tmp for verification and remove it afterward. It does not modify your working tree.
When should I use Isolate subagent verification from live worktree?
When you dispatch an agent to run gates or verify main while you are still editing or committing in the same directory, or when reported totals do not match an identical earlier run.
What tools does Isolate subagent verification from live worktree need?
It relies on git worktree commands and the repository's own test and validation commands. It bundles no scripts.
How do I install Isolate subagent verification from live worktree in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/isolate-subagent-verification-from-live-worktree to use it in all your projects, or to .claude/skills/isolate-subagent-verification-from-live-worktree in one project. Or install the agent-traffic-control plugin, which includes it: /plugin marketplace add wan-huiyan/agent-traffic-control, then /plugin install agent-traffic-control@wan-huiyan-agent-traffic-control.
Does Isolate subagent verification from live worktree run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Isolate subagent verification from live worktree?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Isolate subagent verification from live worktree?
The closest alternatives to Isolate subagent verification from live worktree are Dispatched bash agent git checkout clobbers uncommitted edit, Git worktree, Principle prove it works, Take over resume and Git workflow and versioning.
Where this comes from
- Description: from the skill's own SKILL.md.
More from wan-huiyan/agent-traffic-control

Teaches agents to refuse a flawed instruction only with measured evidence attached
- Open source
- 5 GitHub stars
- Developer tools

Catches silent deletions when a subagent edits large files with repeated blocks
- Open source
- 5 GitHub stars
- Developer tools

Holds a pull request from merging by stopping its agent, disarming auto-merge, then
- Open source
- 5 GitHub stars
- Developer tools

Checks that a batch of pull requests does not cite file paths that will never exist
- Open source
- 5 GitHub stars
- Developer tools

Checks whether a pull request truly landed by comparing file content, not commit subjects
- Open source
- 5 GitHub stars
- Developer tools

Checks a branch for stale-base changes that would silently undo newer main work
- Open source
- 5 GitHub stars
- Developer tools



