Skip to content

possibly/pi-tree-delete

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

pi-tree-delete

Delete and undo entries in your pi session tree.

Installation

pi install git:github.com/possibly/pi-tree-delete

Or try without installing:

pi -e git:github.com/possibly/pi-tree-delete

For development, clone and use:

pi -e ./pi-tree-delete/index.ts

Usage

Type /treed to open the session tree navigator with delete support.

Keybindings

Key Action
/ Navigate (same as /tree)
/ Page up/down
d Splice highlighted entry (children reparented to its parent)
ctrl+d Set/complete range mark — first press drops marker, second press splices all entries between marker and current position
r Undo last deletion (per-session snapshot stack)
Enter Navigate to highlighted entry
Esc If marker is active, cancel it; otherwise exit

Examples

Delete one entry:

  • Navigate to an entry
  • Press d
  • Its children move up to become children of its parent

Delete a range:

  • Navigate to start position, press ctrl+d (marker drops: )
  • Navigate to end position, press ctrl+d or d (range deleted)
  • Children of deleted entries are reparented to the first surviving ancestor

Undo:

  • Press r to restore the last deletion
  • Undo stack is per-session and cleared when you exit /treed

How it works

  • Tree is read directly from the JSONL file on each iteration, so deletions/undos are reflected immediately
  • Deletions splice entries (reparent children) rather than delete entire subtrees, preserving conversation history
  • Labels on deleted entries are dropped; children of deleted entries are reparented to the nearest surviving ancestor
  • Cursor automatically lands at position +1 after each deletion for smooth navigation

License

MIT

About

Tree context deletion for pi-agents

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors