Repository Analysis

rtk-ai/rtk

CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies

9.2 Low AI signal View on GitHub
9.2
Adjusted Score
9.2
Raw Score
100%
Time Factor
2026-05-29
Last Push
56,392
Stars
Rust
Language
100,615
Lines of Code
323
Files
364
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 1HIGH 1MEDIUM 255LOW 107

Pattern Findings

364 matches across 13 categories. Click a row to expand file-level details.

Decorative Section Separators254 hits · 794 pts
SeverityFileLineSnippet
MEDIUMscripts/test-all.sh229# ── 7. Curl ──────────────────────────────────────────
MEDIUMscripts/test-all.sh237# ── 8. Npm / Npx ────────────────────────────────────
MEDIUMscripts/test-all.sh244# ── 9. Pnpm ─────────────────────────────────────────
MEDIUMscripts/test-all.sh289# ── 13. Deps ─────────────────────────────────────────
MEDIUMscripts/test-all.sh296# ── 14. Env ──────────────────────────────────────────
MEDIUMscripts/test-all.sh303# ── 16. Log ──────────────────────────────────────────
MEDIUMscripts/test-all.sh317# ── 17. Summary ──────────────────────────────────────
MEDIUMscripts/test-all.sh323# ── 18. Err ──────────────────────────────────────────
MEDIUMscripts/test-all.sh329# ── 19. Test runner ──────────────────────────────────
MEDIUMscripts/test-all.sh335# ── 20. Gain ─────────────────────────────────────────
MEDIUMscripts/test-all.sh342# ── 21. Config & Init ────────────────────────────────
MEDIUMscripts/test-all.sh349# ── 22. Wget ─────────────────────────────────────────
MEDIUMscripts/test-all.sh369# ── 24. Prisma ───────────────────────────────────────
MEDIUMscripts/test-all.sh375# ── 25. Vitest ───────────────────────────────────────
MEDIUMscripts/test-all.sh381# ── 26. Docker / Kubectl (help only) ────────────────
MEDIUMscripts/test-all.sh388# ── 27. Python (conditional) ────────────────────────
MEDIUMscripts/test-all.sh462# ── 31. Global flags ────────────────────────────────
MEDIUMscripts/test-all.sh469# ── 32. CcEconomics ─────────────────────────────────
MEDIUMscripts/test-all.sh475# ── 33. Learn ───────────────────────────────────────
MEDIUMscripts/test-all.sh482# ── 32. Rewrite ───────────────────────────────────────
MEDIUMscripts/test-all.sh507# ── 33. Verify ────────────────────────────────────────
MEDIUMscripts/test-all.sh513# ── 34. Proxy ─────────────────────────────────────────
MEDIUMscripts/test-all.sh520# ── 35. Discover ──────────────────────────────────────
MEDIUMscripts/test-all.sh526# ── 36. Diff ──────────────────────────────────────────
MEDIUMscripts/test-all.sh532# ── 37. Wc ────────────────────────────────────────────
MEDIUMscripts/test-all.sh538# ── 38. Smart ─────────────────────────────────────────
MEDIUMscripts/test-all.sh544# ── 39. Json edge cases ──────────────────────────────
MEDIUMscripts/test-all.sh550# ── 40. Docker (conditional) ─────────────────────────
MEDIUMscripts/test-all.sh561# ── 41. Hook check ───────────────────────────────────
MEDIUMscripts/test-all.sh567# ══════════════════════════════════════════════════════
MEDIUMscripts/test-all.sh569# ══════════════════════════════════════════════════════
MEDIUMscripts/test-all.sh22# ── Helpers ──────────────────────────────────────────
MEDIUMscripts/test-all.sh101# ── Preamble ─────────────────────────────────────────
MEDIUMscripts/test-all.sh122# ── 1. Version & Help ───────────────────────────────
MEDIUMscripts/test-all.sh129# ── 2. Ls ────────────────────────────────────────────
MEDIUMscripts/test-all.sh143# ── 2b. Tree ─────────────────────────────────────────
MEDIUMscripts/test-all.sh156# ── 3. Read ──────────────────────────────────────────
MEDIUMscripts/test-all.sh170# ── 4. Git ───────────────────────────────────────────
MEDIUMscripts/test-all.sh196# ── 5. GitHub CLI ────────────────────────────────────
MEDIUMscripts/test-all.sh210# ── 6. Cargo ─────────────────────────────────────────
MEDIUMscripts/test-all.sh256# ── 10. Grep ─────────────────────────────────────────
MEDIUMscripts/test-all.sh269# ── 11. Find ─────────────────────────────────────────
MEDIUMscripts/test-all.sh276# ── 12. Json ─────────────────────────────────────────
MEDIUMscripts/test-all.sh410# ── 28. Go (conditional) ────────────────────────────
MEDIUMscripts/test-all.sh429# ── 29. Graphite (conditional) ─────────────────────
MEDIUMscripts/test-all.sh440# ── 30. Ruby (conditional) ──────────────────────────
MEDIUMscripts/test-ruby.sh128# ── Preamble ─────────────────────────────────────────
MEDIUMscripts/test-ruby.sh137# ── Temp dir + cleanup trap ──────────────────────────
MEDIUMscripts/test-ruby.sh144# ── Setup phase (not counted in assertions) ──────────
MEDIUMscripts/test-ruby.sh264# ══════════════════════════════════════════════════════
MEDIUMscripts/test-ruby.sh266# ══════════════════════════════════════════════════════
MEDIUMscripts/test-ruby.sh268# ── 1. RSpec ─────────────────────────────────────────
MEDIUMscripts/test-ruby.sh363# ── 8. RSpec pending ─────────────────────────────────
MEDIUMscripts/test-ruby.sh371# ── 9. RSpec text fallback ───────────────────────────
MEDIUMscripts/test-ruby.sh379# ── 10. RSpec empty suite ────────────────────────────
MEDIUMscripts/test-ruby.sh387# ── 11. Token savings ────────────────────────────────
MEDIUMscripts/test-ruby.sh439# ── 12. Verbose flag ─────────────────────────────────
MEDIUMscripts/test-ruby.sh447# ══════════════════════════════════════════════════════
MEDIUMscripts/test-ruby.sh449# ══════════════════════════════════════════════════════
MEDIUMscripts/test-ruby.sh24# ── Helpers ──────────────────────────────────────────
194 more matches not shown…
Over-Commented Block74 hits · 72 pts
SeverityFileLineSnippet
LOW.claude/hooks/rtk-rewrite.sh1#!/usr/bin/env bash
LOW.claude/skills/performance/SKILL.md61ls -lh target/release/rtk | tee /tmp/after_binary_size.txt
LOW.rtk/filters.toml1# Project-local RTK filters — commit this file with your repo.
LOWhooks/copilot/test-rtk-rewrite.sh1#!/usr/bin/env bash
LOWhooks/claude/rtk-rewrite.sh1#!/usr/bin/env bash
LOWhooks/pi/rtk.ts1// RTK Pi extension — rewrites bash commands to use rtk for token savings.
LOWsrc/main.rs101 level: core::filter::FilterLevel,
LOWsrc/main.rs301 },
LOWsrc/main.rs361 #[arg(long = "auto-patch", group = "patch")]
LOWsrc/main.rs401 },
LOWsrc/main.rs421 #[arg(short, long)]
LOWsrc/main.rs441 /// Skip confirmation prompt when resetting
LOWsrc/main.rs561 /// Discover missed RTK savings from Claude Code history
LOWsrc/main.rs601 #[arg(short, long, default_value = "text")]
LOWsrc/main.rs741 HookAudit {
LOWsrc/main.rs881 /// Show outdated packages (condensed: "pkg: old → new")
LOWsrc/main.rs1041 /// Additional cargo test arguments
LOWsrc/discover/registry.rs461
LOWsrc/core/toml_filter.rs1//! Applies TOML-defined filter rules to command output.
LOWsrc/core/toml_filter.rs21/// 5. truncate_lines_at — truncate each line to N chars
LOWsrc/core/toml_filter.rs421) -> Option<&'a CompiledFilter> {
LOWsrc/core/config.rs21 pub hooks: HooksConfig,
LOWsrc/core/config.rs41 /// command — e.g. `docker exec mycontainer`, `direnv exec .`, `poetry run`,
LOWsrc/core/tracking.rs1//! Token savings tracking and analytics system.
LOWsrc/core/tracking.rs21//! let output = "filtered output";
LOWsrc/core/tracking.rs61 }
LOWsrc/core/tracking.rs81/// ```no_run
LOWsrc/core/tracking.rs101 pub timestamp: DateTime<Utc>,
LOWsrc/core/tracking.rs121 pub total_output: usize,
LOWsrc/core/tracking.rs141///
LOWsrc/core/tracking.rs161 pub input_tokens: usize,
LOWsrc/core/tracking.rs201///
LOWsrc/core/tracking.rs221}
LOWsrc/core/tracking.rs381 ///
LOWsrc/core/tracking.rs541 })
LOWsrc/core/tracking.rs681 result.reverse();
LOWsrc/core/tracking.rs761 /// Weeks start on Sunday (SQLite default). Results ordered chronologically.
LOWsrc/core/tracking.rs841 /// use rtk::tracking::Tracker;
LOWsrc/core/tracking.rs901 let mut result: Vec<_> = rows.collect::<Result<Vec<_>, _>>()?;
LOWsrc/core/tracking.rs1261 let _ = tracker.record_parse_failure(raw_command, error_message, succeeded);
LOWsrc/core/tracking.rs1281/// assert_eq!(estimate_tokens("abcde"), 2); // 5 chars = ceil(1.25) = 2
LOWsrc/core/tracking.rs1301/// let input = execute_standard_command()?;
LOWsrc/core/tracking.rs1321 ///
LOWsrc/core/tracking.rs1341 /// - `original_cmd`: Standard command (e.g., "ls -la")
LOWsrc/core/tracking.rs1381 /// - `rtk_cmd`: RTK command used (e.g., "rtk git tag --list")
LOWsrc/core/tracking.rs1401/// Format OsString args for tracking display.
LOWsrc/core/utils.rs1//! Utility functions for text processing and command execution.
LOWsrc/core/utils.rs41///
LOWsrc/core/utils.rs61/// # Returns
LOWsrc/core/utils.rs81 } else if n >= 1_000 {
LOWsrc/core/utils.rs121/// Formatted string like "$3.86/MTok"
LOWsrc/core/utils.rs141/// ```
LOWsrc/core/utils.rs161/// assert_eq!(truncate_iso_date("2024-01-15"), "2024-01-15");
LOWsrc/core/utils.rs301 let mut c = resolved_command("npx");
LOWsrc/core/utils.rs321/// Full path to the resolved binary, or error if not found.
LOWsrc/cmds/system/ls.rs181
LOWsrc/cmds/system/ls.rs221 if special > 0 {
LOWsrc/cmds/system/grep_cmd.rs161}
LOWsrc/cmds/ruby/rake_cmd.rs1//! Minitest output filter for `rake test` and `rails test`.
LOWsrc/cmds/ruby/rake_cmd.rs81 #[allow(dead_code)]
14 more matches not shown…
Hyper-Verbose Identifiers18 hits · 20 pts
SeverityFileLineSnippet
LOWhooks/hermes/tests/test_rtk_rewrite_plugin.py74 def test_missing_rtk_skips_registering_pre_tool_call(self):
LOWhooks/hermes/tests/test_rtk_rewrite_plugin.py90 def test_missing_rtk_warns_only_once(self):
LOWhooks/hermes/tests/test_rtk_rewrite_plugin.py105 def test_check_rtk_found_is_quiet(self):
LOWhooks/hermes/tests/test_rtk_rewrite_plugin.py116 def test_check_rtk_caches_result_across_calls(self):
LOWhooks/hermes/tests/test_rtk_rewrite_plugin.py127 def test_rewrite_success_mutates_same_terminal_args_dict(self):
LOWhooks/hermes/tests/test_rtk_rewrite_plugin.py140 def test_rewrite_returncode_three_mutates_same_terminal_args_dict(self):
LOWhooks/hermes/tests/test_rtk_rewrite_plugin.py153 def test_rewrite_returncode_zero_mutates_when_rewrite_changes_command(self):
LOWhooks/hermes/tests/test_rtk_rewrite_plugin.py166 def test_expected_passthrough_returncodes_do_not_warn_or_mutate(self):
LOWhooks/hermes/tests/test_rtk_rewrite_plugin.py187 def test_unexpected_returncode_warns_with_stderr_details(self):
LOWhooks/hermes/tests/test_rtk_rewrite_plugin.py202 def test_rewrite_timeout_warns_and_preserves_original_command(self):
LOWhooks/hermes/tests/test_rtk_rewrite_plugin.py214 def test_file_not_found_preserves_original_command(self):
LOWhooks/hermes/tests/test_rtk_rewrite_plugin.py225 def test_unexpected_exception_prints_warning_and_keeps_command(self):
LOWhooks/hermes/tests/test_rtk_rewrite_plugin.py236 def test_non_terminal_tool_is_noop(self):
LOWhooks/hermes/tests/test_rtk_rewrite_plugin.py246 def test_missing_command_is_noop(self):
LOWhooks/hermes/tests/test_rtk_rewrite_plugin.py256 def test_non_string_command_is_noop(self):
LOWhooks/hermes/tests/test_rtk_rewrite_plugin.py266 def test_empty_command_strings_are_noop(self):
LOWhooks/hermes/tests/test_rtk_rewrite_plugin.py278 def test_empty_or_unchanged_rewrite_output_preserves_original_command(self):
LOWhooks/hermes/tests/test_rtk_rewrite_plugin.py296 def test_cargo_init_installs_importable_plugin_that_rewrites_with_fake_rtk(self):
Hallucination Indicators1 hit · 10 pts
SeverityFileLineSnippet
CRITICALsrc/cmds/jvm/gradlew_cmd.rs1392 assert!(is_framework_frame("at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(Su
Magic Placeholder Names1 hit · 5 pts
SeverityFileLineSnippet
HIGHdocs/usage/TRACKING.md421 datadog.initialize(api_key="YOUR_API_KEY")
Verbosity Indicators3 hits · 4 pts
SeverityFileLineSnippet
LOWsrc/cmds/git/git.rs329 // Step 1: one-line commit summary
LOWsrc/cmds/git/git.rs342 // Step 2: --stat summary
LOWsrc/cmds/git/git.rs354 // Step 3: compacted diff
Fake / Example Data4 hits · 4 pts
SeverityFileLineSnippet
LOWsrc/cmds/ruby/rspec_cmd.rs686 Failure/Error: expect(user.full_name).to eq("John Doe")
LOWsrc/cmds/ruby/rspec_cmd.rs687 expected: "John Doe"
LOWsrc/cmds/ruby/rspec_cmd.rs860 Failure/Error: expect(user.full_name).to eq("John Doe")
LOWsrc/cmds/ruby/rspec_cmd.rs861 expected: "John Doe"
Redundant / Tautological Comments2 hits · 3 pts
SeverityFileLineSnippet
LOWscripts/rtk-economics.sh21# Check if ccusage is available
LOWscripts/rtk-economics.sh28# Check if rtk is available
AI Slop Vocabulary1 hit · 3 pts
SeverityFileLineSnippet
MEDIUMscripts/benchmark/cloud-init.yaml3# Installs all tools needed for comprehensive RTK testing (~200 commands)
Excessive Try-Catch Wrapping2 hits · 2 pts
SeverityFileLineSnippet
LOWhooks/hermes/rtk-rewrite/__init__.py74 except Exception as e:
LOWscripts/benchmark-sessions/lib/runner.py32 except Exception:
Deep Nesting2 hits · 2 pts
SeverityFileLineSnippet
LOWhooks/hermes/rtk-rewrite/__init__.py40
LOWhooks/hermes/tests/test_rtk_rewrite_plugin.py166
Example Usage Blocks1 hit · 2 pts
SeverityFileLineSnippet
LOWscripts/check-test-presence.sh6# Usage:
Unused Imports1 hit · 1 pts
SeverityFileLineSnippet
LOWscripts/benchmark-sessions/lib/runner.py1