Skip to content
Skill

Dispatched bash agent git checkout clobbers uncommitted edit

Explains how dispatched Bash agents' git checkout can silently revert uncommitted edits

Dispatched bash agent git checkout clobbers uncommitted edit 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 Dispatched bash agent git checkout clobbers uncommitted edit

This skill documents a failure mode in multi-agent coding sessions: a review or verification subagent that has shell access runs a file-level git checkout, restore or stash to compare against HEAD, which quietly discards uncommitted changes in the shared worktree. The agent then reports the missing edit as a blocker, and other agents may repeat the finding. The skill walks through recognizing the symptoms, such as a file that no longer shows as modified or a passing test that depends on the vanished change, then re-applying the edit, rerunning the suite and committing.

It also covers a self-inflicted version where the developer restores a file with git checkout after a mutation test and loses earlier uncommitted work. The recommended fixes are committing or stashing before dispatching Bash-capable agents, using a separate worktree, restricting agents to read-only tools, or backing up files with cp before mutating them.

No scripts are included; the guidance is a set of diagnostic checks and sequencing rules for a git workflow, and it expects a git repository with a shared worktree.

When your agent uses it

A verification/review/audit subagent YOU dispatched (Workflow agents, Explore, general-purpose, code-reviewer — anything with Bash) runs a file-level `git checkout <path>` / `git restore <path>` / `git stash` to compare your work against HEAD, and silently REVERTS your uncommitted working-tree edit in the shared worktree. The agent then reports that edit as "missing / not persisted / blocker", and sibling agents pile onto the phantom. Use when: (1) a review or verification agent reports a file/entry/line you KNOW you just wrote is "missing", "not in the file", "not persisted", or "only in the diff not the file"; (2) its evidence cites "a subsequent git checkout shows…" or "git diff shows it but the working tree doesn't"; (3) a harness "file was modified, either by the user or by a linter" reminder names a file you edited but didn't touch since; (4) your own passing test suite REQUIRES the thing the agent says is missing (the decisive tell — if tests that need it passed, it WAS there). Prevention: commit (or s

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 (9 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/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit:

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/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit &&
cp -R "$tmp/plugins/agent-traffic-control/skills/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit" ~/.claude/skills/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit 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/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit &&
cp -R "$tmp/plugins/agent-traffic-control/skills/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit" ~/.agents/skills/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit 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/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit &&
cp -R "$tmp/plugins/agent-traffic-control/skills/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit" ~/.cursor/skills/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit 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/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit

Or copy the folder to ~/.gemini/skills/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit:

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/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit &&
cp -R "$tmp/plugins/agent-traffic-control/skills/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit" ~/.copilot/skills/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit 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/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit into your agent's skills folder as dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Symptom recognition
Lists the signs that an agent's git operation reverted your uncommitted edit rather than the edit being absent.
Recovery steps
Describes how to confirm the file state with grep and git status, re-apply the edit and recommit.
Sequencing prevention
Advises committing or stashing before dispatching Bash-capable review agents onto a shared worktree.
Read-only agent guidance
Suggests isolating agents in a separate worktree or instructing them not to run git mutations.
Mutation test safety
Explains why git checkout restores to HEAD and offers a cp backup pattern for safe restores.

Good for

  • Check whether a reviewer's claim that my edit is missing is a false alarm
  • Set up a multi-agent code review without losing uncommitted changes
  • Restore a file after a mutation test without discarding my unsaved fixes
  • Recover from a git checkout that reverted my working-tree changes

Dispatched bash agent git checkout clobbers uncommitted edit FAQ

What triggers Dispatched bash agent git checkout clobbers uncommitted edit?

It applies when a review or verification agent reports an edit as missing, when its evidence cites a git checkout, when a file edited earlier shows no modifications, or when a passing test requires a change the agent says is absent.

What does Dispatched bash agent git checkout clobbers uncommitted edit change in my repository?

The skill itself only provides guidance. The steps it describes re-apply your reverted edit, rerun tests and commit the affected files.

Does Dispatched bash agent git checkout clobbers uncommitted edit work with the self-inflicted case too?

Yes. It also covers restoring a file with git checkout after a mutation test, which can discard uncommitted edits, and recommends cp backups or committing first.

How do I install Dispatched bash agent git checkout clobbers uncommitted edit in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit to use it in all your projects, or to .claude/skills/dispatched-bash-agent-git-checkout-clobbers-uncommitted-edit 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 Dispatched bash agent git checkout clobbers uncommitted edit 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 Dispatched bash agent git checkout clobbers uncommitted edit?

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 Dispatched bash agent git checkout clobbers uncommitted edit?

The closest alternatives to Dispatched bash agent git checkout clobbers uncommitted edit are Git workflow and versioning, Git workflow, Isolate subagent verification from live worktree, Agent replace edit silently deletes neighbouring blocks and Take over resume.

Where this comes from

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

More from wan-huiyan/agent-traffic-control