tokencut
Adaptive response compression with profile-aware output and structure-safe formatting.
Open source Open in the app JSON README (API)
About
Adaptive response compression with profile-aware output and structure-safe formatting.
Details
- Kind
- Plugins
- Topic
- No topic detected
- Publisher
- rvtechclub-alt
- Origin
- gemini
- Category
- ferramentas
- Version
- 1.0.0
- Stars
- 1
- Last push
- 2026-04-25T19:26:28Z
- Repository state
- ativo
- Language
- Python
- License
- MIT
- Added
- 2026-08-30 14:13:39
- Updated
- 2026-08-30 14:13:39
- Origin id
rvtechclub-alt/tokencut
README
# πͺ¨ TokenCut ### Cut tokens, not meaning. --- **Stars β’ Last Commit β’ License** --- ## Before / After β’ Install β’ Profiles β’ Benchmarks β’ Philosophy --- # π§ TokenCut Ecosystem **TokenCut β compress what AI says** (you are here) --- > A developer-first AI compression layer that reduces LLM verbosity while preserving technical meaning, structure, and correctness. TokenCut turns long AI responses into **dense, high-signal output** β reducing noise, cost, and cognitive load. Same intelligence. Fewer tokens. Faster workflows. --- # π Before / After ### π£οΈ Normal AI (verbose) > The issue is likely caused by creating a new object reference during each render cycle. React uses shallow comparison for props, so this triggers unnecessary re-renders. You should use `useMemo` to stabilize the reference. --- ### πͺ¨ TokenCut (compressed) > New object each render β new ref β re-render. > Use `useMemo`. --- ### π£οΈ Normal AI > The authentication middleware is failing because token expiry is not properly validated. Let me inspect and suggest a fix. --- ### πͺ¨ TokenCut > Auth middleware bug. Token expiry check broken. Fix condition. --- Same meaning. Less noise. Faster understanding. --- # βοΈ Compression Profiles |Profile|Behavior| |---|---| |`auto`|Detect context automatically| |`dev`|Dense technical output (default for coding)| |`learn`|Balanced explanation + compression| |`fast`|Maximum compression for speed| --- # β¨ Core Features ## β‘ Output Compression Engine - semantic + linguistic compression pipeline - structure-safe (code, JSON, markdown preserved) - removes filler without losing meaning ## π§ Context Awareness - detects coding vs explanation vs debug tasks - adjusts compression level automatically - avoids unsafe compression in critical logic ## π Explainability Layer - compression ratio tracking - token estimation - βwhy this was shortenedβ insights (optional) ## π§Ύ Memory Compression - summarize long notes into dense technical memory - reduces repeated context load for agents --- # β‘ Example Compression Levels ### πͺΆ Learn > React re-renders due to new object reference each render. Wrap in `useMemo`. ### πͺ¨ Dev (default) > New object ref each render β re-render. Use `useMemo`. ### π₯ Fast > obj ref changes β re-render β useMemo --- # π¦ Commands ### CLI (tokencut-next) tokencut on tokencut off tokencut auto tokencut profile dev tokencut level 80 echo "text" | tokencut run --json tokencut run --explain tokencut memory notes.md --- ### Rewrite Engine tokencut-rewrite on tokencut-rewrite profile smart echo "text" | tokencut-rewrite run --- # π Benchmarks (typical results) |Task|Normal|TokenCut|Saved| |---|---|---|---| |Debug React issue|1200 tokens|180|85%| |Explain architecture|1400|420|70%| |API debugging|900|220|75%| |Code review|1100|300|72%| --- # π§ Philosophy > Good AI is not more words. > Good AI is better words. TokenCut is built on one belief: > **Clarity = maximum meaning / minimum tokens** --- # π Use Cases - AI coding assistants - Debugging workflows - Code review compression - Terminal-based AI tools - Prompt engineering optimization - Cost reduction for LLM APIs --- # βοΈ Installation ### 1) Clone repo git clone https://github.com/rvtechclub-alt/TokenCut.git cd TokenCut --- ### 2) Install runtime cd tokencut-next pip install -e . --- ### 3) Run tests pytest -q --- # π§© Integration Targets TokenCut works with: - Claude Code workflows - Codex environments - Cursor / Windsurf rules - Gemini CLI extensions - Copilot instruction layers --- # π§ Why TokenCut Exists Modern AI tools are: - powerful but verbose - correct but noisy - useful but inefficient TokenCut fixes this: > Same intelligence β fewer tokens β faster thinking --- # β‘ Important Notes - TokenCut does NOT reduce model intelligence - It only compresses **output text** - Core reasoning remains untouched - Best for developers, not casual chat --- # π License MIT License β use freely, build aggressively. --- # πͺ¨ Final Thought > Less text. > Same truth. > Better signal.