@henryqw/pi-herdr-done
Close and remove the current Herdr worktree from Pi.
Package details
Install @henryqw/pi-herdr-done from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@henryqw/pi-herdr-done- Package
@henryqw/pi-herdr-done- Version
1.0.3- Published
- Sep 7, 2026
- Downloads
- 3,181/mo · 538/wk
- Author
- henrywang
- License
- MIT
- Types
- extension
- Size
- 20 KB
- Dependencies
- 1 dependency · 1 peer
Pi manifest JSON
{
"extensions": [
"./extensions"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@henryqw/pi-herdr-done
Finish a Herdr-managed linked worktree task by removing its checkout, closing its tabs, and updating the parent. One command performs cleanup and refuses unsafe removal unless you explicitly force it.
Install
pi install npm:@henryqw/pi-herdr-done
Requires the Herdr CLI and a Pi session running inside a Herdr-managed linked worktree.
Works with
| Package | Relationship | Purpose |
|---|---|---|
@henryqw/pi-herdr-clone |
Improves | Creates the worktree workspace that /done later removes. |
Use
Commit or discard current changes, then run /done and confirm. The command waits for Pi to become idle before cleanup.
| Surface | Type | Purpose |
|---|---|---|
/done |
command | Remove the current worktree checkout, close its Herdr workspace's tabs, and fast-forward the parent workspace. |
/done --force |
command | Same, even when the worktree is dirty or used by tabs in another workspace. |
Flow
Both forms wait for Pi to become idle before cleanup. /done asks for confirmation. /done --force skips confirmation because the flag already states intent.
Normal removal runs:
git worktree remove .
herdr tab close <other-tabs-in-$HERDR_WORKSPACE_ID>
git -C <parent> pull --ff-only
herdr tab close "$HERDR_TAB_ID"
- The parent pull runs only when this session ran in a linked worktree with a non-bare primary.
- It fails safely when the parent has diverged.
- Parent tabs do not block worktree removal or the parent pull.
- Once removal succeeds, every tab in the current Herdr workspace closes, even when the parent pull fails.
- Concurrent completions serialize on a lock around the parent checkout.
Limits and recovery
- Tabs in the current Herdr workspace close automatically.
- If a tab from another workspace still uses the current checkout,
/donerefuses and lists it by name. Use/done --forceto remove the checkout regardless. - The command requires Pi inside Herdr with
HERDR_ENV=1,HERDR_WORKSPACE_ID, andHERDR_TAB_IDset. - Dirty worktrees make
/donefail. Commit or discard changes, or use/done --forceto explicitly delete them.