Pi memoria
An Omarchy shell bar widget that shows how much disk
the pi coding agent's stored "memory" is using — session history, installed
skills, extensions and themes under ~/.pi/agent — with a click-through
breakdown you can drill into and open.
The bar pill shows the total on disk: <img src="docs/pill.png" alt="bar pill" height="20" valign="middle">
Features
- Bar pill with a database glyph and the total on-disk size (e.g.
2.6 MB). - Overview popup with an overall usage bar measured against a configurable capacity (default 5 GB), so it never looks pegged at max. The bar turns urgent past 90%.
- Per-bucket breakdown: session history, skills, extensions, themes, config & auth — each with size, share and counts.
- Drill-down: click any bucket to list its items, largest first.
- Session history → each project with its real path, session count and last-active date.
- Skills → each installed skill with its description.
- Extensions / Themes / Config → the individual files.
- Lists are capped at 500 items; if a bucket has more, the footer shows "first 500 items — some hidden" rather than silently truncating.
- Open anything: click an item to open it — directories go to the file manager, files open in your Omarchy default editor. An Open folder button jumps to the bucket's directory.
Install
omarchy plugin add https://github.com/marko-espi/omarchy-pi-memoria.git --enable
Pick the right section when prompted (its default placement).
To update or remove later:
omarchy plugin update marco.pi-memoria
omarchy plugin remove marco.pi-memoria
Configuration
The reference capacity the meters fill against is configurable per-widget via a
capacityGb key in this widget's entry in ~/.config/omarchy/shell.json:
{ "id": "marco.pi-memoria", "capacityGb": 10 }
Save and it hot-reloads. Invalid values fall back to 5 GB.
Commands
omarchy-shell marco.pi-memoria toggle # open/close the popup
omarchy-shell marco.pi-memoria refresh # recollect sizes now
How it works
pi-usage.sh— totals each bucket under~/.pi/agentwithdu -sbL(symlinked skills are dereferenced). Override the base dir withPI_DATA_DIR.pi-detail.sh <bucket>— lists the items inside a bucket, largest first. It stays fast regardless of install size: the sessions listing uses a singledu+find+awkpass (a fixed number of processes, not one per project), and the expensive per-row work is bounded by the 500-item cap. All fields are sanitized (control characters stripped, length-clamped) and every row is capped, so a large or unusual~/.pi/agentcan't flood the shell.pi-open.sh <path>— opens directories in the file manager, files in the Omarchy default editor.Model.js— Qt-free byte formatting and parsing (runnable under node).BarWidget.qml— the bar widget and popup UI.
Requirements
- Omarchy shell (Quickshell) with plugin support.
- GNU coreutils (
du -b,sort,head),find,awk,sed,bash.
License
MIT © Marco Espinoza