From 75bcf9dec6a3ddf2fecea9bc5aee5d1e0467854c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 07:45:25 +0000 Subject: [PATCH 1/4] chore(master): release 0.37.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 19 +++++++++++++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 93c546c8d..05b60243f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.36.0" + ".": "0.37.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 08cae60ae..688458579 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,25 @@ All notable changes to rtk (Rust Token Killer) will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.37.0](https://github.com/rtk-ai/rtk/compare/v0.36.0...v0.37.0) (2026-04-17) + + +### Features + +* **discover:** handle more npm/npx/pnpm/pnpx patterns ([9e96caa](https://github.com/rtk-ai/rtk/commit/9e96caa0a18a95c84da82ba57716a9d3ef86d0c8)) +* **refacto-core:** binary hook w/ native cmd exec + streaming ([e7b7f9a](https://github.com/rtk-ai/rtk/commit/e7b7f9ab665a0f7303d41d23ad156d24e5e8964e)) + + +### Bug Fixes + +* **docs:** use release please changelog no manual ([7591a14](https://github.com/rtk-ai/rtk/commit/7591a14e4ceb732ab7ca160ac01a852926abe77a)) +* isolate cursor hook tests from local settings (determinist) ([d8ddefe](https://github.com/rtk-ai/rtk/commit/d8ddefe78efe25c35bb2a2f9083f2eacb9dd7274)) +* P0+P1 fixes from pre-merge review of hook engine ([df8e035](https://github.com/rtk-ai/rtk/commit/df8e03558d4d6cc2f5cbac91c63ab1b3b51d3bcd)) +* P0+P1 fixes from pre-merge review of hook engine ([d34389c](https://github.com/rtk-ai/rtk/commit/d34389c3d0936c2b0790e14f450bb50a28a7edf7)) +* rename ship.md to ship/SKILL.md to match develop ([5916ecd](https://github.com/rtk-ai/rtk/commit/5916ecd86fb319c2519a0b4fb2891309833a3bb4)) +* **runner:** preserve fd separation on command failure ([e92d099](https://github.com/rtk-ai/rtk/commit/e92d0993c93f0b732316dfa932d265aeca7488d6)) +* **stream:** missing stderr fields ([a1d46f3](https://github.com/rtk-ai/rtk/commit/a1d46f39c291e3356b9c26a062bde05ba1de591a)) + ## [0.36.0](https://github.com/rtk-ai/rtk/compare/v0.35.0...v0.36.0) (2026-04-13) diff --git a/Cargo.lock b/Cargo.lock index 7ad9dc981..29a041450 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -892,7 +892,7 @@ dependencies = [ [[package]] name = "rtk" -version = "0.36.0" +version = "0.37.0" dependencies = [ "anyhow", "automod", diff --git a/Cargo.toml b/Cargo.toml index 81cc9c1df..778af25ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rtk" -version = "0.34.3" +version = "0.37.0" edition = "2021" authors = ["Patrick Szymkowiak"] description = "Rust Token Killer - High-performance CLI proxy to minimize LLM token consumption" From 4deb5ad0f2ced719bfc743888c9639e74ffd34e7 Mon Sep 17 00:00:00 2001 From: CI Date: Fri, 17 Apr 2026 18:39:14 +0400 Subject: [PATCH 2/4] feat: add MCP server for Claude Desktop integration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Exposes RTK's filter pipeline as a bash tool via Model Context Protocol, enabling the same 60-90% token savings in Claude Desktop that Claude Code users get via hooks. Key additions: - src/mcp/ — sync stdio JSON-RPC 2.0 server (no tokio, <10ms startup) - protocol.rs: Request/Response/Error types + MCP result structs - transport.rs: BufReader line-delimited reader + stdout writer - handler.rs: initialize/tools-list/tools-call/ping/shutdown dispatch - install.rs: writes rtk entry into claude_desktop_config.json (cross-platform) - rtk mcp-serve: start the server - rtk mcp-install: register in Claude Desktop config - src/core/tracking.rs: add source column (hook|mcp|direct) to SQLite with backward-compatible ALTER TABLE migration; adds record_with_source() and track_with_source() for MCP-tagged entries - tests/mcp_integration.rs: E2E tests (#[ignore]) — spawn binary, full JSON-RPC handshake over pipes, filter verification - docs/MCP.md: install, verify, troubleshoot guide - 41 unit tests covering all protocol types, handler methods, shell_split, and install helpers Co-Authored-By: Claude Sonnet 4.6 --- CLAUDE.md | 147 +++++++++++++ docs/MCP.md | 135 ++++++++++++ src/core/tracking.rs | 76 ++++++- src/main.rs | 26 +++ src/mcp/handler.rs | 438 +++++++++++++++++++++++++++++++++++++++ src/mcp/install.rs | 194 +++++++++++++++++ src/mcp/mod.rs | 71 +++++++ src/mcp/protocol.rs | 222 ++++++++++++++++++++ src/mcp/transport.rs | 65 ++++++ tests/mcp_integration.rs | 292 ++++++++++++++++++++++++++ 10 files changed, 1662 insertions(+), 4 deletions(-) create mode 100644 docs/MCP.md create mode 100644 src/mcp/handler.rs create mode 100644 src/mcp/install.rs create mode 100644 src/mcp/mod.rs create mode 100644 src/mcp/protocol.rs create mode 100644 src/mcp/transport.rs create mode 100644 tests/mcp_integration.rs diff --git a/CLAUDE.md b/CLAUDE.md index 9e89fff38..c5c67d482 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -77,6 +77,19 @@ Module responsibilities are documented in each folder's `README.md` and each fil Supported ecosystems: git/gh/gt, cargo, go/golangci-lint, npm/pnpm/npx, ruff/pytest/pip/mypy, rspec/rubocop/rake, dotnet, playwright/vitest/jest, docker/kubectl/aws. +### MCP Server (Claude Desktop) + +RTK can run as an MCP server for Claude Desktop, exposing a `bash` tool that routes commands through the same filter pipeline. + +```bash +rtk mcp-install # Register RTK in Claude Desktop's config +rtk mcp-serve # Start the MCP stdio server (used by Claude Desktop) +``` + +See [docs/MCP.md](docs/MCP.md) for full setup and troubleshooting. + +**Module**: `src/mcp/` — protocol.rs (JSON-RPC types), transport.rs (stdio), handler.rs (dispatch), install.rs (installer). + ### Proxy Mode **Purpose**: Execute commands without filtering but track usage for metrics. @@ -169,3 +182,137 @@ When user provides a numbered plan (QW1-QW4, Phase 1-5, sprint tasks, etc.): 3. **Never skip or reorder**: If a step is blocked, report it and ask before proceeding 4. **Track progress**: Use task list (TaskCreate/TaskUpdate) for plans with 3+ steps 5. **Validate assumptions**: Before starting, verify all referenced file paths exist and working directory is correct + + +# RTK (Rust Token Killer) - Token-Optimized Commands + +## Golden Rule + +**Always prefix commands with `rtk`**. If RTK has a dedicated filter, it uses it. If not, it passes through unchanged. This means RTK is always safe to use. + +**Important**: Even in command chains with `&&`, use `rtk`: +```bash +# ❌ Wrong +git add . && git commit -m "msg" && git push + +# ✅ Correct +rtk git add . && rtk git commit -m "msg" && rtk git push +``` + +## RTK Commands by Workflow + +### Build & Compile (80-90% savings) +```bash +rtk cargo build # Cargo build output +rtk cargo check # Cargo check output +rtk cargo clippy # Clippy warnings grouped by file (80%) +rtk tsc # TypeScript errors grouped by file/code (83%) +rtk lint # ESLint/Biome violations grouped (84%) +rtk prettier --check # Files needing format only (70%) +rtk next build # Next.js build with route metrics (87%) +``` + +### Test (90-99% savings) +```bash +rtk cargo test # Cargo test failures only (90%) +rtk vitest run # Vitest failures only (99.5%) +rtk playwright test # Playwright failures only (94%) +rtk test # Generic test wrapper - failures only +``` + +### Git (59-80% savings) +```bash +rtk git status # Compact status +rtk git log # Compact log (works with all git flags) +rtk git diff # Compact diff (80%) +rtk git show # Compact show (80%) +rtk git add # Ultra-compact confirmations (59%) +rtk git commit # Ultra-compact confirmations (59%) +rtk git push # Ultra-compact confirmations +rtk git pull # Ultra-compact confirmations +rtk git branch # Compact branch list +rtk git fetch # Compact fetch +rtk git stash # Compact stash +rtk git worktree # Compact worktree +``` + +Note: Git passthrough works for ALL subcommands, even those not explicitly listed. + +### GitHub (26-87% savings) +```bash +rtk gh pr view # Compact PR view (87%) +rtk gh pr checks # Compact PR checks (79%) +rtk gh run list # Compact workflow runs (82%) +rtk gh issue list # Compact issue list (80%) +rtk gh api # Compact API responses (26%) +``` + +### JavaScript/TypeScript Tooling (70-90% savings) +```bash +rtk pnpm list # Compact dependency tree (70%) +rtk pnpm outdated # Compact outdated packages (80%) +rtk pnpm install # Compact install output (90%) +rtk npm run