# Isolate subagent verification from live worktree

> Isolate subagent verification from live worktree is an open-source agent skill for developer tools. Keeps a verification subagent from measuring your uncommitted edits by mistake. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/wan-huiyan/agent-traffic-control/tree/main/plugins/agent-traffic-control/skills/isolate-subagent-verification-from-live-worktree
- **Repository:** https://github.com/wan-huiyan/agent-traffic-control
- **GitHub stars:** 5
- **License:** MIT
- **Skill name:** isolate-subagent-verification-from-live-worktree
- **Collection:** https://github.com/wan-huiyan/agent-traffic-control
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-04

## About

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

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/wan-huiyan/agent-traffic-control/tree/HEAD/plugins/agent-traffic-control/skills/isolate-subagent-verification-from-live-worktree)
- [License: MIT](https://github.com/wan-huiyan/agent-traffic-control/tree/HEAD/plugins/agent-traffic-control/skills/isolate-subagent-verification-from-live-worktree)

## Features

- **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

## Install

### Claude Code

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):

```sh
/plugin marketplace add wan-huiyan/agent-traffic-control
/plugin install agent-traffic-control@wan-huiyan-agent-traffic-control
```

Or copy only this skill to `~/.claude/skills/isolate-subagent-verification-from-live-worktree`:

```sh
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.

### Codex

Copy the skill folder to `~/.agents/skills/isolate-subagent-verification-from-live-worktree` to use it in every repository:

```sh
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.

### Cursor

Copy the skill folder to `~/.cursor/skills/isolate-subagent-verification-from-live-worktree` to use it in every project:

```sh
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.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/wan-huiyan/agent-traffic-control.git --path plugins/agent-traffic-control/skills/isolate-subagent-verification-from-live-worktree
```

Or copy the folder to `~/.gemini/skills/isolate-subagent-verification-from-live-worktree` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/isolate-subagent-verification-from-live-worktree`:

```sh
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.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git
```

Then 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.

## 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.

## Alternatives

- [Dispatched bash agent git checkout clobbers uncommitted edit](https://ai-powered.com/skills/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit): Dispatched bash agent git checkout clobbers uncommitted edit is an open-source agent skill for developer tools.
- [Git worktree](https://ai-powered.com/skills/git-worktree): Git worktree is an open-source agent skill for developer tools.
- [Principle prove it works](https://ai-powered.com/skills/principle-prove-it-works): Principle prove it works is an open-source agent skill for developer tools.
- [Take over resume](https://ai-powered.com/skills/take-over-resume): Take over resume is an open-source agent skill for developer tools.
- [Git workflow and versioning](https://ai-powered.com/skills/git-workflow-and-versioning): Git workflow and versioning is an open-source agent skill for developer tools.
- [Git workflow](https://ai-powered.com/skills/git-workflow-aws-solutions): Git workflow is an open-source agent skill for developer tools.
- [Harness read write base repo path in worktree stale tree](https://ai-powered.com/skills/harness-read-write-base-repo-path-in-worktree-stale-tree): Harness read write base repo path in worktree stale tree is an open-source agent skill for developer tools.
- [Main bash cwd persists nested worktree](https://ai-powered.com/skills/main-bash-cwd-persists-nested-worktree): Main bash cwd persists nested worktree is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/isolate-subagent-verification-from-live-worktree
