Discover and explore top open-source AI tools and projects—updated daily.
aeromomoSlash AI agent token costs with advanced compression
New!
Top 35.9% on SourcePulse
Claw Compactor addresses the significant token spend incurred by AI agents by providing a command-line tool to compress workspace files. It targets AI agent developers and power users seeking to reduce operational costs by halving token usage through a suite of deterministic, rule-based compression techniques, eliminating the need for costly LLM processing during compression.
How It Works
The tool employs a five-layer compression pipeline: a rule engine for deduplication and filler removal, dictionary encoding with an auto-learned codebook, observation compression converting session JSONL to structured summaries, run-length encoding (RLE) for shorthand patterns, and a Compressed Context Protocol for abbreviation. This layered, deterministic approach ensures maximum savings without LLM inference costs, with specific layers offering lossless roundtrips or preserving all facts and decisions while removing verbose formatting.
Quick Start & Requirements
git clone https://github.com/aeromomo/claw-compactor.git) and navigate into the directory (cd claw-compactor).pip install tiktoken is optional but recommended for exact token counts; a CJK-aware heuristic is used otherwise.python3 scripts/mem_compress.py /path/to/workspace benchmarkpython3 scripts/mem_compress.py /path/to/workspace fullHighlighted Details
Maintenance & Community
The provided README does not detail specific contributors, sponsorships, partnerships, or community channels (e.g., Discord, Slack).
Licensing & Compatibility
The project is released under the MIT License, generally permitting commercial use and integration into closed-source projects without significant restrictions.
Limitations & Caveats
Observation compression and the Compressed Context Protocol are lossy but designed to preserve all facts and decisions. If tiktoken is not installed, token counts rely on a heuristic that is approximately 90% accurate. Dictionary decompression requires the presence of the memory/.codebook.json file. Ensure the workspace path is correct to avoid FileNotFoundError.
2 weeks ago
Inactive
benbrandt
microsoft
togethercomputer
openai