Skip to content

Releases: 00200200/tokencut

TokenCut v0.2.0: Zero-Bloat Context Optimization & MCP Companion

Choose a tag to compare

@00200200 00200200 released this 22 Sep 06:05

TokenCut v0.2.0: Zero-Bloat Context Optimization & MCP Companion

We are excited to announce TokenCut v0.2.0, bringing unified autonomous context optimization, multi-language AST code skeletonization, specialized test-runner compaction, and a native macOS companion to AI coding assistants (Claude Code, Cursor, Codex, Gemini CLI).

🚀 What's New in v0.2.0

1. Autonomous Context Optimizer (tokencut optimize & MCP tokencut_optimize)

  • Multi-stage deterministic prompt optimization:
    • Automatically folds JSON arrays into ultra-compact TOON or markdown tables (saving 60–80%).
    • Compacts unified git diffs (```diff) and masks noisy lockfiles.
    • Slices stack traces and folds runtime noise while preserving root causes.
    • Aligns prompt cache boundaries for Anthropic, OpenAI, and Gemini prompt caching.

2. Multi-Language AST Code Skeletonization

  • Powered by native ast-grep Tree-Sitter bindings:
    • Supports TypeScript (.ts, .tsx), JavaScript (.js, .jsx), Go (.go), Rust (.rs), Java (.java), and C/C++ (.c, .h, .cpp, .hpp).
    • Replaces function, method, and constructor implementation bodies with { ... } atomically while preserving all type signatures, interfaces, struct definitions, generics, and docstrings.
    • Available via tokencut cat --skeleton <file> and tokencut pack --skeleton.

3. Zero-Loss Test Runner Compaction

  • Specialized smart filters for the most popular developer test runners:
    • cargo test: Collapses contiguous runs of passing tests; 85–98% token reduction.
    • go test: Collapses === RUN / --- PASS: pairs into progress counts; retains package summaries.
    • vitest / jest / npm test: Collapses passing checkmarks and suites.
    • pytest: Collapses session progress lines while retaining full summaries.
    • Strict Safety Guarantee: The instant any failure (FAILED, --- FAIL:, , panic:, AssertionError) occurs, all diagnostics, backtraces, and code frames are emitted 100% verbatim.

4. Git Log & Diff Payload Preservation

  • Enhanced stateful parsing for git log -p and git log --stat:
    • Diff bodies are routed to slim_git_diff, trimming unchanged context while preserving changed lines.
    • Commit messages are never mangled by diff context lines.
    • Stat summary blocks are preserved intact.

5. Native macOS Desktop Companion (TokenCut.app)

  • Lightweight, draggable desktop pet and menu-bar HUD built with native SwiftUI.
  • Prepare for Chat: Paste messy terminal logs or transcripts to compare side-by-side and copy the compacted version into web chats or IDEs.
  • Live Allowance Monitors: Track 5-hour rate limit windows for Claude and Codex locally without model calls.

6. Community Share Command & README Badges

  • Run tokencut share or tokencut share --badge to generate Markdown badges for your open source repositories:
    [![TokenCut Context](https://img.shields.io/badge/tokencut-context%20optimized-b3f5cd)](https://github.com/00200200/tokencut)

📦 Installation

# Install with uv (recommended)
uv tool install 'git+https://github.com/00200200/tokencut.git'

# Verify installation (runs locally, zero model calls)
tokencut demo

🔌 Connect Your Agent

# Claude Code
claude mcp add --scope user tokencut -- tokencut mcp --profile coding

# Codex
codex mcp add tokencut -- tokencut mcp --profile coding

🍏 Download Native macOS Companion

Download TokenCut-v0.2.0-macos.zip attached below, unzip, and drag TokenCut.app to your /Applications folder.

What's Changed

  • Use TokenCut-only optimization and fix Claude source diagnostics by @00200200 in #2
  • docs: showcase 3D desktop pet companion in README and add Windsurf MCP integration by @00200200 in #3
  • fix: report invalid MCP configuration and conflicting shell aliases by @00200200 in #4
  • feat: preserve task context across native compaction by @00200200 in #5
  • feat: Native Zero-LSP Code Intelligence, Guarded Symbol Editing, and Animated Desktop Pet HUD by @00200200 in #6
  • feat: in-chat clipboard compactor, AI context packager, and Zero-LSP callers/references by @00200200 in #7
  • feat: in-chat conversation distiller, TOON table compressor, and prompt cache aligner by @00200200 in #8
  • Show TokenCut in a focused README and reduce MCP schema overhead by @00200200 in #9
  • Prepare chat input on macOS and show the real app in README by @00200200 in #10
  • Fix Claude quota reads and show percentage windows in the pet by @00200200 in #11
  • feat: unified autonomous context optimizer (intra-fence compaction, TOON, distill, cache align) by @00200200 in #12
  • feat: multi-language AST code skeletonization and autonomous chat preparation by @00200200 in #15
  • fix(specialized): keep git log -p/--stat payloads out of the commit message and in the output by @kulchankas in #13
  • feat(specialized): collapse passing cargo test records by @kulchankas in #14

New Contributors

Full Changelog: v0.1.0...v0.2.0

TokenCut v0.1.0 Preview

Pre-release

Choose a tag to compare

@github-actions github-actions released this 20 Sep 18:07
7b65b7b

First public preview of TokenCut's local tool-output optimizer and macOS desktop companion.

What's included

  • A draggable mint robot with bundled 3D-rendered artwork, an English interface, light/dark appearance and no idle animation or runtime image generation.
  • A local dashboard for before/after tool-output counts, recovery costs, seven-day history and breakdowns by client, project and tool. Statistics contain counters and metadata; recoverable content stays in a separate cache.
  • Account allowances displayed separately from text savings: Codex CLI integration and an optional CodexBar adapter for Claude Code. Missing readings are shown explicitly.
  • Bounded MCP output, recoverable command output, targeted source reads, incremental code indexing and guarded symbol edits.
  • A conservative RTK adapter that processes captured output without executing a command twice. Its byte-based estimates remain separate from TokenCut's tokenizer estimates.
  • CLI, MCP and Claude Code hook integration, plus pause/resume and metadata-only export.

Install

Requires Python 3.11+ and uv. Install this repository's release:

uv tool install 'git+https://github.com/00200200/tokencut.git@v0.1.0'

For the macOS pet, download the ZIP matching your CPU architecture, extract TokenCut.app into ~/Applications, and launch it. The app requires the CLI above at ~/.local/bin/tokencut; it resolves the current user's home directory. The app is locally ad-hoc signed, not notarized, and this preview does not include a public installer. macOS 13+ is required. See the setup guide for MCP and hook configuration.

Python wheel/source distributions and SHA256SUMS.txt are attached. From the downloaded files' directory, shasum -a 256 -c SHA256SUMS.txt verifies integrity; missing assets are reported if only some files were downloaded.

Verified and limitations

  • 297 Python tests, CI on Python 3.11/3.12/3.13, a native macOS build/signature check and local UI checks passed before merging.
  • Release builds verify tests, app resources, portable backend configuration and signing before publishing assets.
  • Claude allowances require a compatible signed-in Claude Code CLI and the optional CodexBar CLI. ChatGPT chat and Antigravity account quotas are not connected.
  • This measures estimated tool-output reduction, not extra subscription allowance, model reasoning usage or task quality. There is no claim of general superiority over Serena or RTK.
  • Code navigation uses syntax and local indexes, not full LSP semantic references or project-wide semantic renaming. Existing MCP clients need to reconnect after upgrading.

Changes: PR #1.