
Harness read write base repo path in worktree stale tree
Keeps Read, Write and Edit calls inside a git worktree instead of the base repo
Harness read write base repo path in worktree stale tree is an open-source agent skill for developer tools. It is available on Claude Code.
- Scripts
- None
- Platforms
- Claude Code
- GitHub stars
- 5
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Harness read write base repo path in worktree stale tree
This skill addresses a pitfall in worktree sessions where file tools given an absolute path to the base repository read and write a separate checkout that shares the same git history, often on an older branch. Bash commands run from the worktree directory, so grep and git results can disagree with what the file tools return, and newly written files may not appear in the worktree's git status.
The guidance tells the agent to build every file path under the worktree root shown as the primary working directory. It also lists symptoms to watch for, such as line numbers that do not match a grep run in the worktree, a written file missing from git status, or a file that looks smaller than expected. When suspicious, the agent can compare the base repository's current branch with the worktree's branch to confirm the divergence.
The skill is a single instruction document with no scripts. It assumes a Claude Code style session that uses git worktrees and the Read, Write and Edit tools.
When your agent uses it
In a git-worktree session, your OWN Read/Write/Edit tool calls that use a BASE-repo absolute path (one MISSING the `.claude/worktrees/<name>/` segment) silently operate on the base repo's working tree — a DIFFERENT, often month-stale branch sharing the same `.git`. Use when: (1) a `Read`'s line numbers / function locations don't match a `grep` you ran in the worktree cwd (Bash sees the worktree; Read with a base path sees the base repo); (2) a `Write`/`Edit` "succeeds" but the file never appears in the worktree's `git status -sb` (it landed in the base repo, untracked there); (3) a review/subagent (or a fresh checkout) reports a file you just wrote "doesn't exist"; (4) a file looks surprisingly smaller/older than expected (e.g. bq_queries.py 7228 lines via base path vs 8434 in the worktree). Root cause: harness file tools take absolute paths verbatim and do NOT pin to the worktree; the base repo is a separate checkout, usually parked on another branch. Fix: build EVERY file path under the worktree root (the e
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 (5 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/harness-read-write-base-repo-path-in-worktree-stale-tree:
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/harness-read-write-base-repo-path-in-worktree-stale-tree &&
cp -R "$tmp/plugins/agent-traffic-control/skills/harness-read-write-base-repo-path-in-worktree-stale-tree" ~/.claude/skills/harness-read-write-base-repo-path-in-worktree-stale-tree &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/harness-read-write-base-repo-path-in-worktree-stale-tree inside it instead.
Copy the skill folder to ~/.agents/skills/harness-read-write-base-repo-path-in-worktree-stale-tree 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/harness-read-write-base-repo-path-in-worktree-stale-tree &&
cp -R "$tmp/plugins/agent-traffic-control/skills/harness-read-write-base-repo-path-in-worktree-stale-tree" ~/.agents/skills/harness-read-write-base-repo-path-in-worktree-stale-tree &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/harness-read-write-base-repo-path-in-worktree-stale-tree inside it instead.
Copy the skill folder to ~/.cursor/skills/harness-read-write-base-repo-path-in-worktree-stale-tree 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/harness-read-write-base-repo-path-in-worktree-stale-tree &&
cp -R "$tmp/plugins/agent-traffic-control/skills/harness-read-write-base-repo-path-in-worktree-stale-tree" ~/.cursor/skills/harness-read-write-base-repo-path-in-worktree-stale-tree &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/harness-read-write-base-repo-path-in-worktree-stale-tree 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/harness-read-write-base-repo-path-in-worktree-stale-treeOr copy the folder to ~/.gemini/skills/harness-read-write-base-repo-path-in-worktree-stale-tree yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/harness-read-write-base-repo-path-in-worktree-stale-tree:
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/harness-read-write-base-repo-path-in-worktree-stale-tree &&
cp -R "$tmp/plugins/agent-traffic-control/skills/harness-read-write-base-repo-path-in-worktree-stale-tree" ~/.copilot/skills/harness-read-write-base-repo-path-in-worktree-stale-tree &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/harness-read-write-base-repo-path-in-worktree-stale-tree 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/harness-read-write-base-repo-path-in-worktree-stale-tree into your agent's skills folder as harness-read-write-base-repo-path-in-worktree-stale-tree. Agents that support SKILL.md read one folder per skill.
What it does
- Worktree path prefixing
- Requires file tool calls to use the worktree-prefixed absolute path rather than the base repository path.
- Symptom recognition
- Lists signs that file tools are reading or writing the wrong checkout, such as mismatched line numbers.
- Post-write verification
- Checks that newly written files appear in the worktree's git status before relying on them.
- Branch divergence check
- Compares the base repository's branch with the worktree branch to confirm a stale checkout.
Good for
- Make an edit to a file while working in a git worktree
- Verify that a newly created file shows up in the worktree's git status
- Diagnose why a file read shows different line numbers than a grep
- Confirm which branch the base repository is on compared with my worktree
Harness read write base repo path in worktree stale tree FAQ
When does Harness read write base repo path in worktree stale tree apply?
It applies in a git worktree session when Read, Write or Edit calls use a base repository absolute path that omits the .claude/worktrees/<name>/ segment.
What does Harness read write base repo path in worktree stale tree change in my workflow?
It instructs the agent to prefix file paths with the worktree root and to cross-check Read results against a grep run in the worktree directory.
Does Harness read write base repo path in worktree stale tree require any scripts or extra tools?
No. It ships only a SKILL.md with no scripts or reference files, and it relies on git and the file tools already available.
How do I install Harness read write base repo path in worktree stale tree in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/harness-read-write-base-repo-path-in-worktree-stale-tree to use it in all your projects, or to .claude/skills/harness-read-write-base-repo-path-in-worktree-stale-tree 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 Harness read write base repo path in worktree stale tree 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 Harness read write base repo path in worktree stale tree?
Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.
What are the best alternatives to Harness read write base repo path in worktree stale tree?
The closest alternatives to Harness read write base repo path in worktree stale tree are Main bash cwd persists nested worktree, Git worktree, Concurrent session checkout clobbers shared worktree, Injected claude md is the worktrees copy not mains and Cross worktree spec handoff via checkout paths.
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

