@slix/pi-file-tracker
v0.1.2
Published
Widget that tracks files edited by the agent and shows per-file diff stats above the input
Downloads
403
Maintainers
Readme
@slix/pi-file-tracker
A persistent widget for the pi coding agent that sits above the text input and lists every file the agent has touched during the session — created, edited, or deleted — updated in real time.

Install
pi install npm:@slix/pi-file-trackerActivates automatically — no configuration needed. Run /reload if pi is already open.
What it shows
── Edited files (3/9) ────────────────────────────────────────────
| app.ts | src ✎3 +42 -7
✚ | new.json | config ✎1 +12 -0
✖ | old-utils.ts | src
… 6 older files hidden · /file-tracker allFiles are listed newest-first (most recently touched at the top). When the count exceeds the configured limit a dim footer shows how many older files are hidden.
| Element | Meaning |
|---------|---------|
| (3/9) | 3 shown out of 9 total tracked this session |
| +N (green) | Lines added across all edits to that file |
| -N (red) | Lines removed (always shown, 0 if none) |
| ✎N (yellow) | Number of separate edit/write operations |
| ✚ (green) | File was created new during this session |
| ✖ (red) | File was deleted during this session |
Stats are right-aligned to the terminal edge. Filenames are shown bold, followed by the parent directory path.
What gets tracked
Every file change the agent makes is captured, regardless of how it happens:
| Source | What's detected |
|--------|----------------|
| edit tool | Exact diff via pi's EditToolDetails |
| write tool | LCS diff against the previous file content |
| bash tool | Full filesystem snapshot diff — catches sed -i, cp, mv, touch, output redirections, rm, and anything else |
The bash tracking takes a directory snapshot before and after every shell command, so no file operation is missed.
Commands
| Command | Effect |
|---------|--------|
| /file-tracker | Toggle the widget on/off |
| /file-tracker chars | Switch between line-count and character-count display |
| /file-tracker clear | Reset the tracked files list |
| /file-tracker all | Toggle show-all mode — reveal every tracked file regardless of the limit |
| /file-tracker limit <N> | Set a custom visible-file limit (default: 8); also exits show-all mode |
File limit
By default only the 8 most recently touched files are shown. This keeps the widget compact during long sessions without losing history.
- Use
/file-tracker allto temporarily expand to the full list (the header will drop the/counter, e.g.Edited files (9)). - Use
/file-tracker limit 20to raise the cap permanently for the session. - When the limit is active and there are hidden files, the footer shows
… N older files hidden · /file-tracker all.
The limit and show-all state are both persisted to the session file, so they survive restarts.
Session persistence
State is saved to the session file after every change via pi.appendEntry, so the file list survives restarts and session resumes. It is also branch-aware: navigating the session tree with /tree rebuilds the list from the active branch, so the widget always reflects only the files touched on the current conversation path.
