Git Branching Analyzer skill for Claude and Codex
Reports on a repository's branch health in a form you can act on: stale and unmerged branches, how far each is ahead or behind main, naming violations, and…
Install it once and Claude or Codex runs it for you. When your request matches, your AI loads the skill, asks for anything it is missing, and works through the template itself. Prefer to fill it in by hand? See the full prompt template.
Download the skill (.zip) · View SKILL.md
When it is used
Use when a repository has accumulated branches and someone wants to know which are stale, unmerged, diverged, or misnamed, and what to delete or rebase. Do not use for designing a branching strategy, resolving merge conflicts, or rewriting commit history. Related topics: coding, git.
What it will ask you for
- Repository path (free text, e.g. "/path/to/repo")
- Main branch name (free text, e.g. "main")
- Branch listing (longer free text)
- Include merged branches (choose one: Yes, No)
- Analysis depth (commits) (number from 100 to 1000)
- Stale after (days) (number from 7 to 365)
- Branch naming convention (choose one: feature/*, bugfix/*, hotfix/*, release/*, type/ticket-description, custom)
- Output format (choose one: Markdown, JSON, Plain text)
How it works
- Use the supplied branch listing, or give the git commands that produce it and base the report on the pasted result.
- Classify every branch as merged, stale, diverged, active, or protected using the stale window and analysis depth.
- Check each name against the convention and list violators with a compliant name.
- Assign an action per branch (delete, confirm with owner, rebase or merge, rename) with the constraint that applies.
- Produce the report in the selected format with counts, the stale list, the ahead and behind table, violations, and cleanup commands ordered with destructive ones last.
What you get
A report in the chosen format containing total branch count, counts per class, the stale branch list with date and author, an ahead and behind table against main, naming violations, and ordered cleanup commands with destructive steps marked.
What it watches out for
- Deleting an unmerged stale branch because it is old; the owner may hold the only copy of that work.
- Measuring staleness by branch creation date instead of last commit date, which flags long-lived active branches.
- Renaming a branch that an open pull request points at, which closes the PR on most hosting platforms.
How to install
Claude.ai and the Claude desktop app
- Download the skill .zip.
- Open Settings, then Capabilities, and find Skills.
- Choose Upload skill and select the .zip.
- Ask Claude for help with the task. It loads the skill when your request matches.
Claude Code
- Download the skill .zip.
- Unzip it into ~/.claude/skills/ (or .claude/skills/ inside a project).
- Start a new session. Claude Code loads the skill when your request matches.
Codex
- Download the skill .zip.
- Unzip it into ~/.agents/skills/ (or .agents/skills/ inside a project).
- Codex picks it up on its own. Type $ and the skill name to use it, or just ask for the task.
Cursor
- Download the Cursor rule (.mdc).
- Save it in .cursor/rules/ inside your project.
- Cursor's agent applies the rule when your request matches its description.
AGENTS.md (Codex, Cursor, and other coding agents)
- Copy the AGENTS.md section.
- Paste it into AGENTS.md at the root of your repository, creating the file if needed.
- Coding agents that read AGENTS.md follow it when your request fits.