concurrent-session-checkout-clobbers-shared-worktree

concurrent-session-checkout-clobbers-shared-worktree is a skill for Claude Code from wan-huiyan/agent-traffic-control. It costs 214 tokens per session (1,817 once invoked), scanned A, original, MIT.

A warning about multiple coding sessions or people sharing one Git working directory. Git branches and uncommitted files are shared across sessions.

In plain words
What is it for?
Use it when files revert unexpectedly, the current branch changes, or unfamiliar edits appear. It helps diagnose interference between concurrent sessions.
Why use it?
When one session switches branches, the whole directory changes underneath the other session, which can make edits disappear or leave a confusing mix of files.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: mentions Claude Code.

Part of the agent-traffic-control plugin — 105 skills shipped together

Good fit Use it when files revert unexpectedly, the current branch changes, or unfamiliar edits appear. It helps diagnose interference between concurrent sessions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wan-huiyan/agent-traffic-control/concurrent-session-checkout-clobbers-shared-worktree
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add wan-huiyan/agent-traffic-control --skill concurrent-session-checkout-clobbers-shared-worktree
Clone the repo
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control

Made for: Claude Code.

Or install agent-traffic-control, the plugin that ships this one along with the rest of its 105 skills.

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

agentmods badge for concurrent-session-checkout-clobbers-shared-worktree

README.md
[![agentmods](https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/concurrent-session-checkout-clobbers-shared-worktree/github.svg)](https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/concurrent-session-checkout-clobbers-shared-worktree)
Your own site
<a href="https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/concurrent-session-checkout-clobbers-shared-worktree"><img src="https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/concurrent-session-checkout-clobbers-shared-worktree/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.

agentmods 80×15 button for concurrent-session-checkout-clobbers-shared-worktree

Your own site · 80×15
<a href="https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/concurrent-session-checkout-clobbers-shared-worktree"><img src="https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/concurrent-session-checkout-clobbers-shared-worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 214 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,817 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00214 $0.01817
Opus 5 $0.00107 $0.00908
Sonnet 5 $0.00043 $0.00363
Haiku 4.5 $0.00021 $0.00182

Measured 12d ago against content hash c8e2652321cb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

concurrent-session-checkout-clobbers-shared-worktree 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.

plugins/agent-traffic-control/skills/concurrent-session-checkout-clobbers-shared-worktree/SKILL.md · 132 lines

How it starts

The opening of the file, as written. The whole thing — 132 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Concurrent session's git checkout clobbers your shared working directory

Problem

Two Claude Code sessions (or any two agents/people) operate in the same working directory on the same clone. git checkout / git switch changes HEAD for the entire working tree — it is not per-session. When session B switches branches, session A's tree changes underneath it:

  • Uncommitted edits to tracked files may be carried across, reverted, or left in a confusing half-state.
  • Untracked files (new files you created) stay on disk but risk being swept into session B's next git add -A.
  • Edits get silently lost — e.g. a config field you added disappears.

It is invisible until something breaks: a function you wrote is "gone", a test errors on a symbol you defined, or a harness emits "file was modified, either by the user or by a linter" for a file you didn't expect to change.

Context / Trigger Conditions

  • A file you edited reverted to an older version with no action from you.
  • git branch --show-current is not the branch you were working on.
  • git status lists changes or untracked files you don't recognize.
  • Decisive: git reflog shows checkout: moving from <yours> to <other> that you never performed.

Solution

Do not keep fighting inside the shared directory — you will collide again. Isolate into a git worktree.

  1. Confirm the collisiongit reflog -5 reveals the foreign checkout. git log <your-branch> --oneline confirms your committed work is still safe on its branch (commits survive a checkout; only uncommitted work is at risk).
  2. Create a worktree for your existing branch (not a new branch):
    git worktree add /path/outside/repo/my-worktree <your-branch>
    
    Place it outside the repo (a sibling dir) to avoid .gitignore edits that would themselves collide.
  3. Migrate uncommitted work into the worktree:
    • Copy untracked files (cp the new files you created).
    • Re-apply tracked-file edits in the worktree (apply them fresh; the worktree has the clean branch tip).
    • Re-apply any edit that was clobbered — recover it from conversation context.
  4. Clean your pollution out of the shared dir so the other session gets it back as expected: git checkout <files-you-modified> and rm your untracked files (you copied them already).
  5. Switch your session into the worktree and continue there.
  6. Commit early and often to your feature branch — committed work cannot be clobbered by a foreign checkout.

Read the full file on GitHub · 132 lines

Changes

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.

  1. 12d ago First seen · 132 lines · 214 tokens per session scan A c8e2652321cb

Subscribe to this mod's changes

concurrent-session-checkout-clobbers-shared-worktree is a skill published in the GitHub repository wan-huiyan/agent-traffic-control (3 stars, last pushed today), licensed MIT. It adds 214 tokens to every session and 1,817 once invoked, about $0.0011 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.

Related

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.

secondsky/claude-skills · 50 tokens

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.

secondsky/claude-skills · 52 tokens

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.

futuresearch/futuresearch-python · 40 tokens

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.

rube-de/cc-skills · 67 tokens

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.

rube-de/cc-skills · 53 tokens

git-ops

Git hygiene: clean up merged branches, prune stale remotes, and verify repository state.

rube-de/cc-skills · 22 tokens