Skip to content
Skill

Cross worktree spec handoff via checkout paths

Lets one agent session read a file committed on another worktree branch, without merging

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

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.

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 (15 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-control

Or copy only this skill to ~/.claude/skills/cross-worktree-spec-handoff-via-checkout-paths:

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.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/cross-worktree-spec-handoff-via-checkout-paths 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/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.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/cross-worktree-spec-handoff-via-checkout-paths 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/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.

Cursor docs on skills

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

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

Gemini CLI docs on skills

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

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.

VS Code docs on skills

Get the folder:

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.

The SKILL.md format

What it does

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

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

More from wan-huiyan/agent-traffic-control