@grayolson/pi-treebase
Interactive-rebase style tree navigation for pi sessions.
Package details
Install @grayolson/pi-treebase from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@grayolson/pi-treebase- Package
@grayolson/pi-treebase- Version
0.1.0- Published
- May 10, 2026
- Downloads
- 28/mo · 5/wk
- Author
- grayolson
- License
- MIT
- Types
- extension
- Size
- 119.9 KB
- Dependencies
- 0 dependencies · 4 peers
Pi manifest JSON
{
"extensions": [
"./extensions"
],
"image": "https://github.com/fu5ha/pi-treebase/raw/main/content/demo.gif"
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-treebase
A session history management tool that combines the functionality of the base /tree command
with something similar to git rebase --interactive.

Installation
pi install npm:@grayolson/pi-treebase
Usage
First, use the /treebase and navigate with the normal tree session view to choose the destination
to rebase history to.
Then, use an interactive editor of flattened history to select what to Pick (keep verbatim),
summarize with Low or High importance, or Drop entirely.
A new synthetic history branch is then created from the root you selected, interspersing actual picked history entries with generated summaries.
Summaries are generated by a model with full context of the entire branch (except dropped entries), but with instructions to only record a summary of the relevant section of the entire linear history into each summary block so that summaries makes sense when interspersed with picked entries.
Limitations
Currently, the only supported operation is to "rebase" directly back in time to a parent node. Rebasing one branch past a junction on top of of another branch is not yet supported.
Hacks
- Implementing this required (as far as I could tell) mutable access to pi's
SessionManager, which is usually exposed as onlyReadonlySessionManagerto command handlers. I did a bad and just as-casted it to the writable version. I'm not sure exactly how bad the implications of this are. - Using a custom message types as a summary message doesn't behave super well with normal tree navigation, so I hackily pushed native branch summarization messages for this purpose by hooking a private method.
I will likely try to file issues/PR the ability to do these non-hackily once the bigrefactor lands.
Slop alert
Warning, this is moderately slop clanker code. It's been cleaned up a bit and I reviewed what I felt were the important parts, but do with that what you will.
