{"id":"archive-branch-cleanup","repo":"MaplumeX/paseo-archive-branch-cleanup","url":"https://github.com/MaplumeX/paseo-archive-branch-cleanup","name":"archive-branch-cleanup","description":"A [Paseo](https://paseo.sh) plugin that automatically deletes the local git branch when a Paseo-owned worktree workspace is archived.","categories":["git","automation"],"platforms":[],"caveats":[],"images":[],"themes":[],"health":{"manifestValid":true,"hasReadme":true,"hasLicense":false,"hasTests":false,"hasTypecheckScript":true,"updatedRecently":true},"scannedAt":"2026-10-15T12:29:15.487Z","addedAt":"2026-09-10T18:09:18+03:00","version":"0.1.0","security":{"status":"passed","blockingFindings":0,"advisoryFindings":0,"scannedAt":"2026-10-15T12:14:24.405Z","commit":"59bc5335e7cd3d5e61fc375565bb1fca9faee6da"},"paseoVersionRequirement":">=0.8.0","descriptionNodes":[{"type":"text","text":"A "},{"type":"link","href":"https://paseo.sh","children":[{"type":"text","text":"Paseo"}]},{"type":"text","text":" plugin that automatically deletes the local git branch when a Paseo-owned worktree workspace is archived."}],"caveatNodes":[],"manifest":{"id":"archive-branch-cleanup","requirements":{"paseo":">=0.8.0"}},"repoMeta":{"stars":0,"defaultBranch":"master","pushedAt":"2026-09-13T10:51:22Z"},"owner":{"login":"MaplumeX","avatarUrl":"https://avatars.githubusercontent.com/u/44311044?v=4"},"installNotesHtml":"<pre><code class=\"language-sh\">paseo plugin install /absolute/path/to/paseo-archive-branch-cleanup\n</code></pre>\n<p>Requires the daemon-wide <strong>Enable plugins</strong> switch under Settings → Plugins.</p>","readmeText":"# paseo-archive-branch-cleanup\n\nA [Paseo](https://paseo.sh) plugin that automatically deletes the local git branch when a Paseo-owned worktree workspace is archived.\n\n## Why\n\nWhen you archive a PR worktree workspace in Paseo, the daemon removes the worktree directory but leaves the local branch behind. Over time these stale branches accumulate. This plugin cleans them up automatically.\n\n## How it works\n\nThe plugin runs a background watcher inside the Paseo daemon plugin subprocess:\n\n1. Connects to the local Paseo daemon via `@getpaseo/client`\n2. Subscribes to workspace update events\n3. Caches branch and repo info for Paseo-owned worktree workspaces from upsert events\n4. On a workspace `remove` event, deletes the cached branch from the main repo with `git branch -D`\n\nBranch deletion retries for up to 30 seconds, because the daemon may still be removing the worktree (the branch stays checked out until the worktree is gone).\n\n## Safety\n\n- Only touches workspaces where `gitRuntime.isPaseoOwnedWorktree === true` (branches Paseo created)\n- Refuses to delete main-line branches (`main`, `master`, `trunk`, `develop`, `dev`, `production`, `prod`, `release/*`) even on a Paseo-owned worktree, since a worktree can check out an existing branch\n- Only deletes the **local** branch (`git branch -D`), never the remote\n- Branch name is resolved from `githubRuntime.pullRequest.headRefName`, falling back to `gitRuntime.currentBranch`\n- Deletion runs in the main repo root (`project.checkout.mainRepoRoot`), not the worktree\n\n## Install\n\n```sh\npaseo plugin install /absolute/path/to/paseo-archive-branch-cleanup\n```\n\nRequires the daemon-wide **Enable plugins** switch under Settings → Plugins.\n\n## Requirements\n\n- Paseo daemon reachable on the local machine. The plugin auto-detects the listen target from `PASEO_HOME/config.json` (`daemon.listen`), falling back to `127.0.0.1:6767`.\n- Git CLI on PATH\n\n## Development\n\n```sh\nnpm run typecheck        # type-check\npaseo plugin reload paseo-archive-branch-cleanup   # reload after edits\npaseo plugin logs paseo-archive-branch-cleanup      # view backend output\n```\n\n## License\n\nMIT"}