@urizafrir/pi-reader

Browse files pi has read during the session.

Packages

Package details

extension

Install @urizafrir/pi-reader from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@urizafrir/pi-reader
Package
@urizafrir/pi-reader
Version
0.1.0
Published
Jul 15, 2026
Downloads
79/mo · 79/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 (or k/j) — navigate the file list
  • PgUp/PgDn — page through the list or content
  • left/right (or h/l) — switch focus between the file list and content panes
  • Ctrl+← / Ctrl+→ — resize the split
  • Enter — send the selected file back into the conversation
  • Esc — close

Pass a path to also track a specific file before opening:

/reader path/to/file.ts

How it works

  • On tool_call for read, the file path is recorded in an in-memory map and appended to the session as a reader-file entry, so it survives /reload and session restore.
  • On session_start, the tracked set is rebuilt from the session branch (both reader-file custom entries and historical read tool 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