How this skill is triggered — by the user, by Claude, or both
Slash command
/vault-sync:cleanupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are helping the developer prune exploratory notes that belong to branches that have been deleted or abandoned. Follow these steps carefully.
You are helping the developer prune exploratory notes that belong to branches that have been deleted or abandoned. Follow these steps carefully.
Call vault-query with:
status: "exploratory"If the query returns zero notes, print:
No exploratory notes found. The vault is clean.
Stop here.
Run:
git remote get-url origin
Derive the project name from the remote URL (the repository name portion). If this fails, ask the user: "Which project are you cleaning up? Enter the project name as it appears in vault notes."
Filter the notes from Step 1 to only those where project matches the current project name.
If no notes match the current project, print:
No exploratory notes found for project <project>. Nothing to clean up.
Stop here.
Collect the unique set of branch names from the filtered notes. For each branch, run both checks:
git branch --list <branch>
git ls-remote --heads origin <branch>
Also check the age of the branch's most recent note (using the created frontmatter date).
Classify each branch into one of three groups:
Print a summary grouped by status:
Orphaned branches (branch deleted — notes are likely obsolete):
• <branch-name>: N notes [created: <date>]
...
Stale branches (branch exists but notes are 30+ days old):
• <branch-name>: N notes [last activity: <date>]
...
Active branches (skip — notes are recent):
• <branch-name>: N notes [last activity: <date>]
...
If there are orphaned branches, ask:
"Found N notes from deleted branches. Discard all of them? (y/n/review)"
For each stale branch, display its notes and ask:
Branch: <branch-name> (last activity: <date>)
Notes:
1. <title>
2. <title>
...
Options:
[D] Discard all notes for this branch
[P] Promote all (redirects to /promote-to-vault for this branch)
[S] Skip this branch
For each note marked for discard, call vault-discard with:
note_id: the note's identifierreason: "branch abandoned" (for orphaned) or "branch deleted" (for branches that no longer exist remotely)Cleanup complete:
Discarded: N notes across N branches
Skipped: N notes across N branches
Run /promote-to-vault to promote any remaining stale notes you want to keep.
npx claudepluginhub mahuebel/lore --plugin vault-syncDeletes merged Git branches locally and optionally remotely after user confirmation, flags stale unmerged branches for manual review. Supports dry-run, custom base branch, and inactivity threshold.
Safely analyzes and cleans up local git branches/worktrees: categorizes merged/squash-merged/superseded/active, groups related ones, deletes only after user approval.
Safely identifies and deletes merged and stale Git branches after fetching latest state, filtering by pattern, and user confirmation via interactive prompts. Protects main branches.