pi-odd-worktree
Pi package for odd-worktree: the Git worktree tools a Pi session uses (create and list the checkouts the agent works in), the /warp worktree panel, the /odd ODD viewer, and the /issues GitHub issue reader. Needs only Pi and git: no companion app, no extra
Package details
Install pi-odd-worktree from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-odd-worktree- Package
pi-odd-worktree- Version
3.10.0- Published
- Nov 23, 2026
- Downloads
- 4,950/mo · 3,374/wk
- Author
- jonasotoaguilar
- License
- MIT
- Types
- extension
- Size
- 5.7 MB
- Dependencies
- 0 dependencies · 3 peers
Pi manifest JSON
{
"extensions": [
"./extensions/odd-worktree-tools.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-odd-worktree
A Pi package that gives an agent session Git worktrees, ODD documents, GitHub issues and pull requests, and draws their cards inside Gentle Shell.
What It Does
Two agent tools, five panels, one background-explorer command, one sidebar section and two tool designs, loaded from one extension entry point. Each ODD feature gets its own checkout beside the clone, and you move between checkouts and read your ODD documents, files, issues and pull requests without leaving Pi.
| Surface | Kind | What it does |
|---|---|---|
worktree_create |
tool | Creates <repo-parent>/<repo-name>-worktrees/<odd> on a branch, prepares it and starts its install in the background. |
worktree_list |
tool | Read-only list of the checkouts this package created, each by its ODD and branch. |
/warp |
panel | Moves this session to another checkout, creates one, and removes one. |
/odd |
panel | Reads this checkout's odd/tasks/*.md: list on the left, styled markdown on the right. |
/files |
panel | Browses one checkout's files with a live, language-coloured preview: enter pastes the chosen paths into your prompt, ctrl+e opens the file in $EDITOR. |
/issues |
panel | Reads this checkout's GitHub issues — the three scoped tabs on open, every open issue behind g — and, when your role allows it, edits them. enter inserts the focused issue into the chat input as ISSUE #63, and each linked pull request in the pane is its own click that opens that pull request in /prs. |
/prs |
panel | The same reader for pull requests: My Pull Request, Needs My Review and Involved on open, every open pull request of the repository behind g, the pane's Changes and Checks summaries, and — when your role allows it — comment, labels, assignees, the linked issues, merge (after a confirmation naming the method and the commit message) and close. enter inserts the focused pull request as PR #87, and each linked issue in the pane is its own click that opens that issue in /issues. |
GITHUB rail section |
sidebar section | Lists the open issues of this checkout's repository you authored or are assigned, seven at a time plus a count of the rest, and its header counts the pull requests beside them (7 issues · 3 pr: your own plus the ones awaiting your review). A click opens that issue in /issues on Assigned — or, when the issue carries a linked pull request, that pull request in /prs on the bucket it belongs to; the overflow row opens /issues. Needs gh. |
activity card design |
design on the bridge's Card activity line |
Optional, and selected for you on the first run: a bash card's heading names the activity its command does, each family in its own theme colour, and — while that line answers for the tool being painted — the skill/ODD file cards, the background-job cards and the two advisory messages follow it. |
color diff design |
design on the bridge's Card diff line |
Optional, and selected for you on the first run: redraws write and edit as an IDE pane — a write's content behind a line-number gutter, an edit's diff — in the active theme's own syntax roles. |
Moving the session and removing a checkout are human actions: only /warp does either, and no agent tool can. A checkout has one identity, its ODD: the directory name is the ODD it serves, and branch is only the git branch.
Quick Start
Requirements
| Requirement | Why it is needed |
|---|---|
gentle-shell-bridge, installed first |
Every surface this package registers. Without it the package loads nothing at all — no command, no tool, no card, no rail — and only names that install line, in a primary session. |
Pi (@earendil-works/pi-coding-agent, @earendil-works/pi-tui) |
Peer dependencies supplied by the host; the package installs no runtime dependencies. |
Node.js >= 18 and git |
Every repository operation is a git child process. |
| Gentle Shell (recommended) | Supplies the session records the deletion guard reads to see other sessions, and the rail the GITHUB section is drawn in. |
gh, authenticated (gh auth login) |
/issues, /prs and the GITHUB rail section, and them alone. Without gh on PATH none of the three is registered at all — /issues and /prs never load and the section is never added to the rail, so there is nothing to refuse and no line to draw — and every other surface keeps working. |
Install
gentle-shell-bridge goes first: it is the API every surface of this package is registered through.
# 1. the bridge, a prerequisite for every surface here
pi install npm:gentle-shell-bridge
# 2. this package
pi install npm:pi-odd-worktree
Inside a Gentle Shell session use its launcher, in the same order:
gentle-shell install npm:gentle-shell-bridge
gentle-shell install npm:pi-odd-worktree
From a local clone, pi install . installs the working copy, and gentle-shell install . does the same from inside a Gentle Shell session.
Expected result
/warp, /odd, /files, /issues and /prs are available as commands — /issues and /prs only where gh is on PATH — the agent is offered worktree_create and worktree_list, a Gentle Shell whose rail is drawn shows a GITHUB section for this checkout, and its /gentle:customize → Cards page offers activity on its Card activity line.
Bridge versions
Older bridges register less, never something different:
| Bridge | What it can hold |
|---|---|
0.5.0 |
One Card bash row, bash alone; activity still heads a bash card with the family its command names. |
0.6.0 |
One Card activity row over bash, grep, find, ls and read; the file card's question arrives in 0.7.0. |
0.9.0 |
The scoped claim that puts write and edit on the activity line, and the Card diff line itself. |
0.12.1 |
The two advisory message cards, which follow the Card activity line with no row of their own. |
Below a row's floor the surface registers nothing and Pi's own card stays byte-identical. The Card activity line and, with it, every card that follows it are documented in the reference.
Core Workflow
- Create a checkout with
worktree_create(anoddand abranch) or presscin/warp. It answers at once; the install continues in the background. - List with
worktree_listor by opening/warp. - Move with
/warp <name>, or pick a checkout in the selector. - Delete with
ctrl+don a checkout in/warp, after its confirmation.
The full rules of each step, including every refusal, are in Create, list, move and delete, in detail.
Key Capabilities
- Two halves are optional. With
gentle-shell-bridge,/gentle:customizehas aToolspage with an Off/On line forCodegraph+(the CodeGraph prompt text, reminders and wiring; its card follows theCard activityline like every other card) and one forWorktrees+(the worktree tools,/warp, the worktree guards and prompt text). Both are On by default; a change needs/reloadand a new session. See the module switches. - A create is instant and writes no state. The directory is the whole record; there is no list file and no lock file.
- Deleting refuses on a live session. The guard reads Gentle Shell's presence records, discloses what it could not resolve, and never auto-warps. Removal is
git worktree removeand the branch is kept. See the deletion guard. - A warp is queued, never dropped. While this session's tools, agent tasks or background jobs are still running,
/warpkeeps the request pending and moves when they finish. See the queued warp. /fileslists one checkout's files and pastes them. It always asks for a checkout first —mainincluded, even with nothing else registered — withawidening the list to every worktree Git lists for the clone;ctrl+ocyclesfiles,treeandext. The preview is read-only, bounded and coloured from your active theme,enterinserts@-prefixed paths (a file of another checkout travels as its absolute path), andctrl+eopens the highlighted file in$VISUAL/$EDITOR.alt+popens the picker from anywhere, andGENTLE_PI_FILES_KEYoverrides the key. See the file picker./issuesopens on three tabs, not four. The bar isMy issues,AssignedandInvolved;Allis thegshortcut's own view, with the footer sayingg all issuesoutside it andg related issuesinside. A typed filter spans the three tabs and travels with you intoAll.alt+iopens the panel from anywhere, andGENTLE_PI_ISSUES_KEYoverrides the key. See the tabs, the shortcut and the filter./prsis the same reader for pull requests. Its three tabs areMy Pull Request,Needs My ReviewandInvolved,Allis again thegshortcut's own view (there the footer readsg related prs), the search box reads the server like/issues, andenterinserts the focused pull request into the chat input asPR #87and closes the panel — nothing is sent to the agent. The pane opens with the state, labels, assignees, reviewers with their review state, author and ages, the linked issues and the two summariesChanges(3 files changed +40 -5,7 commits) andChecks(5 checks · 1 failed,failing: build). See the/prspanel./prswrites only what your role allows. Commenting needs read access alone; labels and assignees need triage; closing, merging and editing the linked issues need write, andmis offered only for a pull request that is not a draft and a repository that allows at least one merge method. Anything but a confirmed capability paints no hint and refuses the key on screen. Merge is its own step — type (only the methods the repository allows), commit message, description,Confirm merge #N/Cancel— prefilled with GitHub's own proposals, and a rebase merge takes neither the message nor the description. See the actions, gated by capability./issuesand/prslink to each other. In the issues pane every linked pull request number is its own click that opens/prson it; in the pull request pane every linked issue number is its own click that opens/issueson it. The panel you clicked in closes first, so two panels never stack, and a line's label, its separators and a#Nin a title or a body are not click targets. A linked reference is identified by repository AND number, so one that belongs to another repository is painted asowner/repo#Nand is not a click at all: a same-numbered lookalike here is never opened by mistake. See the cross-links./issuescan open on one issue./issues 42(or/issues #42) opens the panel onAssignedwith that issue selected, and a number that tab cannot find says so instead of guessing a row.prs's sibling form is/prs 42(or/prs #42), which opens onMy Pull Requestwith that pull request selected — onNeeds My Reviewwhen a rail click named that bucket, saying#42 is not in My Pull Requestwhen neither holds it./issuesand/prspin the repository. Every read, mutation and browser open is bound to the repository that was loaded, and capabilities fail closed. See the repository pin.- The GitHub rail is checkout-scoped and optional. When a Gentle Shell draws its rail, a
GITHUBrail section lists the open issues of this checkout's repository you authored or are assigned — that one repository, not every issue across every repository you touch — seven at a time, withand N more issuesfor the rest and a pull-request mark on the issues that already have one, and its header counts the pull requests beside them (7 issues · 3 pr, the distinct rows of your own and the ones awaiting your review; the segment appears once that read lands, and a stalled list still reads· stale). A click on an issue that carries a linked pull request opens/prson that pull request —Needs My Reviewwinning when it belongs to both buckets,My Pull Requestnext, and theallview when the rail's read places it in neither — instead of the issue; every other row opens that issue in/issuesonAssigned, in no case a browser. The click does not prove the repository itself — the panel it opens pins and proves the checkout, so a row left over from another checkout still dispatches its number and the panel decides — and/issues' ownokey is still the browser. The overflow row opens/issueswith no number. While the rail's cache holds this repository,/issuespaints its first frame from it and reads one tab at mount instead of three, the other two reading the first time you open them; the cache outlives both the session and the process — one document under$XDG_CACHE_HOME/odd-worktree/— so a warm checkout's first read is already a delta, and the rail's pull requests are persisted the same way (prs-rail.json) so a cold start paintsN issues · M prat once. A frame never waits ongh, and neither does a session start: theghgate is dispatched, never awaited, so no child process and no network call sits on opening or switching a session. While the section is drawn it re-reads on its own 20 s timer — the issues and the pull requests behind the same floor — keeps no timer while hidden, stops the moment it is no longer drawn, and abashcommand that mutates an issue or a pull request forces one read behind a 5 s cap; a failed refresh keeps the rows and marks themstale, and a failed pull-request read keeps the count already painted. WithoutghonPATHneither the section nor/issues//prsexists at all — the commands are never registered and the section is never added to the rail — and every other surface keeps working. With no bridge the section simply never appears. See the rail section. - Cards follow your shell. Tool and warp cards use the card style Gentle Shell publishes, and a click expands that card only. See card style.
- Tool headings can name the activity. With
activitychosen on theCard activityline, a bash card whose heading shows the whole command is headed with the family its command names instead of$, and agrep,findorlscard is headed⌕ exploring; a command the classifier cannot name, or a heading that hides part of it, keeps the host's$. See the cards theactivitydesign paints. - File calls on a skill or an ODD are cards too. While that line answers with
activityfor the tool being painted, aread,editorwritewhose path names a skill or an ODD heads as that file — its own mark and label, the tool, the path and a read's line range — and its Markdown body is drawn by Pi's own renderer in the theme's Markdown roles. Any other file call is the host's own row. See the file cards. - Background-job tools are cards too. While that line answers with
activity,bash_background,monitor,job_stopandjob_listare drawn in the shell's own card style instead of Pi's plain box, with the job's label, its command and its own answer. See the jobs card. - The two advisory messages are cards too.
gentle-pi.exploration-budgetandgentle-pi.verifier-settle-reminderare drawn as⌕ Exploration budgetand⚑ Verifier reminder, the whole body at every content level. They follow thatCard activityline, with no second switch and no row added toCards. See the message cards. - The diff card is a design of the same kind.
Card diffkeepsdefaultavailable and selectscoloronce on the first run that finds no choice, so a write or an edit on a skill or an ODD stays the file card's row, because a specific claim wins over a generic one. See the diff card. editandwritecannot land in the principal checkout's default branch. A write whose path is inside the principal checkout of the session's repository, while that checkout is on the default branch, is refused with one line pointing atworktree_listandworktree_create. Paths outside the repository, anything under the OS temp directories, ODD artifacts, other repositories and linked worktrees are never blocked. See the guard.- A skill or an ODD is read whole. A
readof a.mdbelow askills/or anodd/folder drops itsoffsetandlimitbefore the tool runs, so the call delivers the whole document and never half a procedure. It follows theWorktrees+module, like the guards. bashcannot leave the principal checkout's default branch. Agit worktree addis refused in any cwd and pointed atworktree_create; in the principal checkout, a switch that would leave the branch it is on is refused while that branch is the repository's default, and creating a branch is not blocked. See the guards.- Two blocks in the system prompt.
## ODD worktreestells the agent how worktrees and ODDs work.## CodeGraphtells a session that already holds a CodeGraph tool how to use it, with one text per role. Both are appended after the host's own text, andODD_WORKTREE_PROMPT=0suppresses them. See the prompt block. - CodeGraph stays fresh, only when its CLI is installed. At session start the package creates or syncs the checkout's index and warms its daemon, and makes sure your global
mcp.jsonhas thecodegraphentry. It also syncs after a compaction, after a nativecodegraph initand after aneditorwrite, in the background and without ever blocking you. See CodeGraph. - Two reminders keep a session on the CodeGraph rule. The first
grep,find,ls,readorbashsearch in a checkout gets one sentence appended to its result: usecodegraphfirst, or — for another checkout — callmcp__codegraph__codegraph_explorewith that path asprojectPath. Neither is ever a block. See the reminders. - Deliberately absent. No customize panel of its own, no plugin-tools toggles, no companion-app integration and no worktree-to-issue association. There is nothing to configure here: the card designs are chosen on the bridge's own lines, so this package owns no preference of its own. See deliberately absent.
Documentation
| Your task | Start here |
|---|---|
| Look up a panel key | Panel keys |
| Read, merge or close a pull request | /prs |
| Understand a create, a warp or a delete in detail | Reference |
| Run the suite or see what CI and releases do | Tests, CI and releases |
| Change the package, follow its invariants or cut a release | docs/codebase/mental-model.md |
| Report a bug or request a feature | .github/ISSUE_TEMPLATE/ |
| Open a pull request | .github/PULL_REQUEST_TEMPLATE.md |
Next Steps
- Run
/warpin a repository with at least one other checkout to see the selector, thenworktree_listfrom the agent to confirm both surfaces agree. - Install
ghand rungh auth loginonce if you want/issues,/prsand theGITHUBrail section. - Read the reference before changing a panel key, a guard or a card.