Getting it into your agent
This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.
/plugin marketplace add wan-huiyan/agent-traffic-control/plugin install agent-traffic-controlWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/harness-read-write-base-repo-path-in-worktree-stale-tree)<a href="https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/harness-read-write-base-repo-path-in-worktree-stale-tree"><img src="https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/harness-read-write-base-repo-path-in-worktree-stale-tree/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/harness-read-write-base-repo-path-in-worktree-stale-tree"><img src="https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/harness-read-write-base-repo-path-in-worktree-stale-tree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00308 | $0.01445 |
| Opus 5 | $0.00154 | $0.00723 |
| Sonnet 5 | $0.00062 | $0.00289 |
| Haiku 4.5 | $0.00031 | $0.00145 |
Grade A, and why
harness-read-write-base-repo-path-in-worktree-stale-tree scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Read/Write/Edit with a base-repo path silently hits the stale base tree in a worktree session
Problem
You're working in a worktree (<repo>/.claude/worktrees/<name>/). Your Bash tool runs with
cwd = the worktree, so grep/git/wc see the worktree's branch. But Read/Write/Edit
take absolute paths verbatim — if you write /…/<repo>/path (the BASE repo path, missing the
.claude/worktrees/<name>/ segment) you operate on the base repo's working tree, a different
checkout that shares the same .git and is usually parked on an unrelated, often month-stale
branch. The two trees diverge silently and you don't get an error.
Context / Trigger Conditions
- A
Read's line numbers or the functions it shows disagree with agrep/wcyou ran in the worktree cwd (e.g.def get_top_driversat L2926 via Read vs L3795 via grep). - A
Writereports success but the new file is absent fromgit status -sbin the worktree (it was created in the base repo, untracked there). - A
Writeto an existing file's path "works" but later edits to "the same file" via worktree-relative paths don't see your change. - A review panel / dispatched subagent / fresh
gitcheckout reports a file you KNOW you wrote as "absent from the working tree" / "doesn't exist on any ref" (it's sitting untracked in the base repo). - A file looks much smaller/older than the current branch should have.
Solution
- Always prefix file paths with the worktree root — the value the environment prints as
"Primary working directory" (
/…/<repo>/.claude/worktrees/<name>/…), never the bare/…/<repo>/….Bashis fine with worktree-relative paths (cwd is already the worktree);Read/Write/Editneed the full worktree-prefixed absolute path. - Cross-check on first Read of any file: if its line numbers don't match a
grep -nyou ran in the worktree cwd, you read the wrong tree — re-read via the worktree path. - After any Write/new file: confirm it shows in the worktree's
git status -sbbefore relying on it (and before dispatching a review that needs it). - Confirm the divergence when suspicious:
git -C <base-repo> rev-parse --abbrev-ref HEADvs the worktree's branch — if they differ, base-path reads/writes are operating on that other branch's content.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 12d ago First seen · 80 lines · 308 tokens per session scan A c854fa172156
harness-read-write-base-repo-path-in-worktree-stale-tree is a skill published in the GitHub repository wan-huiyan/agent-traffic-control (3 stars, last pushed today), licensed MIT. It adds 308 tokens to every session and 1,445 once invoked, about $0.0015 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
cloudflare-workers-ci-cd
Complete CI/CD guide for Cloudflare Workers using GitHub Actions and GitLab CI. Use for automated testing, deployment pipelines, preview environments, secrets management, or encountering deployment failures, workflow errors, environment configuration issues.
claude-code-bash-patterns
Claude Code Bash tool patterns with hooks, automation, git workflows. Use for PreToolUse hooks, command chaining, CLI orchestration, custom commands, or encountering bash permissions, command failures, security guards, hook configurations.
bump-sdk-version
Bump the FutureSearch SDK version across all files. Use when releasing a new SDK version, updating version numbers, or the user says bump version, release, version bump.
pr-check
PR review compliance: fetch review comments from an open PR, categorize as resolved/unresolved/dismissed, critically evaluate fixable items, implement approved fixes, and reply inline. Pass --unattended to halt on human-judgment items (emitted as Pending-Human) instead of prompting via AskUserQuestion.
babysit
PR babysitter: monitors CI status, auto-rebases when behind, auto-fixes CI where possible, delegates review comment handling to dlc:pr-check, and re-requests review after fixes. Designed for /loop usage with Remote Control.
git-ops
Git hygiene: clean up merged branches, prune stale remotes, and verify repository state.