git-ops

git-ops is a skill for Claude Code from rube-de/cc-skills. It costs 22 tokens per session (1,997 once invoked), scanned A, original, MIT.

A Git maintenance workflow that synchronises remote branch information, removes references to deleted remote branches, cleans up merged branches, and checks the repository state.

In plain words
What is it for?
Use it for routine Git housekeeping, including pruning remote references and removing local branches that have already been merged.
Why use it?
It reduces stale branch clutter and helps keep the local repository aligned with its remote.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Part of the dlc plugin — 9 skills shipped together

Good fit Use it for routine Git housekeeping, including pruning remote references and removing…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rube-de/cc-skills/git-ops
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 rube-de/cc-skills --skill git-ops
Clone the repo
git clone --depth 1 https://github.com/rube-de/cc-skills

Made for: Claude Code.

Or install dlc, the plugin that ships this one along with the rest of its 9 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-ops

README.md
[![agentmods](https://agentmods.dev/badge/skills/rube-de/cc-skills/git-ops.svg)](https://agentmods.dev/skills/rube-de/cc-skills/git-ops)
Your own site
<a href="https://agentmods.dev/skills/rube-de/cc-skills/git-ops"><img src="https://agentmods.dev/badge/skills/rube-de/cc-skills/git-ops.svg" alt="Measured on agentmods" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,997 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.00022 $0.01997
Opus 5 $0.00011 $0.00999
Sonnet 5 $0.00004 $0.00399
Haiku 4.5 $0.00002 $0.00200

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

Security

Grade A, and why

git-ops 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 7d 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/dlc/skills/git-ops/SKILL.md · 227 lines

How it starts

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

DLC: Git Ops

Automated git hygiene — clean up merged branches, prune stale remote tracking refs, and verify repository state.

Step 1: Sync with Remote

Fetch latest state, prune deleted remote branches, and sync the default branch.

# Detect the default branch dynamically
# 2>/dev/null suppresses errors when symbolic-ref is not set (e.g. shallow clone)
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||')

# Fallback: check for main, then master
if [ -z "$DEFAULT_BRANCH" ]; then
  if git show-ref --verify --quiet refs/remotes/origin/main; then
    DEFAULT_BRANCH="main"
  elif git show-ref --verify --quiet refs/remotes/origin/master; then
    DEFAULT_BRANCH="master"
  else
    echo "ERROR: Cannot determine default branch. Aborting."
    exit 1
  fi
fi

echo "Default branch: $DEFAULT_BRANCH"

# Fetch and prune stale remote tracking refs
git fetch origin --prune

# Abort if worktree has uncommitted changes
if [ -n "$(git status --porcelain)" ]; then
  echo "ERROR: Worktree is dirty — stash or commit your changes before running git-ops."
  exit 1
fi

# Capture starting branch before switching — Step 3 uses this for the commit range
START_REF=$(git branch --show-current)

# Switch to default branch and pull (fast-forward only to avoid merge commits)
git checkout "$DEFAULT_BRANCH"
git pull --ff-only origin "$DEFAULT_BRANCH"

If git pull --ff-only fails, abort with: "ERROR: non-fast-forward update for $DEFAULT_BRANCH. Resolve manually."

Step 2: Detect Cleanup Candidates

Combine two detection methods and deduplicate:

# Method 1: Branches fully merged into the default branch
MERGED=$(git branch --merged "$DEFAULT_BRANCH" | grep -v '^\*' | sed 's/^[[:space:]]*//')

# Method 2: Branches whose remote tracking ref is gone (plumbing command for reliable parsing)
GONE=$(git for-each-ref --format '%(refname:short) %(upstream:track)' refs/heads | grep '\[gone\]' | cut -d' ' -f1)

# Combine and deduplicate: track which method(s) detected each branch
# Branches in both lists get reason "merged + gone"

Read the full file on GitHub · 227 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. 7d ago First seen · 227 lines · 22 tokens per session scan A a9215f0eb031

Subscribe to this mod's changes

git-ops is a skill published in the GitHub repository rube-de/cc-skills (10 stars, last pushed today), licensed MIT. It adds 22 tokens to every session and 1,997 once invoked, about $0.0001 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

parallel-pr-scope-overlap-tiebreaker-delta-check

Before applying a handoff prompt's tiebreaker default ("merge the first-mover", "the clean-against-main one", "the one with reviewer APPROVE") to pick a winner between two parallel PRs that implemented the SAME scope, run gh pr diff on BOTH and audit for substantive deltas. Use when: (1) a session prompt or handoff…

wan-huiyan/agent-traffic-control · 384 tokens

pr-from-stale-branch-silently-reverts-newer-main-files

Trap: merging a PR whose branch carries an OLD TREE silently DELETES (reverts) files that landed on main after that tree was built — with NO merge conflict to warn you, because a deletion your own commit records is not a conflict. Use when: (1) about to gh pr create or squash-merge from a long-lived / earlier-branched…

wan-huiyan/agent-traffic-control · 387 tokens

stacked-pr-review-per-base-diff-and-attach

Reviewing a stack of dependent pull requests: diff each one against ITS OWN base rather than against main, and attach the reports to the bottom branch.

wan-huiyan/agent-traffic-control · 43 tokens

subagent-reports-complete-but-pr-unmerged

Catch the systematic gap between sub-agent "completed" status and the actual end state of a PR-merge orchestration task. Use when: (1) you've dispatched multiple parallel sub-agents (general-purpose or specialist) to open + review + merge PRs, (2) the parent receives with status: completed but the sub-agent's last…

wan-huiyan/agent-traffic-control · 372 tokens

working-tree-edits-stranded-on-squash-merge

Diagnose and prevent "I made the fix but it's not on main" cases where the fix was applied in the working tree via Edit / Write but never git added before the squash-merge. Use when: (1) you squash-merged a PR and the user reports the issue is back, (2) git status after the merge shows uncommitted changes for files…

wan-huiyan/agent-traffic-control · 236 tokens

swarm-pi-review

Review a Git working tree or branch with read-only Pi workers. Use standard for bugs, security, regressions, and missing tests; use lean for diff-bound simplification, deletion, reuse, YAGNI, or native replacements. Route one question to ask and broader risk analysis to orchestrate.

JiaWeiXie/swarm-pi-code-plugin · 66 tokens