pi-transcript-window
v0.3.1
Published
Pi extension: keep only the latest N TUI messages visible (old entries stay in the session file). Fork of pi-hide-messages adapted for pi 0.84+.
Downloads
132
Maintainers
Readme
pi-transcript-window
Keep only the latest N TUI chat messages visible in the Pi coding agent terminal UI, while preserving the full session context underneath.
Fork of pi-hide-messages by
newCman1, adapted for pi 0.84+ (the upstream
patch targeted the removed renderSessionContext API; this fork patches
renderSessionEntries and filters hidden entries directly).
Why
As a session grows, the TUI renders every entry — hundreds of tool calls,
each with output — and ctrl+o (expand tool output) rebuilds all of them,
making the UI slow. This extension hides older entries from the display
layer only: the session file (~/.pi/agent/sessions/*.jsonl) and the
model/agent context are never touched, so nothing is lost and compaction
behavior is unchanged.
Features
- Auto-hide on session start/switch — keep only the latest N entries visible
- Manual control —
/hide-messages 20keeps the latest 20;/restore-messagesbrings everything back - Branch-aware — hiding follows the active session path (works across
/resume,/new,/fork) - Display-only — hidden entries are never deleted; the agent keeps full context
- Configurable — global and project-level
config.json
Install
pi install git:github.com/newCman1/pi-transcript-windowOr copy this folder into an auto-discovery location:
~/.pi/agent/extensions/pi-transcript-window
# or project-local
.pi/extensions/pi-transcript-windowUsage
| Command | Description |
|---|---|
| /hide-messages | Hide older entries, keeping the configured default count (resets a previously tuned count) |
| /hide-messages 20 | Keep the latest 20 visible — permanent, written to the global config |
| /restore-messages | Restore all entries hidden by this extension |
| /window | Show the current ctrl+o expansion window |
| /window 30 | ctrl+o expands only the latest 30 bash tool outputs |
| /window off | ctrl+o expands all tool outputs (no limit) |
/window is independent of message hiding: it only controls how many
recent bash tool outputs ctrl+o expands. Other tools (read/write/update)
render as one-line summaries with cc-style and are not counted. Messages stay
fully visible; only the expansion is limited to the newest N bash calls.
/window off restores pi's default behavior (expand everything).
Configuration
Loaded from (project overrides global):
~/.pi/agent/extensions/pi-transcript-window/config.json
.pi/extensions/pi-transcript-window/config.json| Option | Type | Default | Description |
|---|---|---|---|
| debug | boolean | false | Reserved compatibility flag |
| defaultVisibleCount | number | 10 | Visible chat items to keep when hiding |
| autoHideOnSessionStart | boolean | true | Apply the limit on session start/switch |
{
"debug": false,
"defaultVisibleCount": 10,
"autoHideOnSessionStart": true
}How it works
/hide-messagesand/restore-messagesrecord intent as append-only custom session entries (no historical JSONL rewriting).- The extension patches
InteractiveMode.prototype.renderSessionEntries(pi 0.84+) to compute a hidden prefix over the active branch at render time and filter those entries before the original renderer runs. - Old entries remain in the session file and in the agent context — only the TUI display omits them.
Compatibility
- pi 0.84+ (patches
renderSessionEntries). Peer range is^0.84.0. - Requires interactive (TUI) mode; degrades silently elsewhere.
License
MIT — see LICENSE. Upstream: MasuRii/pi-hide-messages.
