Compress prompt files locally before iterative AI loops to reduce input tokens, with backup and undo support, for Ralph-style loops and token-billed providers.
Trinity Compress (Skill)
Pre-run prompt compression for iterative AI dev loops.
Goal: reduce input tokens every iteration by compressing prompt files before your loop runs.
- Works with Ralph-style loops, agent/skill directories, and most token-billed providers.
- Runs as a local script (no model calls).
- Creates .bak backups and supports instant undo.
What it installs into a repo
trinity-compress.config.json— rules + targetsscripts/trinity-compress.sh— compression script- Makefile snippet (optional):
optimize-prompts,optimize-undo, etc. .gitignoresnippet: ignore*.bak- Installers:
scripts/install.ps1(Windows)scripts/install.sh(bash)
Requirements
- bash 4+
jqbc
Use
- Install into your repo (copy assets or use the included installer scripts)
- Run:
bash scripts/trinity-compress.sh balanced- or via Makefile target
Undo
- Restores all
*.bakbackups from the last run.
Notes
- This tool does not rewrite code blocks, URLs, file paths, or variable names.
- Aggressive mode may reduce clarity; review before committing.
Related skills
- Downloads
- 619All time
- Security audit
- Review
- Last updated
- 6mo ago
- Current version
- v1.0.1
- License
- MIT-0
