pi-reader
Browse files pi has read during the session.
Package details
Install pi-reader from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-reader- Package
pi-reader- Version
0.1.0- Published
- Jul 15, 2026
- Downloads
- 141/mo · 141/wk
- Author
- urizafrir
- License
- MIT
- Types
- extension
- Size
- 14.9 KB
- Dependencies
- 0 dependencies · 0 peers
Pi manifest JSON
{
"extensions": [
"./src/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-reader
Browse files pi has read during the session.
The extension tracks every file the assistant reads via the read tool and lets you
review them in a split-pane TUI viewer (file list on the left, content on the right),
wrapped in a border.
Usage
Run the command in an interactive session:
/reader
up/down(ork/j) — navigate the file listPgUp/PgDn— page through the list or contentleft/right(orh/l) — switch focus between the file list and content panesCtrl+←/Ctrl+→— resize the splitEnter— send the selected file back into the conversationEsc— close
Pass a path to also track a specific file before opening:
/reader path/to/file.ts
How it works
- On
tool_callforread, the file path is recorded in an in-memory map and appended to the session as areader-fileentry, so it survives/reloadand session restore. - On
session_start, the tracked set is rebuilt from the session branch (bothreader-filecustom entries and historicalreadtool calls).
Layout
pi-reader/
├── index.ts # thin entry: re-exports src/index.ts (for auto-discovery)
├── package.json # extension metadata + dev deps for typechecking
├── tsconfig.json
└── src/
├── index.ts # event hooks + /reader command
├── state.ts # tracked-file map + session rebuild
└── viewer.ts # BorderFrame + FileViewer split-pane component
Development
Typecheck against the installed pi packages:
npm install --ignore-scripts
npm run typecheck