# cmprss Compresses oversized Pi tool results and persists exact originals for retrieval. ## Install / load Loaded through the root `pi-ext` package. See [../../README.md](../../README.md). ## Commands / tools / settings Pi commands: - `/cmprss` — show status. - `/cmprss status` — show status. - `/cmprss stats` — show stored block count and estimated savings. - `/cmprss on` — enable compression for the current session branch. - `/cmprss off` — disable compression for the current session branch. - `/cmprss clear` — tombstone stored originals for the current session branch. Pi tools: - `cmprss_retrieve` — retrieve exact original text by hash. Pi hooks: - `session_start` — replay persisted originals and state. - `session_shutdown` — clear process-local cache. - `tool_result` — compress eligible oversized tool output. Pi settings: ```json { "cmprss": { "enabled": true, "thresholdBytes": 20000, "maxStoredBlocks": 64, "status": true, "tools": ["bash", "grep", "find", "ls", "read"] } } ``` ## Behavior `cmprss` compresses large text tool results before the next model turn. It stores the exact original in Pi session history, so restarting Pi can still retrieve the hidden bytes. For pre-truncated Pi bash results, it persists `details.fullOutputPath` content when available. Default compressors: - JSON arrays and objects. - grep/ripgrep-style search output. - unified diffs. - stack traces. - build/test logs. - generic head/tail text. Safety rules: - Never compresses `edit` or `write` results. - Never compresses `read` output when `offset`, `limit`, or `l` is set. - Preserves existing tool result details and adds `details.cmprss`. - Retrieval misses fail loudly with `cmprss: unknown hash`. Example marker: ```text [cmprss: bash 58000B → 7000B, saved ~12000t, hash=abc123] Use cmprss_retrieve(hash="abc123") for exact original text. ``` No server. No proxy. No Python. No Rust. No ML. No MCP. No telemetry. No dashboard.