code-simplifier
Skill82k starsChanged 2 months agoApache-2.0View on GitHub
Review RTK Rust code for idiomatic simplification. Detects over-engineering, unnecessary allocations, verbose patterns. Applies Rust idioms without changing behavior.
42 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
- kopp0510/claude-ddtheir own version, first seen Oct 5, 2026
- aktsmm/Agent-Skillstheir own version, first seen Oct 4, 2026
- yeisonrestrepo/code-conductortheir own version, first seen Oct 3, 2026
- wty-yy/skillstheir own version, first seen Oct 2, 2026
- zvadaadam/az-skillstheir own version, first seen Sep 28, 2026
- kaiohenricunha/dotbabeltheir own version, first seen Sep 24, 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
- 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
Used with
Projects with it also use comment-analyzer, setup-matt-pocock-skills 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.
lin30Skillcomment-analyzer
微博评论抓取与深度分析,生成可视化HTML报告。Use when user asks to analyze weibo comments, analyze social media comments, or requests sentiment analysis from weibo posts
Also in 3 projects that use this
AWSSkillsetup-matt-pocock-skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
Also in 3 projects that use this
OpenAISkillverification-before-completion
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
Also in 4 projects that use this
AWSSkillto-spec
Turn the current conversation into a spec and publish it to the project issue tracker: no interview, just synthesis of what you've already discussed.
Also in 3 projects that use this
GoogleSkillcode-review
Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.
Also in 9 projects that use this
MicrosoftSkillhandoff
Compact the current conversation into a handoff document for another agent to pick up.
Also in 5 projects that use this
- +2 more from aws
Other versions42 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 42
- getsentry/skills★ 1ksame name
- Azure/azqr★ 793same name
- microsoft/ghqr★ 529same name
- feiskyer/codex-settings★ 244same name
- FlorianBruniaux/ccboard★ 96same name
- zvadaadam/az-skills★ 49same name
- roman01la/skills-agents★ 48same name
- 1024XEngineer/bytemind★ 43same name
- kumaran-is/claude-code-onboarding★ 36same name
- fanqingxuan/awesome-skills★ 29same name
32 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
- design-patternsSkill
- issue-triageSkill
- performanceSkill
- 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
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 40 edited versions we read keep these.
1
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 158
Run these after simplification:
“Common” is measured: kept by at least 6 in 10 of the 40 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
RTK Code Simplifier
Review and simplify Rust code in RTK while respecting the project's constraints.
Constraints (never simplify away)
LazyLockregex — cannot be moved inside functions even if "simpler".context()on every?— verbose but mandatory- Fallback to raw command — never remove even if it looks like dead code
- Exit code propagation — never simplify to
Ok(()) #[cfg(test)] mod tests— never remove test modules
Simplification Patterns
1. Iterator chains over manual loops
// ❌ Verbose
let mut result = Vec::new();
for line in input.lines() {
let trimmed = line.trim();
if !trimmed.is_empty() && trimmed.starts_with("error") {
result.push(trimmed.to_string());
}
}
// ✅ Idiomatic
let result: Vec<String> = input.lines()
.map(|l| l.trim())
.filter(|l| !l.is_empty() && l.starts_with("error"))
.map(str::to_string)
.collect();2. String building
// ❌ Verbose push loop
let mut out = String::new();
for (i, line) in lines.iter().enumerate() {
out.push_str(line);
if i < lines.len() - 1 {
out.push('\n');
}
}
// ✅ join
let out = lines.join("\n");3. Option/Result chaining
// ❌ Nested match
let result = match maybe_value {
Some(v) => match transform(v) {
Ok(r) => r,
Err(_) => default,
},
None => default,
};
// ✅ Chained
let result = maybe_value
.and_then(|v| transform(v).ok())
.unwrap_or(default);4. Struct destructuring
// ❌ Repeated field access
fn process(args: &MyArgs) -> String {
format!("{} {}", args.command, args.subcommand)
}
// ✅ Destructure
fn process(&MyArgs { ref command, ref subcommand, .. }: &MyArgs) -> String {
format!("{} {}", command, subcommand)
}5. Early returns over nesting
// ❌ Deeply nested
fn filter(input: &str) -> Option<String> {
if !input.is_empty() {
if let Some(line) = input.lines().next() {
if line.starts_with("error") {
return Some(line.to_string());
}
}
}
None
}
// ✅ Early return
fn filter(input: &str) -> Option<String> {
if input.is_empty() { return None; }
let line = input.lines().next()?;
if !line.starts_with("error") { return None; }
Some(line.to_string())
}6. Avoid redundant clones
// ❌ Unnecessary clone
fn filter_output(input: &str) -> String {
let s = input.to_string(); // Pointless clone
s.lines().filter(|l| !l.is_empty()).collect::<Vec<_>>().join("\n")
}
// ✅ Work with &str
fn filter_output(input: &str) -> String {
input.lines().filter(|l| !l.is_empty()).collect::<Vec<_>>().join("\n")
}7. Use if let for single-variant match
// ❌ Full match for one variant
match output {
Ok(s) => process(&s),
Err(_) => {},
}
// ✅ if let (but still handle errors in RTK — don't silently drop)
if let Ok(s) = output {
process(&s);
}
// Note: in RTK filters, always handle Err with eprintln! + fallbackRTK-Specific Checks
Run these after simplification:
# Verify no regressions
cargo fmt --all && cargo clippy --all-targets && cargo test
# Verify no new regex in functions
grep -n "Regex::new" src/<file>.rs
# Fixed, reused patterns should be in `LazyLock<Regex>` statics
# Verify no new unwrap in production
grep -n "\.unwrap()" src/<file>.rs
# Should only appear inside #[cfg(test)] blocksWhat NOT to Simplify
static RE: LazyLock<Regex> = LazyLock::new(|| Regex::new(...).unwrap());— the.unwrap()here is acceptable, it's init-time.context("description")?chains — verbose but required- The fallback match arm
Err(e) => { eprintln!(...); raw_output }— looks redundant but is the safety net std::process::exit(code)at end of run() — looks like it could beOk(())but it isn't
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.

