@henryqw/pi-herdr-clone
Clone the current Pi conversation path into a new Herdr tab.
Package details
Install @henryqw/pi-herdr-clone from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@henryqw/pi-herdr-clone- Package
@henryqw/pi-herdr-clone- Version
0.3.3- Published
- Aug 30, 2026
- Downloads
- 2,580/mo · 2,058/wk
- Author
- henrywang
- License
- MIT
- Types
- extension
- Size
- 21.7 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-clone
Clone the current Pi conversation path into a new Herdr tab or Git worktree workspace.
Why
- Created for: Start a new Pi process that continues the current conversation in a workspace tab or fresh Git worktree.
- Advantage: Clones copy only the active root-to-leaf session path. They leave sibling branches and the original session untouched.
Install
pi install npm:@henryqw/pi-herdr-clone
Requires a Pi session running inside Herdr.
Use
| Surface | Type | Purpose |
|---|---|---|
/clone-tab |
command | Clone the current conversation into a new tab of the current Herdr workspace. |
/clone-worktree |
command | Clone the current conversation into a new Herdr Git worktree workspace. |
The active conversation path is the saved messages from the session root to its current leaf. Both commands validate the current Herdr pane (HERDR_ENV=1, HERDR_PANE_ID), the session file, and the current session leaf immediately.
They copy only the active root-to-leaf path available when invoked into a new persisted session file. Sibling branches and still-streaming assistant output are excluded.
The original Pi session is not switched. Neither command has configuration.
/clone-tab behavior
- Create an unfocused Herdr tab in the current workspace with the current working directory.
- Start Pi in the tab's root pane with
--session <absolute-clone-file>. - Focus the new tab after Pi starts successfully.
/clone-worktree behavior
- Create a Git worktree-backed workspace with
herdr worktree create --workspace <current-workspace> --no-focus. Herdr creates the branch fromHEADunless the name exists, checks out the worktree under its configuredworktrees.directory, and opens it as a grouped workspace. - Wait briefly for a worktree-layout plugin, such as
herdr-plus, to start its agent in the new workspace's root pane. - If the root pane is occupied, create an additional unfocused tab in the new workspace with the checkout as its working directory. The plugin's agent and the clone then coexist. Otherwise, use the root pane.
- Copy the active path into a clone session stamped with the fresh checkout path as its working directory.
- Start Pi in the chosen pane with
--session <absolute-clone-file>. - Focus the clone's tab after Pi starts successfully.
Failure semantics
- Target creation failed: No clone session is kept or created.
- Killed or incomplete creation response: The result is ambiguous because Herdr may have retained partial state. The error reports every identifier returned so far and suggests inspecting
herdr workspace list. - Agent start attempted: Retain the target tab, panes, and session file because the launch outcome can be unknown. The error reports any known IDs for recovery.
- Later focus failure: Show a warning. Do not report the already-started clone as failed.