This is an early release preview. You may encounter bugs.
Rtk logo
Unclaimed

Tool inference

Rtk

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

A 86/100 GitHub score ? This grade is derived from GitHub signals, not user votes. Open for the full breakdown.
Discussion

01 / Summary

About Rtk.

RTK is a command-line proxy that intercepts the shell commands a coding agent runs and compresses their output before the agent reads it. It is a single Rust binary with filters for more than 100 commands and under 10 ms of overhead. Per command type it applies four strategies: filtering out noise such as comments, whitespace and boilerplate, grouping similar items (files by directory, errors by type), truncating redundant context, and collapsing repeated log lines into counts.

The reduction is in bash output, which the project puts at up to 90%. That output is one contributor to input tokens alongside the prompt, system prompt and conversation history, and input tokens are only part of the bill, so the saving dilutes at each step. Reported token counts are estimated as bytes divided by four: RTK ships no tokenizer, so percentages are reliable and absolute numbers are approximate. Filtering happens once per command and the result enters history normally, so prompt caching is unaffected.

The main mode of use is an auto-rewrite hook: in hook-based agents a Bash call such as git status is rewritten to its rtk equivalent before execution, and plugin-based agents such as Hermes rewrite through their plugin API, so the agent receives compact output without calling rtk itself. The hook applies only to Bash tool calls. Built-in tools like Read, Grep and Glob in Claude Code bypass it, so RTK's read, grep and find commands cover those workflows when called directly. Integrations exist for 18 coding tools, including Claude Code, GitHub Copilot, Cursor, Gemini CLI, Codex, Windsurf, Cline and Roo Code, OpenCode, OpenClaw, Pi and Oh My Pi, Hermes, Mistral Vibe, Kilo Code, Google Antigravity, Kimi AI, Factory Droid and Trae, through native hooks, plugins or project rule files depending on what each agent supports.

When a command fails, the full unfiltered output is saved so the agent can recall it without re-running the command. A gain command reports savings, history, daily breakdowns and a JSON export, discover finds commands that are not yet routed through RTK, and session reports adoption across recent sessions. Anonymous, aggregate telemetry is off by default and requires explicit opt-in.

Operation What RTK does to the output
ls / tree Tree format with file counts instead of one line per entry
cat / read Signatures and structure over full bodies
grep / rg Truncates long lines, groups matches by file
git status Compact stat format, grouped by state
git diff Reduced context, headers stripped
git log Hash, author and subject only
git add/commit/push Confirmation line instead of full progress output
cargo test / npm test Failures only, passing tests collapsed to a count
pytest Failures only, traceback trimmed
go test NDJSON parsed, failures only
docker ps Essential fields only
  • Auto-rewrite hook: Bash tool calls are rewritten to rtk equivalents before execution, so every conversation and subagent gets compact output with no per-command context overhead
  • 18 agent integrations: Claude Code, GitHub Copilot, Cursor, Gemini CLI, Codex, Windsurf, Cline and Roo Code, OpenCode, OpenClaw, Pi, Oh My Pi, Hermes, Mistral Vibe, Kilo Code, Antigravity, Kimi AI, Factory Droid and Trae
  • Files and search: compact directory trees, smart file reading with a signatures-only level, a two-line heuristic code summary, grouped grep results and condensed diffs
  • Git and GitHub CLI: compact status, one-line logs, condensed diffs, single-line confirmations for add, commit, push and pull, and compact PR, issue and workflow-run listings
  • Test runners: failures-only output for Jest, Vitest, Playwright, pytest, PHP .phpt, Go, Cargo, minitest, RSpec, Bun and Deno, plus generic err and test wrappers for any command
  • Build and lint: grouped output for ESLint and Biome, sqlfluff, tsc, Next.js builds, Prettier, Cargo build and clippy, ruff, golangci-lint, RuboCop, Maven Daemon and sbt
  • Package managers and runtimes: pnpm, uv, pip, Bundler, Prisma, Bun and Deno with progress and version noise stripped
  • Cloud, containers and IaC: compact AWS CLI output with secrets stripped, Docker, Compose, kubectl and OpenShift listings with deduplicated logs, and Pulumi preview, up, destroy and refresh
  • Full-output recall: on failure or truncation the unfiltered output is stored (SQLite by default) and referenced by an id the agent can recall without re-executing
  • Savings analytics: gain, discover and session commands report estimated tokens saved, missed opportunities and adoption, with an ASCII graph and JSON export
  • Direct execution modes: run, err, test and summary preserve argument boundaries without shell expansion, with an explicit shell flag when a command needs shell syntax
  • Opt-in telemetry: anonymous aggregate metrics only after explicit consent, with status, disable and forget commands

02 / Discussion CREDIBILITY-GATED

Discussion

Reading is open to everyone. Posting and voting need a verified identity or a GitHub grade of B or higher.

  • No discussions yet.

04 / Build

Build with Rtk.

Browse the catalog for frameworks, tools, and harnesses, each scored on real GitHub credibility.

Get Rtk →

Browse the catalog