performance
Skill82k starsChanged 2 months agoApache-2.0View on GitHub
CLI performance optimization - startup time, memory usage, token savings benchmarking
- Installs packages
45 other projects use a version of this.
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Most recently taken up by
- diodeme/Gold-Bandtheir own version, first seen Sep 30, 2026
- Furkiozknn/Furkiozknntheir own version, first seen Sep 28, 2026
- elfrost/ai-patchlabtheir own version, first seen Sep 22, 2026
- ilang-ai/autocodetheir own version, first seen Sep 20, 2026
- angelgabrieljacintohuayllasco/clipboard-skillstheir own version, first seen Sep 20, 2026
- theexperiencecompany/gaiatheir own version, first seen Sep 17, 2026
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
- 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-code2 reactions · 2 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 · 1 comment
- 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 30, 2026rtk 1.3.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Nov 30, 2026rtk: 0.50.0 -> 1.3.0 — ekala-project/ekapkgs0 reactions
- Nov 30, 2026chore: update `rtk` from `1.2.1` to `1.3.0` — Glatzel/demon-forge0 reactions
- Nov 25, 2026agent-skills.github.rtk-ai.rtk: 1.2.1 → 0-unstable-2026-10-13 — sudosubin/agents.nix0 reactions
- Nov 23, 2026rtk: 0.50.0 -> 1.2.1 — ekala-project/ekapkgs0 reactions
- Nov 23, 2026chore(deps): bump rtk to v1.2.1 — RijksICTGilde/hackathon-claude-code0 reactions
- 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
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
Used with
Projects with it also use web-quality-audit, core-web-vitals and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
RodrigoTomeESSkillweb-quality-audit
Comprehensive web quality audit covering performance, accessibility, SEO, and best practices. Use when asked to "audit my site", "review web quality", "run lighthouse audit", "check page quality", or "optimize my website".
Also in 5 projects that use this
thisisAhsanIqbalSkillcore-web-vitals
Audits HTML patterns that affect Core Web Vitals (LCP, CLS, INP). Checks for layout shift causes, largest contentful paint blockers, and interaction responsiveness issues. Use when optimising page performance or fixing Google PageSpeed Insights warnings.
Also in 6 projects that use this
kpbraySkillbest-practices
Applies Power BI best practices, BPA rules, and enterprise standards. Use for quality validation, naming conventions, and performance optimization.
Also in 5 projects that use this
ElasticSkillaccessibility
Accessibility guidance for Kibana. Use this skill when working with or reviewing EUI components, resolving a11y-related (@elastic/eui) ESLint issues, and ensuring proper use of ARIA attributes, focus management, keyboard interactions, and accessible naming conventions.
Also in 13 projects that use this
pproencaSkillrefactoring
Code refactoring best practices based on Martin Fowler's catalog and Clean Code principles. This skill should be used when refactoring existing code, improving code structure, reducing complexity, eliminating code smells, or reviewing code for maintainability. Triggers on tasks involving extract method, rename, decompose conditional, reduce coupling, or improve readability.
Also in 7 projects that use this
BlockSkilldebugging
Debugging guidelines and best practices
Also in 10 projects that use this
Other versions45 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 45
- addyosmani/web-quality-skills★ 2.9ksame name
- plugin87/ux-ui-agent-skills★ 1.5ksame name
- rshankras/claude-code-apple-skills★ 777same name
- nth5693/gemini-kit★ 373same name
- theexperiencecompany/gaia★ 306same name
- Piebald-AI/splitrail★ 222same name
- diodeme/Gold-Band★ 143same name
- jvm-skills/jvm-skills★ 140same name
- TheBeardedBearSAS/claude-craft★ 106same name
- ilang-ai/autocode★ 103same name
35 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- code-simplifierSkill
- design-patternsSkill
- issue-triageSkill
- pr-reviewSkill
- pr-triageSkill
- repo-recapSkill
- rtk-tddSkill
- rtk-triageSkill
- security-guardianSkill
- shipSkill
- tdd-rustSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 24 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Automatically triggered: After filter changes, regex modifications, or dependency additions
- Distinctive: line 12
Manual invocation: When performance degradation suspected or before release
- Distinctive: line 13
Proactive: After any code change that could impact startup time or memory
- Distinctive: line 28
Before making any changes, capture current performance:
- Distinctive: line 319
Before committing filter changes:
“Common” is measured: kept by at least 6 in 10 of the 24 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Performance Optimization Skill
Systematic performance analysis and optimization for RTK CLI tool, focusing on startup time (<10ms), memory usage (<5MB), and token savings (60-90%).
When to Use
- Automatically triggered: After filter changes, regex modifications, or dependency additions
- Manual invocation: When performance degradation suspected or before release
- Proactive: After any code change that could impact startup time or memory
RTK Performance Targets
| Metric | Target | Verification Method | Failure Threshold |
| Startup time | <10ms | hyperfine 'rtk <cmd>' | >15ms = blocker |
| Memory usage | <5MB resident | /usr/bin/time -l rtk <cmd> (macOS) | >7MB = blocker |
| Token savings | 60-90% | Tests with count_tokens() | <60% = blocker |
| Binary size | <5MB stripped | ls -lh target/release/rtk | >8MB = investigate |
Performance Analysis Workflow
1. Establish Baseline
Before making any changes, capture current performance:
# Startup time baseline
hyperfine 'rtk git status' --warmup 3 --export-json /tmp/baseline_startup.json
# Memory usage baseline (macOS)
/usr/bin/time -l rtk git status 2>&1 | grep "maximum resident set size" > /tmp/baseline_memory.txt
# Memory usage baseline (Linux)
/usr/bin/time -v rtk git status 2>&1 | grep "Maximum resident set size" > /tmp/baseline_memory.txt
# Binary size baseline
ls -lh target/release/rtk | tee /tmp/baseline_binary_size.txt2. Make Changes
Implement optimization or feature changes.
3. Rebuild and Measure
# Rebuild with optimizations
cargo build --release
# Measure startup time
hyperfine 'target/release/rtk git status' --warmup 3 --export-json /tmp/after_startup.json
# Measure memory usage
/usr/bin/time -l target/release/rtk git status 2>&1 | grep "maximum resident set size" > /tmp/after_memory.txt
# Check binary size
ls -lh target/release/rtk | tee /tmp/after_binary_size.txt4. Compare Results
# Startup time comparison
hyperfine 'rtk git status' 'target/release/rtk git status' --warmup 3
# Example output:
# Benchmark 1: rtk git status
# Time (mean ± σ): 6.2 ms ± 0.3 ms [User: 4.1 ms, System: 1.8 ms]
# Benchmark 2: target/release/rtk git status
# Time (mean ± σ): 7.8 ms ± 0.4 ms [User: 5.2 ms, System: 2.1 ms]
#
# Summary
# 'rtk git status' ran 1.26 times faster than 'target/release/rtk git status'
# Memory comparison
diff /tmp/baseline_memory.txt /tmp/after_memory.txt
# Binary size comparison
diff /tmp/baseline_binary_size.txt /tmp/after_binary_size.txt5. Identify Regressions
Startup time regression (>15% increase or >2ms absolute):
# Profile with flamegraph
cargo install flamegraph
cargo flamegraph -- target/release/rtk git status
# Open flamegraph.svg
open flamegraph.svg
# Look for:
# - Repeated fixed-regex compilation (should be in LazyLock init)
# - Excessive allocations
# - File I/O on startup (should be zero)Memory regression (>20% increase or >1MB absolute):
# Profile allocations (requires nightly)
cargo +nightly build --release -Z build-std
RUSTFLAGS="-C link-arg=-fuse-ld=lld" cargo +nightly build --release
# Use DHAT for heap profiling
cargo install dhat
# Add to main.rs:
# #[global_allocator]
# static ALLOC: dhat::Alloc = dhat::Alloc;Token savings regression (<60% savings):
# Run token accuracy tests
cargo test test_token_savings
# Example failure output:
# Git log filter: expected ≥60% savings, got 52.3%
# Fix: Improve filter condensation logicCommon Performance Issues
Issue 1: Regex Recompilation
Symptom: Startup time >20ms, flamegraph shows regex compilation in hot path
Detection:
# Flamegraph shows Regex::new() calls during execution
cargo flamegraph -- target/release/rtk git log -10
# Check whether fixed patterns are compiled outside LazyLock staticsFix:
// ❌ WRONG: Recompiled on every call
fn filter_line(line: &str) -> Option<&str> {
let re = Regex::new(r"pattern").unwrap(); // RECOMPILED!
re.find(line).map(|m| m.as_str())
}
// ✅ RIGHT: Compiled once with LazyLock
use std::sync::LazyLock;
static LINE_PATTERN: LazyLock<Regex> =
LazyLock::new(|| Regex::new(r"pattern").unwrap());
fn filter_line(line: &str) -> Option<&str> {
LINE_PATTERN.find(line).map(|m| m.as_str())
}Issue 2: Excessive Allocations
Symptom: Memory usage >5MB, many small allocations in flamegraph
Detection:
# DHAT heap profiling
cargo +nightly build --release
valgrind --tool=dhat target/release/rtk git statusFix:
// ❌ WRONG: Allocates Vec for every line
fn filter_lines(input: &str) -> String {
input.lines()
.map(|line| line.to_string()) // Allocates String
.collect::<Vec<_>>()
.join("\n")
}
// ✅ RIGHT: Borrow slices, single allocation
fn filter_lines(input: &str) -> String {
input.lines()
.collect::<Vec<_>>() // Vec of &str (no String allocation)
.join("\n")
}Issue 3: Startup I/O
Symptom: Startup time varies wildly (5ms to 50ms), flamegraph shows file reads
Detection:
# strace on Linux
strace -c target/release/rtk git status 2>&1 | grep -E "open|read"
# dtrace on macOS (requires SIP disabled)
sudo dtrace -n 'syscall::open*:entry { @[execname] = count(); }' &
target/release/rtk git status
sudo pkill dtraceFix:
// ❌ WRONG: File I/O on startup
fn main() {
let config = load_config().unwrap(); // Reads ~/.config/rtk/config.toml
// ...
}
// ✅ RIGHT: Lazy config loading (only if needed)
fn main() {
// No I/O on startup
// Config loaded on-demand when first accessed
}Issue 4: Dependency Bloat
Symptom: Binary size >5MB, many unused dependencies in Cargo.toml
Detection:
# Analyze dependency tree
cargo tree
# Find heavy dependencies
cargo install cargo-bloat
cargo bloat --release --crates
# Example output:
# File .text Size Crate
# 0.5% 2.1% 42.3KB regex
# 0.4% 1.8% 36.1KB clap
# ...Fix:
# ❌ WRONG: Full feature set (bloat)
[dependencies]
clap = { version = "4", features = ["derive", "color", "suggestions"] }
# ✅ RIGHT: Minimal features
[dependencies]
clap = { version = "4", features = ["derive"], default-features = false }Optimization Techniques
Technique 1: LazyLock Initialization
Use case: Regex patterns, static configuration, one-time allocations
Implementation:
use regex::Regex;
use std::sync::LazyLock;
static COMMIT_HASH: LazyLock<Regex> =
LazyLock::new(|| Regex::new(r"[0-9a-f]{7,40}").unwrap());
static AUTHOR_LINE: LazyLock<Regex> =
LazyLock::new(|| Regex::new(r"^Author: (.+)$").unwrap());
static DATE_LINE: LazyLock<Regex> =
LazyLock::new(|| Regex::new(r"^Date: (.+)$").unwrap());
// Fixed regexes compile on first use and are then reusedImpact: ~5-10ms saved per regex pattern (if compiled at runtime)
Technique 2: Zero-Copy String Processing
Use case: Filter output without allocating intermediate Strings
Implementation:
// ❌ WRONG: Allocates String for every line
fn filter(input: &str) -> String {
input.lines()
.filter(|line| !line.is_empty())
.map(|line| line.to_string()) // Allocates!
.collect::<Vec<_>>()
.join("\n")
}
// ✅ RIGHT: Borrow slices, single final allocation
fn filter(input: &str) -> String {
input.lines()
.filter(|line| !line.is_empty())
.collect::<Vec<_>>() // Vec<&str> (no String alloc)
.join("\n") // Single allocation for joined result
}Impact: ~1-2MB memory saved, ~1-2ms startup saved
Technique 3: Minimal Dependencies
Use case: Reduce binary size and compile time
Implementation:
# Only include features you actually use
[dependencies]
clap = { version = "4", features = ["derive"], default-features = false }
serde = { version = "1", features = ["derive"], default-features = false }
# Avoid heavy dependencies
# ❌ Avoid: tokio (adds 5-10ms startup overhead)
# ❌ Avoid: full regex (use regex-lite if possible)
# ✅ Use: anyhow (lightweight error handling)
# ✅ Use: LazyLock (zero runtime overhead)Impact: ~1-2MB binary size reduction, ~2-5ms startup saved
Performance Testing Checklist
Before committing filter changes:
Startup Time
- Benchmark with
hyperfine 'rtk <cmd>' --warmup 3 - Verify <10ms mean time
- Check variance (σ) is small (<1ms)
- Compare against baseline (regression <2ms)
Memory Usage
- Profile with
/usr/bin/time -l rtk <cmd> - Verify <5MB resident set size
- Compare against baseline (regression <1MB)
Token Savings
- Run
cargo test test_token_savings - Verify all filters achieve ≥60% savings
- Check real fixtures used (not synthetic)
Binary Size
- Check
ls -lh target/release/rtk - Verify <5MB stripped binary
- Run
cargo bloat --release --cratesif >5MB
Continuous Performance Monitoring
Pre-Commit Hook
Add to .claude/hooks/bash/pre-commit-performance.sh:
#!/bin/bash
# Performance regression check before commit
echo "🚀 Running performance checks..."
# Benchmark startup time
CURRENT_TIME=$(hyperfine 'rtk git status' --warmup 3 --export-json /tmp/perf.json 2>&1 | grep "Time (mean" | awk '{print $4}')
# Extract numeric value (remove "ms")
CURRENT_MS=$(echo $CURRENT_TIME | sed 's/ms//')
# Check if > 10ms
if (( $(echo "$CURRENT_MS > 10" | bc -l) )); then
echo "❌ Startup time regression: ${CURRENT_MS}ms (target: <10ms)"
exit 1
fi
# Check binary size
BINARY_SIZE=$(ls -l target/release/rtk | awk '{print $5}')
MAX_SIZE=$((5 * 1024 * 1024)) # 5MB
if [ $BINARY_SIZE -gt $MAX_SIZE ]; then
echo "❌ Binary size regression: $(($BINARY_SIZE / 1024 / 1024))MB (target: <5MB)"
exit 1
fi
echo "✅ Performance checks passed"CI/CD Integration
Add to .github/workflows/ci.yml:
- name: Performance Regression Check
run: |
cargo build --release
cargo install hyperfine
# Benchmark startup time
hyperfine 'target/release/rtk git status' --warmup 3 --max-runs 10
# Check binary size
BINARY_SIZE=$(ls -l target/release/rtk | awk '{print $5}')
MAX_SIZE=$((5 * 1024 * 1024))
if [ $BINARY_SIZE -gt $MAX_SIZE ]; then
echo "Binary too large: $(($BINARY_SIZE / 1024 / 1024))MB"
exit 1
fiPerformance Optimization Priorities
Priority order (highest to lowest impact):
- 🔴 LazyLock regex (5-10ms per pattern if compiled at runtime)
- 🔴 Remove startup I/O (10-50ms for config file reads)
- 🟡 Zero-copy processing (1-2MB memory, 1-2ms startup)
- 🟡 Minimal dependencies (1-2MB binary, 2-5ms startup)
- 🟢 Algorithm optimization (varies, measure first)
When in doubt: Profile first with flamegraph, then optimize the hottest path.
Tools Reference
| Tool | Purpose | Command |
| hyperfine | Benchmark startup time | hyperfine 'rtk <cmd>' --warmup 3 |
| time | Memory usage (macOS) | /usr/bin/time -l rtk <cmd> |
| time | Memory usage (Linux) | /usr/bin/time -v rtk <cmd> |
| flamegraph | CPU profiling | cargo flamegraph -- rtk <cmd> |
| cargo bloat | Binary size analysis | cargo bloat --release --crates |
| cargo tree | Dependency tree | cargo tree |
| DHAT | Heap profiling | cargo +nightly build && valgrind --tool=dhat |
| strace | System call tracing (Linux) | strace -c target/release/rtk <cmd> |
| dtrace | System call tracing (macOS) | sudo dtrace -n 'syscall::open*:entry' |
Install tools:
# macOS
brew install hyperfine
# Linux / cross-platform via cargo
cargo install hyperfine
cargo install flamegraph
cargo install cargo-bloatDoes 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.

