/
/
Clean up stale branches without the guesswork
For developers and release engineers who want to know which Azure DevOps branches are safe to retire, just by asking their AI assistant.
On this page
Connector
Connect Azure DevOps, pick your AI tool and paste the prompt.
The problem
Repositories fill with branches nobody owns
Repositories collect branches that nobody owns any more. Working out which are stale, locked or far behind the default branch means opening each one, and nobody wants to clean up a branch that might still matter.
Without PopdockAI
- Open each branch to check its last commit
- Work out how far it has diverged from the default
- Check for locks and active pull requests
- Leave everything in place to be safe
With PopdockAI
- Every branch is read with age, lock state and divergence
- The default branch and branches with active pull requests are set aside
- Stale, locked and diverged branches are grouped
- Each gets a suggested action, and nothing is deleted or locked
The prompt
Use this prompt
Copy it into any AI tool connected to PopdockAI. Swap the values in braces for your own.
**Objective:** Audit branches and tags in `{repository-name}` and list cleanup candidates: branches with no commits for `{stale-days}` days (default 90), locked refs and far-diverged branches.
**Step 1: Resolve the repository**
Call `azure-devops-get-repository` with name `{repository-name}`; note id and default-branch.
**Step 2: Read branches**
Call `azure-devops-get-branch-stat` with repository-id and commit-date.to set to the stale cutoff. Also call `azure-devops-get-git-ref` with repository-id and `azure-devops-get-tag` for context, noting is-locked refs and the creator.
**Step 3: Rank candidates**
Rank by days since last commit, then by ahead-count. A branch with ahead-count 0 is likely already merged.
**Step 4: Report**
A table of branch, last commit date, author, ahead and behind counts and a suggested action (delete, ask owner, keep), plus counts for locked refs and tags.
**Rules & Guidelines:**
* This prompt is read-only. Call only the `azure-devops-get-*` read tools named above; never create, update, comment on, approve, queue, abort or delete anything in Azure DevOps.
* The tools only return data the connected account can see; never infer data from projects outside that access.
* Never delete or lock branches; list candidates only.
* Never suggest deleting the default branch or any branch behind a pull request that is still active.
**Validation:**
* If no branches are stale, say so.
Who it's for
One answer, three teams that use it
Developers
Tidy a repository without fear
See which branches are stale or far behind, with a suggested action, and none that are still in use.
Which branches in the Fabrikam.Api repository in Azure DevOps are stale?
Tech leads
Keep the branch list readable
Run a quick hygiene check before a release so the team works from a clean list.
Audit branch hygiene in the Northwind.Portal repository and group stale, locked and diverged branches.
DevOps engineers
Find locked and diverged branches
Locked branches and those far behind the default are called out, ready for a decision.
List locked branches and branches more than 100 commits behind main in Contoso.Services.
How it works
What PopdockAI does when you ask
You name a repository and your AI assistant builds a safe cleanup list. It only reports, so nothing is deleted or locked.
01
Ask
You name the Azure DevOps repository.
02
Read
It reads every branch with its age, lock state and divergence from the default.
03
Check
It sets aside the default branch and any branch with an active pull request.
04
Report
You get stale, locked and diverged branches with a suggested action each.
What PopdockAI provides
The tools behind the answer
Ready made tools for Azure DevOps and one secure connection to your AI tool. No code, no exports.
azure-devops-get-repository
azure-devops-get-branch-stat
azure-devops-get-git-ref
azure-devops-get-tag
This report is built from Get data tools only. PopdockAI applies the row, field and parameter rules your admin sets, and every query is written to the audit trail.
The outcome
A safe branch cleanup list
Related use cases
More ways to put this data to work
One prompt template with infinite possibilities.
Your AI assistant adapts its approach, tone, and capabilities to match each unique context while you maintain a single, manageable workflow.
Join forward-thinking companies that are transforming their operations with intelligent, secure AI automation.

.webp)
