git-pull-after-squash-merge

git-pull-after-squash-merge is a skill for Claude Code from wan-huiyan/agent-traffic-control. It costs 222 tokens per session (1,450 once invoked), scanned A, original, MIT.

A guide to fixing local Git files that appear untracked after a pull request was squash-merged. A squash merge combines the branch's changes into a new commit with a different history.

In plain words
What is it for?
Use it after squash merges when pulling, checking out main, or switching branches is blocked by files listed as untracked.
Why use it?
It explains why Git may refuse to pull or switch branches because local files would be overwritten, even though those files now exist on main.

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 after squash merges when pulling, checking out main, or switching branches is blocked by files listed as untracked.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wan-huiyan/agent-traffic-control/git-pull-after-squash-merge
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 git-pull-after-squash-merge
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 git-pull-after-squash-merge

README.md
[![agentmods](https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/git-pull-after-squash-merge/github.svg)](https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/git-pull-after-squash-merge)
Your own site
<a href="https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/git-pull-after-squash-merge"><img src="https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/git-pull-after-squash-merge/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 git-pull-after-squash-merge

Your own site · 80×15
<a href="https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/git-pull-after-squash-merge"><img src="https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/git-pull-after-squash-merge.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 222 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,450 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.00222 $0.01450
Opus 5 $0.00111 $0.00725
Sonnet 5 $0.00044 $0.00290
Haiku 4.5 $0.00022 $0.00145

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

Security

Grade A, and why

git-pull-after-squash-merge 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 9d 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/git-pull-after-squash-merge/SKILL.md · 133 lines

How it starts

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

Fix git pull After Squash Merge

Problem

After a PR is squash-merged to main, switching branches or pulling fails with:

error: The following untracked working tree files would be overwritten by merge:
    data/results/experiment_1.json
    data/results/experiment_2.json
    docs/findings/analysis.html
Please move or remove them before you merge.

These files ARE on main (from the squash merge) but git sees them as untracked locally because squash merge creates a new commit hash — the original branch commits never appear in main's history.

Context / Trigger Conditions

This happens when:

  • A branch created new files (not just modified existing ones)
  • The branch was squash-merged (not regular merge) to main
  • You're on a different local branch that also has those files (from cherry-picks, worktree remnants, or the original branch)
  • git pull or git checkout main refuses to proceed

Common scenarios:

  • Working on branch B while branch A (which created new files) gets squash-merged
  • Checking out main after a parallel session merged files you also have locally
  • Multiple Claude Code sessions creating overlapping experiment result files

Solution

⚠️ Safety first — diff CONTENT, not just existence, before removing. An untracked file that exists on main is not necessarily identical to your local copy. A long-stale branch's local copy often has unique edits (a 1-line SHA reference, a draft note). Blindly rm-ing / git clean -fd / reset --hard destroys that content silently. The default instinct (and Options 2-4 below) skip this check — don't.

Option 1: Diff each blocking file against main, back up differers, then remove

# For each blocking file: compare LOCAL untracked copy vs origin/main's version
f=path/to/blocking/file
if git diff --quiet --no-index <(git show origin/main:"$f" 2>/dev/null) "$f" 2>/dev/null; then
  echo "IDENTICAL to origin/main — safe to rm"
  rm -f "$f"
else
  echo "DIFFERS — back up the local copy before removing (it has unique content)"
  mkdir -p /tmp/untracked-backup/"$(dirname "$f")"
  cp "$f" /tmp/untracked-backup/"$f"
  git diff --no-index <(git show origin/main:"$f" 2>/dev/null) "$f"  # eyeball what's unique
  rm -f "$f"   # only after backing up
fi
git checkout main && git pull   # or: git merge --ff-only origin/main

Read the full file on GitHub · 133 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. 9d ago First seen · 133 lines · 222 tokens per session scan A 8fc187f87d4f

Subscribe to this mod's changes

git-pull-after-squash-merge is a skill published in the GitHub repository wan-huiyan/agent-traffic-control (3 stars, last pushed 4d ago), licensed MIT. It adds 222 tokens to every session and 1,450 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

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

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

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