List branches with optional filtering
Lists repository branches with filtering options for stale, merged, or pattern-matched branches.
/plugin marketplace add fractary/claude-plugins/plugin install fractary-repo@fractary[--stale] [--merged] [--days <n>] [--pattern <pattern>]claude-haiku-4-5<CRITICAL_RULES> YOU MUST:
YOU MUST NOT:
THIS COMMAND IS ONLY A ROUTER. </CRITICAL_RULES>
<WORKFLOW> 1. **Parse user input** - Parse optional arguments: --stale, --merged, --days, --pattern - All arguments are optionalBuild structured request
Invoke agent
Return response
<ARGUMENT_SYNTAX>
This command follows the space-separated argument syntax (consistent with work/repo plugin family):
--flag value (NOT --flag=value)--stale ✅ (NOT --stale true)Patterns with spaces need quotes:
✅ /repo:branch-list --pattern "feature/*"
✅ /repo:branch-list --pattern "bugfix/123-*"
❌ /repo:branch-list --pattern feature/* (wrong if shell expands *)
Boolean flags and numeric values:
✅ /repo:branch-list --stale --days 60
✅ /repo:branch-list --merged
✅ /repo:branch-list --days 90
</ARGUMENT_SYNTAX>
<ARGUMENT_PARSING>
Optional Arguments:
--stale (boolean flag): Show only stale branches (branches with no commits in N days). No value needed, just include the flag--merged (boolean flag): Show only merged branches (branches fully merged into main). No value needed, just include the flag--days (number): Number of days to consider a branch stale (default: 30). Example: --days 60 for 60 days--pattern (string): Glob pattern to filter branch names (e.g., "feature/", "bugfix/123-")Maps to: list-branches
Example:
/repo:branch-list --stale --days 60
→ Invoke agent with {"operation": "list-branches", "parameters": {"stale": true, "days": 60}}
</ARGUMENT_PARSING>
<EXAMPLES> ## Usage Examples# List all branches
/repo:branch-list
# List stale branches
/repo:branch-list --stale --days 90
# List merged branches
/repo:branch-list --merged
# List branches matching pattern
/repo:branch-list --pattern "feature/*"
# Combine filters
/repo:branch-list --stale --days 30 --pattern "bugfix/*"
</EXAMPLES>
<AGENT_INVOCATION>
CRITICAL: After parsing arguments, you MUST actually invoke the Task tool. Do NOT just describe what should be done.
How to invoke: Use the Task tool with these parameters:
Example Task tool invocation (customize based on the specific operation):
Request structure:
{
"operation": "list-branches",
"parameters": {
"stale": true,
"merged": false,
"days": 60,
"pattern": "feature/*"
}
}
The repo-manager agent will:
DO NOT:
<ERROR_HANDLING> Common errors to handle:
Invalid days value:
Error: days must be a positive number
Usage: /repo:branch-list --days <n>
Invalid pattern:
Error: Invalid glob pattern: [invalid
Use standard glob patterns like "feature/*" or "bugfix/123-*"
</ERROR_HANDLING>
<NOTES> ## Branch Filtering--stale --days 90--merged--pattern "feature/123-*"--stale --mergedThis command works with:
Platform is configured via /repo:init and stored in .fractary/plugins/repo/config.json.
Related commands:
/repo:branch-create - Create branches/repo:branch-delete - Delete branches/repo:cleanup - Clean up multiple stale branches automatically/repo:init - Configure repo plugin
</NOTES>