TRIM.py — trim LLM harness stores only (Cursor / Codex / Claude).
Works on bloated sessions / jsonl for all three harnesses:
| harness | what gets large | where |
|---|---|---|
| Cursor | chat store.db (protobuf blob graph) |
~/.cursor/chats/ |
| Codex | session rollout-*.jsonl |
~/.codex/sessions/ |
| Claude | project session *.jsonl |
~/.claude/projects/ |
Also clears harness clutter (agent-tools, tracking DB age-trim, Claude file-history tip-keep) — never live store.db via free.
Stdlib-only single file. No pip deps.
git clone https://github.com/ivp5/harness_trim.git
cd harness_trim
./install.sh # symlinks ~/bin/trim → TRIM.py
# ensure ~/bin is on PATH
trimOr run directly: python3 TRIM.py
trim # menu
trim map # harness store inventory
trim list # sessions by size
trim free # clutter preview, then asks (never live store.db)
trim cut # pick chat + level (default safe = 160 turns)
trim cut safe # or normal | tight
trim check # reliability battery
trim doctor
Confirm destructive steps by typing yes. No flags.
| command | notes |
|---|---|
free |
Preview first; skips locked chats; never touches live store.db. Removal is mv → macOS Trash only. Cut undo siblings (bloated-* / .pretrim-*) are never auto-retired. |
cut |
Refuses if locked; falsify+smoke before install; fat kept as bloated-*. Live store drops old turns. Default safe (160 turns). |
python3 TRIM.py check
# or
python3 test_reliability.pyMIT