- Home
- Skills
- Testing & Debugging
- git stale branch reporter
git stale branch reporter
Identify and audit inactive Git branches with commit metadata and merge status suggestions.
Free
Works with the AI Agents you already use
git stale branch reporter
Example session with this skill installed
Find all local branches that haven't been touched in over 60 days. Check if they are merged into 'main' and give me a summary of what can be deleted.
- Read your context and instructions
- Compiled the git stale branch
I have analyzed the local branches in your repository that have not had a commit in the last 60 days. I checked these against the 'main' branch to determine their merge status.
Stale Branch Report (60+ Days)
| Branch Name | Last Commit | Author | Merged | Suggestion |
|---|---|---|---|---|
feature/old-ui-fix | 2023-11-12 | Alice Chen | Yes | Safe to delete |
fix/issue-402 | 2023-12-05 | Bob Smith | Yes | Safe to delete |
experiment/alpha-test | 2023-08-20 | Alice Chen | No | Consider deleting (Over 1 year old) |
tmp-debug-logs | 2024-01-15 | Charlie Day | No | Review: check if still needed |
patch-v1.2 | 2023-05-10 | Bob Smith | No | Consider deleting (Over 1 year old) |
Summary:
- 2 branches are already merged into
mainand are safe to delete immediately. - 3 branches are stale and not merged, including 2 that are over a year old and likely abandoned.
Next steps
- Run
git branch -d feature/old-ui-fix fix/issue-402to safely remove the merged branches. - Review
experiment/alpha-testandpatch-v1.2to ensure no critical unmerged code is being lost. - If you want to check remote branches as well, run the command again with the
--remoteflag.
Connects securely to your tools. The creator never sees your data.
About this skill
Repositories accumulate stale branches that clutter the local environment and hide abandoned work. This skill identifies inactive local and remote branches based on custom time thresholds, providing commit metadata and merge status without modifying your repository.
What it does
- Staleness detection filters branches by days since the last commit.
- Merge status checking compares stale branches against a base branch to see if they are safe to prune.
- Commit metadata retrieval extracts the last author, date, subject, and SHA for every inactive branch.
- Smart suggestions categorizes branches as safe to delete, orphaned, or requiring manual review.
- Protected branches excludes core branches like main, master, and develop from results automatically.
How it works
- Run the reporter with a specific day threshold, for example
--days 60. - Include the
--remoteflag to scan tracking branches from your origin. - Specify a
--basebranch to check which inactive branches are already merged. - Review the generated list, grouped by merge status and suggested actions.
Frameworks & tools
This skill uses Python 3.8+ and standard Git CLI. It requires no third-party libraries and works with any valid Git repository.
Why this beats prompting it yourself
Writing complex Git log and merge-base commands is error-prone and tedious. This skill encapsulates the logic for date calculations and merge verification in a read-only script, ensuring you never accidentally delete work while auditing your repo.
Use cases
- Identify local branches that were merged weeks ago but never deleted.
- Audit remote branches for work abandoned by former contributors.
- Prepare a cleanup report before a major release or repository migration.
- Locate orphaned branches that no longer have an upstream counterpart.
Known limitations
Remote branch accuracy depends on your last git fetch. Merge status is checked against only one base branch per execution. Requires Python 3.8+ and Git on the PATH.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.
Accuracy of remote branches depends on the last git fetch. Requires Python 3.8+ and Git on the system PATH. Only one base branch can be checked per run.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 3 days ago
- Free with an Agensi account
- Software
Python
Git