rtk
CLAUDE.md82k starsChanged 2 months agoApache-2.0View on GitHub
rtk (Rust Token Killer) is a high-performance CLI proxy that minimizes LLM token consumption by filtering and compressing command outputs. It reduces bash output by 60-90% on common development operations through smart filtering, grouping, truncation, and deduplication. All percentages in this repo measure bash output, not your bill. RTK ships no tokenizer (src/core/tracking.rs estimates tokens as bytes / 4), so the ratios are reliable but the absolute token counts are approximate. This is a fork with critical fixes for git…
- Installs packages
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Who's talking about rtk-ai/rtk
- mistralai/mistral-vibe“feat: add BeforeTool hook to intercept bash commands before execution”GitHub · Mar 24, 2026 · 31 reactions
- A Hacker News story“Rtk – reduce Claude Code token usage”Hacker News · Feb 28, 2026 · 18 points
- @midu.dev“¡Ojo a esto para ahorrar tokens! Intercepta comandos de terminal y comprime la salida ANTES de llegar al …”Bluesky · Sep 5, 2026 · 16 likes
- @jasonmulligan.com“github.com/rtk-ai/rtk”Bluesky · Mar 13, 2026 · 10 likes
- NixOS/nixpkgs“Build failure: rtk”GitHub · Jul 24, 2026 · 9 reactions
The biggest 5 of 110 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 110
Talked about on GitHub, Bluesky and Hacker News (110 times).
On GitHub · 50
- Mar 24, 2026feat: add BeforeTool hook to intercept bash commands before execution — mistralai/mistral-vibe31 reactions · 8 comments
- Jul 24, 2026Build failure: rtk — NixOS/nixpkgs9 reactions · 1 comment
- Apr 9, 2026[Performance]: reduce token usage & improve performance, such as with rust token killer rtk — tailcallhq/forgecode8 reactions · 8 comments
- Mar 24, 2026feat(hooks): add BeforeToolCallback to intercept tool calls before execution — mistralai/mistral-vibe6 reactions · 5 comments
- Jun 26, 2026Integrate Headroom, RTK, and Ponytail agent optimization tools — vzwjustin/cc-switch4 reactions
45 more on GitHub
- May 26, 2026[FEATURE]: add rtk to bash arity dictionary — anomalyco/opencode4 reactions · 3 comments
- Apr 21, 2026Agregar RTK como componente opcional para reducir 60-90% de tokens en outputs de shell — Gentleman-Programming/gentle-ai4 reactions · 11 comments
- Apr 21, 2026`cargo install rtk` installs the wrong package (Rust Type Kit instead of Rust Token Killer) — martinstannard/openrtk4 reactions
- Mar 29, 2026feat(components): add RTK (Rust Token Killer) token optimization component — Gentleman-Programming/gentle-ai3 reactions · 4 comments
- Jul 7, 2026docs: add README_zh-TW.md translation — doggy8088/rtk2 reactions
- May 9, 2026Codex hook support — edouard-claude/snip2 reactions · 1 comment
- Mar 31, 2026Consider using Rust Token Killer — yologdev/yoyo-evolve2 reactions · 9 comments
- Mar 1, 2026Stats via CLI? — mksglu/context-mode2 reactions · 5 comments
- Feb 13, 2026I saved 10M tokens (89%) on my Claude Code sessions with a CLI proxy — router-for-me/CLIProxyAPI2 reactions
- Nov 4, 2026RTK or caveman to reduce token consumption by default in just code ? — etalab-ia/codebox1 reaction · 1 comment
- Oct 15, 2026[FEATURE] Cheaper auto-mode re-check for Bash commands rewritten by a PreToolUse hook — anthropics/claude-code1 reaction
- Oct 15, 2026[BUG] Auto mode on a Max plan: a PreToolUse `updatedInput` rewrite sends the call to the local classifier, with no notice and no entry in `modelUsage` or `total_cost_usd` — anthropics/claude-code1 reaction · 2 comments
- Oct 2, 2026COR-1553 add resolve_command for Windows command execution — metalbear-co/mirrord1 reaction · 3 comments
- Sep 30, 2026Support Devin CLI as an agent (cmux hooks devin) — manaflow-ai/cmux1 reaction · 1 comment
- Sep 27, 2026v2: tool.execute.before rewrite executes but chat shows pre-hook input — anomalyco/opencode1 reaction · 3 comments
- Aug 31, 2026adopt core: pick the right shell for a command instead of hardcoding cmd /C (upstream #3618) — kylehgc/rtk1 reaction
- Aug 31, 2026adopt discover/search: Windows absolute paths never classify (upstream #3617) — kylehgc/rtk1 reaction
- Aug 31, 2026adopt hooks: keep the hook protocol channel free of the setup nag (upstream #3614) — kylehgc/rtk1 reaction
- Jul 17, 2026Adopt upstream vitest cluster: #2982 + #1497 + #1922 — kylehgc/rtk1 reaction · 2 comments
- Jul 9, 2026feat(community-tool): add RTK (Rust Token Killer) as community tool — Gentleman-Programming/gentle-ai1 reaction · 1 comment
- Jul 8, 2026Task(docs): Telemetry & Privacy page(s) — Kong/kongctl1 reaction · 1 comment
- Jul 2, 2026feat(agent): compress Bash command output via RTK when available — PostHog/code1 reaction · 4 comments
- Jun 4, 2026[feature] add Whale agent support on RTK — usewhale/Whale1 reaction · 2 comments
- May 29, 2026Add optional rtk (Rust Token Killer) support across the retrieval marketplace — mbeacom/context-kit1 reaction · 1 comment
- May 20, 2026[Bug]: `rtk` bypasses safety net — kenryu42/cc-safety-net1 reaction · 2 comments
- May 15, 2026Tool install — get-vix/vix1 reaction · 3 comments
- May 15, 2026feat: Add comparative to rtk and others in README.md — yvgude/lean-ctx1 reaction · 2 comments
- May 13, 2026docs: add RTK CLI proxy documentation — FabienGB69/qitconcierge1 reaction
- May 13, 2026"CLI hooks support for PreToolUse (similar to Claude Code) to enable RTK integration" — kirodotdev/Kiro1 reaction · 6 comments
- May 7, 2026rtk — JyrgenSuvalov/wtf-ai1 reaction
- Apr 18, 2026feat(hooks): support updatedInput for transparent command rewriting — MoonshotAI/kimi-cli1 reaction · 5 comments
- Apr 11, 2026rtkの導入 — book000/dotfiles1 reaction
- Mar 13, 2026fix(hook): respect Claude Code deny/ask permission rules on rewrite — mpecan/tokf1 reaction · 1 comment
- Mar 10, 2026t1430: Integrate rtk CLI proxy for token-optimized output — marcusquinn/aidevops1 reaction · 10 comments
- Mar 2, 2026feat: Add tools.exec.shellInit config for transparent tool integration (RTK-AI use case) — openclaw/openclaw1 reaction · 2 comments
- Feb 20, 2026deps: add rtk dependency — shunkakinoki/dotfiles1 reaction · 4 comments
- Nov 21, 2026rtk: 1.2.0 -> 1.2.1 — NixOS/nixpkgs0 reactions · 1 comment
- Nov 20, 2026summary.md: linked repos and releases, ticks, readable skip line — keelinfra/release-integrity0 reactions
- Nov 19, 2026agent-skills.github.rtk-ai.rtk: 1.2.0 → 1.2.1 — sudosubin/agents.nix0 reactions
- Nov 19, 2026rtk 1.2.1 — Homebrew/homebrew-core0 reactions · 1 comment
- Nov 19, 2026chore: update `rtk` from `1.2.0` to `1.2.1` — Glatzel/demon-forge0 reactions
- Nov 18, 2026feat: add One Command Saved Me 2.8M Claude Code Tokens post — joshmedeski/joshmedeski.com0 reactions · 1 comment
- Nov 18, 2026fix: ignore install instructions printed by echo/printf (v0.5.1) — emanuellzoe/aeppo0 reactions
- Nov 16, 2026fix(addons): bump rtk to 1.2.0 — gglucass/headroom-desktop0 reactions
- Nov 9, 2026rtk: 1.1.0 -> 1.2.0 — NixOS/nixpkgs0 reactions · 1 comment
On Bluesky · 50
- Sep 5, 2026¡Ojo a esto para ahorrar tokens! Intercepta comandos de terminal y comprime la salida ANTES de llegar al modelo. ✓-70% de ahorro ✓ Funciona… — @midu.devsays it tested it16 likes and reposts · 1 reply
- Mar 13, 2026github.com/rtk-ai/rtk — @jasonmulligan.com10 likes and reposts · 2 replies
- May 19, 2026🎉 50,000 ⭐ on GitHub. 5 months ago, a weekend hack. Huge thanks to the contributors and to everyone who starred, opened an issue, or… — @rtk-ai.app7 likes and reposts
- Apr 8, 2026RTK hit 20K stars ⭐ 300 billion tokens saved. 20B/day compressed. That's enough energy to power a town of 3,000 people for a year. One Rust… — @rtk-ai.app7 likes and reposts
- Apr 22, 2026rtk-ai / rtk: CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies ★32336… — @rusttrending.bsky.socialsays it tested it6 likes and reposts
45 more on Bluesky
- Oct 24, 2026My AI agents don't need every passing test "read out loud". I tried a small log filter (RTK) on saved output: 50 passing tests: 99 → 30… — @aethelgardshuman.bsky.social5 likes and reposts · 1 reply
- Oct 18, 2026rtk-ai / rtk: CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies ★83819… — @rusttrending.bsky.social4 likes and reposts
- Aug 31, 2026Coding agents burn a shocking number of tokens just reading shell output. rtk sits in front of every bash call and compresses the result… — @zupo.bsky.social4 likes and reposts
- May 3, 2026コーディングエージェントのトークン消費量を劇的に抑える(80-90%)とか。 出力結果をフィルターして不要な内容を減らしてからエージェントに渡すようにするっぽい RTKが使用するテレメトリの収集オプションもある(セットアップ時に聞かれる)けどデフォルトで無効。… — @anon5r.com4 likes and reposts
- Apr 10, 2026TIL — @gov.glados.computer4 likes and reposts
- May 17, 2026ちなみに、Rust token killerというツール(https://github.com/rtk-ai/rtk)があるんですけれど、これめっちゃいいです。どの生成AIでも非常に効率よくトークン消費を抑えることが出来るので、入れ得です。 — @tunsns.net3 likes and reposts
- Feb 2, 2026🎉 20 stars on rtk-ai in a few days! Thanks community! 🙏 RTK compresses command outputs before your LLM sees them - saving 60-90% tokens!… — @rtk-ai.app3 likes and reposts
- Nov 22, 2026Slash AI coding token costs fast AI coding agents burn through context fast on noisy terminal output. rtk is a single Rust binary CLI proxy… — @cherrypickedhq.bsky.social2 likes and reposts
- Jun 4, 2026rtkを導入したのだけど結構良い感じな気がする ちゃんとコマンドの出力結果を圧縮してくれているし、これを次のテックブログネタにしようか rtk-ai/rtk https://github.com/rtk-ai/rtk — @yug1224.com2 likes and reposts · 1 reply
- May 19, 2026There’s such an exciting opportunity to optimize token usage for local LLMs. Some other exciting token optimizations: * MTP for Qwen 3.6… — @clofresh.bsky.social2 likes and reposts
- May 14, 2026Économisez des tokens Claude code ou autre agent IA avec : github.com/rtk-ai/rtk — @djioliat.bsky.social2 likes and reposts
- Apr 11, 2026https://github.com/rtk-ai/rtk bmann (/bmann) starred rtk-ai/rtk (/rtk-ai/rtk) · April 11, 2026 07:00 rtk-ai/rtk (/rtk-ai/rtk) CLI proxy… — @bmannconsulting.com2 likes and reposts
- Apr 10, 2026Zwei Ansätze, um Token zu sparen: Tool-Output eindampfen https://github.com/rtk-ai/rtk Talk like caveman… — @timo.social.hetzel.net.ap.brid.gy2 likes and reposts
- Apr 5, 2026Checkout the github repo at github.com/rtk-ai/rtk — @navinpeiris.com2 likes and reposts
- Mar 9, 2026rtk — AI coding agent is drowning in CLI noise. RTK compresses outputs by 89%. #OpenSource, Rust. MIT Lic github.com/rtk-ai/rtk — @qdrddr.bsky.social2 likes and reposts
- Feb 12, 2026cargo test: 155 lines of noise rtk cargo test: 3 lines Your AI coding assistant doesn't need all that output. rtk saves 60-90% of tokens on… — @rtk-ai.app2 likes and reposts
- Oct 25, 2026One Rust binary that shrinks what your AI coding agent reads from the shell by up to 90 percent. 🔗 github.com/rtk-ai/rtk #rtk #rust… — @prosperflowio.bsky.social1 likes and repost
- Oct 3, 2026rtk-ai / rtk: CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies ★82278… — @rusttrending.bsky.social1 likes and repost
- Sep 26, 2026RTK: an open-source Rust tool that compresses LLM context to cut token consumption 60-90%. Free. github.com/rtk-ai/rtk — @theundergroundai.bsky.social1 likes and repost
- Sep 16, 2026I've already saved 35K tokens this week using rtk 💜 github.com/rtk-ai/rtk — @jaimeiniesta.com1 likes and repost
- Sep 3, 2026rtk-ai / rtk: CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies ★78449… — @rusttrending.bsky.social1 likes and repost
- Aug 20, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 rtk-ai / rtk ⭐ 76,756 (+165) 🗒 Rust CLI proxy that reduces LLM token consumption by 60-90% on common… — @github-trending-rs.bsky.social1 likes and repost
- Jun 12, 2026github.com/rtk-ai/rtk GitHub - rtk-ai/rtk: CLI proxy that reduces LLM token consumption by 60-90% on common dev comman... — @technews4869.bsky.social1 likes and repost
- Jun 10, 2026I tried one of those token savers (rtk) but claude decided it didn't like it, so it started piping all commands to /tmp and reading the… — @wilb.me1 likes and repost · 1 reply
- Jun 4, 2026コマンド実行時の出力を圧縮してLLMのトークン消費を大幅に削減するRust製ツールらしい AIコーディングを日常的に使っているなら導入してみると便利そう yug1224 starred rtk-ai/rtk https://github.com/rtk-ai/rtk — @yug1224.com1 likes and repost
- May 26, 2026Ohh my brain. Sorry it’s rtk. github.com/rtk-ai/rtk — @darth-vada.bsky.social1 likes and repost
- May 19, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 rtk-ai / rtk ⭐ 50,366 (+667) 🗒 Rust CLI proxy that reduces LLM token consumption by 60-90% on… — @github-trending-rs.bsky.social1 likes and repost · 1 reply
- May 19, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 rtk-ai / rtk ⭐ 50,366 (+667) 🗒 Rust CLI proxy that reduces LLM token consumption by 60-90% on… — @github-trending.bsky.social1 likes and repost · 1 reply
- May 13, 2026rtk — Your AI coding agent is drowning in CLI noise. RTK compresses outputs by 89%. Open source, Rust. github.com/rtk-ai/rtk — @qdrddr.bsky.social1 likes and repost · 1 reply
- May 8, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 rtk-ai / rtk ⭐ 44,543 (+858) 🗒 Rust CLI proxy that reduces LLM token consumption by 60-90% on… — @github-trending-rs.bsky.social1 likes and repost · 1 reply
- May 4, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 rtk-ai / rtk ⭐ 41,011 (+678) 🗒 Rust CLI proxy that reduces LLM token consumption by 60-90% on… — @github-trending-rs.bsky.social1 likes and repost · 1 reply
- Apr 22, 2026da uma olhada no rtk, pode ajudar um pouco: github.com/rtk-ai/rtk — @reinaldorauch.dev.br1 likes and repost · 1 reply
- Apr 22, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 rtk-ai / rtk ⭐ 32,138 (+813) 🗒 Rust CLI proxy that reduces LLM token consumption by 60-90% on… — @github-trending-rs.bsky.social1 likes and repost · 2 replies
- Apr 21, 2026icymi — @gov.glados.computer1 likes and repost · 1 reply
- Mar 14, 2026⚡ My rtk gain: ___ tokens saved (___) over ___ commands. That's ___ less noise in my AI's context window. github.com/rtk-ai/rtk — @lv10one.bsky.social1 likes and repost
- Feb 28, 2026Rtk – reduce Claude Code token usage L: https://github.com/rtk-ai/rtk C: https://news.ycombinator.com/item?id=47189599 posted on 2026.02.27… — @hnws.bsky.social1 likes and repost
- Nov 2, 2026❯ rtk init --codex --global [--dry-run] RTK saved 666 tokens (68.6%), confirmed by rtk gain --history. github.com/rtk-ai/rtk — @foobar.eagleusb.com0 likes and reposts · 1 reply
- Oct 6, 2026rtkは、エージェントが打つシェルコマンドの出力を、LLMに渡す前に縮めるRust製のプロキシです。Apache-2.0。 git statusは短い形に、テスト結果は失敗だけ、ログの重複はまとめる。Claude… — @mint-echosphere.bsky.social0 likes and reposts · 1 reply
- Sep 12, 2026Nos devs consomment quelques centaines a milliers d'euros en token chaque mois. Malgré les réductions de token par des outils genre… — @timil.eurosky.social0 likes and reposts · 1 reply
- Sep 6, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 rtk-ai / rtk ⭐ 79,035 (+386) 🗒 Rust CLI proxy that reduces LLM token consumption by 60-90% on… — @github-trending-rs.bsky.social0 likes and reposts · 1 reply
- Aug 24, 2026i use github.com/rtk-ai/rtk to save up on tokens, mb some other tools out there — @gudulin.com0 likes and reposts · 1 reply
- Aug 12, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 rtk-ai / rtk ⭐ 75,841 (+233) 🗒 Rust CLI proxy that reduces LLM token consumption by 60-90% on… — @github-trending-rs.bsky.social0 likes and reposts · 1 reply
- Jul 25, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 rtk-ai / rtk ⭐ 73,198 (+300) 🗒 Rust CLI proxy that reduces LLM token consumption by 60-90% on… — @github-trending-rs.bsky.social0 likes and reposts · 1 reply
- Jul 21, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 rtk-ai / rtk ⭐ 72,220 (+248) 🗒 Rust CLI proxy that reduces LLM token consumption by 60-90% on… — @github-trending-rs.bsky.social0 likes and reposts · 1 reply
- Jul 9, 2026Five tools I now use that cut that waste fast: 1. RTK (Rust Token Killer). Filters git and shell output before the AI sees it. Cuts 60-90%… — @lennartnacke.com0 likes and reposts · 1 reply
On Hacker News · 10
- Feb 28, 2026Rtk – reduce Claude Code token usage18 points · 3 comments
- Apr 10, 2026CLI proxy that reduces LLM token consumption by 60-90% on common dev commandssays it tested it5 points · 2 comments
- Mar 29, 2026CLI proxy that reduces LLM token consumption by 60-90% on common dev commandssays it tested it4 points
- Feb 18, 2026Rtk – High-performance CLI proxy to minimize LLM token consumption4 points
- Feb 11, 2026Show HN: RTK – Wrap your CLI commands, save 60-90% of tokens in AI coding agentssays it tested it4 points · 4 comments
5 more on Hacker News
- Mar 17, 2026Rtk – CLI proxy that reduces LLM token consumption by 60-90%3 points
- Feb 19, 2026Rust Token Killer – High-performance CLI proxy to minimize LLM token consumption3 points · 1 comment
- Nov 6, 2026CLI proxy that reduces LLM token consumption by 60-90% on dev commands2 points
- May 19, 2026RTK: Rust Token Killer2 points · 2 comments
- Feb 13, 2026Rtk CLI Proxy2 points
In this repository13 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- code-simplifierSkill
- design-patternsSkill
- issue-triageSkill
- performanceSkill
- pr-reviewSkill
- pr-triageSkill
- repo-recapSkill
- rtk-tddSkill
- rtk-triageSkill
- security-guardianSkill
- shipSkill
- tdd-rustSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
14 rules. About 0 are common, 12 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
If rtk gain fails, you have the wrong package installed.
- Distinctive: line 89
Guaranteed compatibility: Always works even if RTK doesn't implement the command
- Very specific: line 98
All proxy commands appear in rtk gain --history with 0% bash output reduction (input = output).
- Distinctive: line 107
Fallback pattern: if filter fails, execute raw command unchanged
- Distinctive: line 117
CRITICAL: After ANY Rust file edits, ALWAYS run the full quality check pipeline before committing:
- Distinctive: line 124
Never commit code that hasn't passed all 3 checks
- Distinctive: line 126
If build fails, fix it immediately before continuing to next task
- Distinctive: line 148
Stay focused on the task: Do not make excessive operations to verify external APIs, documentation, or edge cases unless explicitly asked.
- Distinctive: line 150
Rule: If verification requires more than 3-4 exploratory commands, STOP and ask the user whether to continue or trust available info.
- Distinctive: line 165
When user provides a numbered plan (QW1-QW4, Phase 1-5, sprint tasks, etc.):
- Distinctive: line 167
Execute sequentially: Follow plan order unless explicitly told otherwise
- Distinctive: line 169
Never skip or reorder: If a step is blocked, report it and ask before proceeding
- Distinctive: line 170
Track progress: Use task list (TaskCreate/TaskUpdate) for plans with 3+ steps
- Distinctive: line 171
Validate assumptions: Before starting, verify all referenced file paths exist and working directory is correct
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
rtk (Rust Token Killer) is a high-performance CLI proxy that minimizes LLM token consumption by filtering and compressing command outputs. It reduces bash output by 60-90% on common development operations through smart filtering, grouping, truncation, and deduplication. All percentages in this repo measure bash output, not your bill. RTK ships no tokenizer (src/core/tracking.rs estimates tokens as bytes / 4), so the ratios are reliable but the absolute token counts are approximate.
This is a fork with critical fixes for git argument parsing and modern JavaScript stack support (pnpm, vitest, Next.js, TypeScript, Playwright, Prisma).
Name Collision Warning
Two different "rtk" projects exist:
- This project: Rust Token Killer (rtk-ai/rtk)
- reachingforthejack/rtk: Rust Type Kit (DIFFERENT - generates Rust types)
Verify correct installation:
rtk --version # Should show "rtk 0.28.2" (or newer)
rtk gain # Should show token savings stats (NOT "command not found")If rtk gain fails, you have the wrong package installed.
Development Commands
Note: If rtk is installed, prefer
rtk <cmd>over raw commands for token-optimized output. All commands work with passthrough support even for subcommands rtk doesn't specifically handle.
Build & Run
cargo build # raw
rtk cargo build # preferred (token-optimized)
cargo build --release # release build (optimized)
cargo run -- <command> # run directly
cargo install --path . # install locallyTesting
cargo test # all tests
rtk cargo test # preferred (token-optimized)
cargo test <test_name> # specific test
cargo test <module_name>:: # module tests
cargo test -- --nocapture # with stdout
bash scripts/test-all.sh # smoke tests (installed binary required)Linting & Quality
cargo check # check without building
cargo fmt # format code
cargo clippy --all-targets # all clippy lints
rtk cargo clippy --all-targets # preferredPre-commit Gate
cargo fmt --all && cargo clippy --all-targets && cargo test --allPackage Building
cargo deb # DEB package (needs cargo-deb)
cargo generate-rpm # RPM package (needs cargo-generate-rpm, after release build)Architecture
rtk uses a command proxy architecture: main.rs routes CLI commands via a Clap Commands enum to specialized filter modules in src/cmds/*/, each of which executes the underlying command and compresses its output. Token savings are tracked in SQLite via src/core/tracking.rs.
For the full architecture, component details, and module development patterns, see:
- ARCHITECTURE.md — System design, module organization, filtering strategies, error handling
- docs/contributing/TECHNICAL.md — End-to-end flow, folder map, hook system, filter pipeline
Module responsibilities are documented in each folder's README.md and each file's //! doc header. Browse src/cmds/*/ to discover available filters.
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, gradlew/mvn, php/artisan/phpunit/phpstan/pest.
Proxy Mode
Purpose: Execute commands without filtering but track usage for metrics.
Usage: rtk proxy <command> [args...]
Benefits:
- Bypass RTK filtering: Workaround bugs or get full unfiltered output
- Track usage metrics: Measure which commands Claude uses most (visible in
rtk gain --history) - Guaranteed compatibility: Always works even if RTK doesn't implement the command
Examples:
rtk proxy git log --oneline -20 # Full git log output (no truncation)
rtk proxy npm install express # Raw npm output (no filtering)
rtk proxy curl https://api.example.com/data # Any command worksAll proxy commands appear in rtk gain --history with 0% bash output reduction (input = output).
Coding Rules
Rust patterns, error handling, and anti-patterns are defined in .claude/rules/rust-patterns.md (auto-loaded into context). Key points:
- anyhow::Result everywhere, always
.context("description")? - No unwrap() in production code
LazyLockstatics for all regex (never compile on every function call)- Fallback pattern: if filter fails, execute raw command unchanged
- No async: single-threaded by design (startup <10ms)
- Exit code propagation:
std::process::exit(code)on child failure
Testing strategy and performance targets are defined in .claude/rules/cli-testing.md (auto-loaded). Key targets: <10ms startup, <5MB memory, 60-90% reduction in bash output bytes.
For contribution workflow and design philosophy, see CONTRIBUTING.md. For the step-by-step filter implementation checklist, see src/cmds/README.md.
Build Verification (Mandatory)
CRITICAL: After ANY Rust file edits, ALWAYS run the full quality check pipeline before committing:
cargo fmt --all && cargo clippy --all-targets && cargo test --allRules:
- Never commit code that hasn't passed all 3 checks
- Fix ALL clippy warnings before moving on (zero tolerance)
- If build fails, fix it immediately before continuing to next task
Performance verification (for filter changes):
hyperfine 'rtk git log -10' --warmup 3 # before
cargo build --release
hyperfine 'target/release/rtk git log -10' --warmup 3 # after (should be <10ms)Working Directory Confirmation
ALWAYS confirm working directory before starting any work:
pwd # Verify you're in the rtk project root
git branch # Verify correct branch (main, feature/*, etc.)Never assume which project to work in. Always verify before file operations.
Avoiding Rabbit Holes
Stay focused on the task. Do not make excessive operations to verify external APIs, documentation, or edge cases unless explicitly asked.
Rule: If verification requires more than 3-4 exploratory commands, STOP and ask the user whether to continue or trust available info.
Examples of rabbit holes to avoid:
- Excessive regex pattern testing (trust snapshot tests, don't manually verify 20 edge cases)
- Deep diving into external command documentation (use fixtures, don't research git/cargo internals)
- Over-testing cross-platform behavior (test macOS + Linux, trust CI for Windows)
- Verifying API signatures across multiple crate versions (use docs.rs if needed, don't clone repos)
When to stop and ask:
- "Should I research X external API behavior?" → ASK if it requires >3 commands
- "Should I test Y edge case?" → ASK if not mentioned in requirements
- "Should I verify Z across N platforms?" → ASK if N > 2
Plan Execution Protocol
When user provides a numbered plan (QW1-QW4, Phase 1-5, sprint tasks, etc.):
- Execute sequentially: Follow plan order unless explicitly told otherwise
- Commit after each logical step: One commit per completed phase/task
- Never skip or reorder: If a step is blocked, report it and ask before proceeding
- Track progress: Use task list (TaskCreate/TaskUpdate) for plans with 3+ steps
- Validate assumptions: Before starting, verify all referenced file paths exist and working directory is correct
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

