# Cross worktree spec handoff via checkout paths

> Cross worktree spec handoff via checkout paths is an open-source agent skill for developer tools. Lets one agent session read a file committed on another worktree branch, without merging. 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/cross-worktree-spec-handoff-via-checkout-paths
- **Repository:** https://github.com/wan-huiyan/agent-traffic-control
- **GitHub stars:** 5
- **License:** MIT
- **Skill name:** cross-worktree-spec-handoff-via-checkout-paths
- **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 covers passing a shared file, such as a design spec, handoff prompt, docs page or mockup, from one parallel coding session to another when the two sessions run in different git worktrees or branches and the file has not yet reached the base branch. It explains how to confirm the diagnosis by checking which branches contain commits that touch the missing path and whether the consuming branch includes them.

The core fix is a git checkout of the chosen paths from the producer branch into the consumer's working tree. This stages the files without switching branches or touching other files. The skill also covers gitignored files that need an exception added to .gitignore, committing the imported files on the consumer branch, and a read-only variant that prints a file from another ref with git show when the file does not need to exist on disk.

It expects a git repository with both worktrees sharing the same .git directory, and it relies only on standard git commands with no scripts included.

## When your agent uses it

> Pass a shared file between two parallel sessions in different worktrees or branches, without merging to main first — a design spec, docs, a handoff prompt, a mockup. `git checkout <branch> -- <paths>` stages it. Use when a session says "the file doesn't exist". Not co editing.

## 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/cross-worktree-spec-handoff-via-checkout-paths)
- [License: MIT](https://github.com/wan-huiyan/agent-traffic-control/tree/HEAD/plugins/agent-traffic-control/skills/cross-worktree-spec-handoff-via-checkout-paths)

## Features

- **Diagnosing a missing file:** Steps to confirm the file exists on another branch and that the current branch does not include those commits.
- **Pulling paths across worktrees:** Uses git checkout with a tree-ish and paths to stage files or whole directories without switching branches.
- **Handling gitignored files:** Shows how to find the ignore rule and add a narrow exception so imported files stay tracked.
- **Read-only inspection:** Describes printing a file from another branch with git show when it does not need to be on disk.
- **Clean main-bound extraction:** A variant that builds a throwaway worktree off main to land a subset of work from a shared branch.

## Good for

- Give a second coding session the design spec another session wrote on a different branch
- Import a handoff prompt from another worktree into the current branch
- Bring HTML mockups from a parallel session into my working tree
- Find which branch holds a file a session says does not exist

## 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/cross-worktree-spec-handoff-via-checkout-paths`:

```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/cross-worktree-spec-handoff-via-checkout-paths &&
cp -R "$tmp/plugins/agent-traffic-control/skills/cross-worktree-spec-handoff-via-checkout-paths" ~/.claude/skills/cross-worktree-spec-handoff-via-checkout-paths &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/cross-worktree-spec-handoff-via-checkout-paths` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/cross-worktree-spec-handoff-via-checkout-paths` 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/cross-worktree-spec-handoff-via-checkout-paths &&
cp -R "$tmp/plugins/agent-traffic-control/skills/cross-worktree-spec-handoff-via-checkout-paths" ~/.agents/skills/cross-worktree-spec-handoff-via-checkout-paths &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/cross-worktree-spec-handoff-via-checkout-paths` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/cross-worktree-spec-handoff-via-checkout-paths` 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/cross-worktree-spec-handoff-via-checkout-paths &&
cp -R "$tmp/plugins/agent-traffic-control/skills/cross-worktree-spec-handoff-via-checkout-paths" ~/.cursor/skills/cross-worktree-spec-handoff-via-checkout-paths &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/cross-worktree-spec-handoff-via-checkout-paths` 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/cross-worktree-spec-handoff-via-checkout-paths
```

Or copy the folder to `~/.gemini/skills/cross-worktree-spec-handoff-via-checkout-paths` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/cross-worktree-spec-handoff-via-checkout-paths`:

```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/cross-worktree-spec-handoff-via-checkout-paths &&
cp -R "$tmp/plugins/agent-traffic-control/skills/cross-worktree-spec-handoff-via-checkout-paths" ~/.copilot/skills/cross-worktree-spec-handoff-via-checkout-paths &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/cross-worktree-spec-handoff-via-checkout-paths` 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/cross-worktree-spec-handoff-via-checkout-paths` into your agent's skills folder as `cross-worktree-spec-handoff-via-checkout-paths`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Does Cross worktree spec handoff via checkout paths switch my current branch?

No. The skill uses git checkout with a tree-ish followed by -- and paths, which restores only those paths and leaves the branch and other files unchanged.

### Do the producer and consumer sessions need to be pushed to origin?

No. Because both worktrees share the same .git, local-only branches work for the handoff. Pushing is optional.

### What if the imported file is gitignored?

The checkout still brings the file into the working tree, but the skill recommends finding the ignore rule with git check-ignore and adding a narrowly scoped exception before committing.

### Does Cross worktree spec handoff via checkout paths need any scripts or tools beyond git?

The skill uses only git commands and includes no scripts.

### How do I install Cross worktree spec handoff via checkout paths in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/cross-worktree-spec-handoff-via-checkout-paths to use it in all your projects, or to .claude/skills/cross-worktree-spec-handoff-via-checkout-paths 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 Cross worktree spec handoff via checkout paths 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 Cross worktree spec handoff via checkout paths?

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 Cross worktree spec handoff via checkout paths?

The closest alternatives to Cross worktree spec handoff via checkout paths are Concurrent session checkout clobbers shared worktree, Git worktree, Harness read write base repo path in worktree stale tree, Worktrees and Dispatched bash agent git checkout clobbers uncommitted edit.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Concurrent session checkout clobbers shared worktree](https://ai-powered.com/skills/concurrent-session-checkout-clobbers-shared-worktree): Concurrent session checkout clobbers shared worktree 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.
- [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.
- [Worktrees](https://ai-powered.com/skills/worktrees): Worktrees is an open-source agent skill for developer tools.
- [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.
- [Wt](https://ai-powered.com/skills/wt-timvw): Wt is an open-source agent skill for developer tools.
- [Check a stale branch is not undoing newer main work](https://ai-powered.com/skills/check-a-stale-branch-is-not-undoing-newer-main-work): Check a stale branch is not undoing newer main work is an open-source agent skill for developer tools.
- [Injected claude md is the worktrees copy not mains](https://ai-powered.com/skills/injected-claude-md-is-the-worktrees-copy-not-mains): Injected claude md is the worktrees copy not mains is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/cross-worktree-spec-handoff-via-checkout-paths
