Skip to content

RTK

你的 AI 代理正淹没在噪音中。
RTK 帮它清理。

RTK Pro:团队的 AI 控制层

干净的上下文。
更强的代理。

开源 · Apache 2.0 · Rust

示意图:密集的 token 网格占满 AI 上下文窗口的 86%,接近自动压缩。它流经 RTK 过滤器,滤除 CLI 输出噪音并保留有意义的内容:同一窗口回落到 73% 占用,留出思考空间。

1.6M+
下载量
82.9K+
GitHub 星标
140K+
开发者
125+
命令
17
AI 编程工具

这些公司的开发者已 star

  • Microsoft
  • Google
  • Amazon
  • Meta
  • Apple
  • NVIDIA
  • IBM
  • Tencent
  • ByteDance
  • Alibaba
  • Shopify
  • Datadog
  • SAP
  • Adobe
  • Intel
  • Samsung
  • Bosch
  • Cisco

另有 1,100 家公司

01 / 问题所在

你的上下文窗口很宝贵

AI 代理不需要更多输出,而是需要更相关的输出。

图表:会话后期的 Claude Code 上下文窗口()已用 86%,接近自动压缩。固定开销很小(系统提示与工具 3%、MCP 工具 1%、记忆文件 1%、Skills 0.5%);真正占满窗口的是对话历史 62% 和 CLI 输出与日志 18%。经 RTK 过滤后,CLI 部分降至 5%,总占用降至 73%。

02 / 解决方案

装上就忘掉它

RTK 是一层轻薄的开放代理。它不会给你的工作流增加任何东西()只是把噪音拿走。

为开发者而生

语言 Rust
许可证 Apache 2.0
架构 CLI 钩子与代理
开销 < 20 ms
命令 125+
遥测 需选择加入,不含个人数据

03 / 实际效果

差异一目了然

对比 RTK 前后的真实输出,看看什么被过滤了。

为什么这些被移除?
已归并 重复输出被合并为计数和摘要。
已过滤 低价值的模板内容和进度噪音被移除。
已保留 失败、警告以及任何与推理相关的内容都会保留。
不用 RTK 1,042 行
$ cargo build
   Compiling libc v0.2.155
   Compiling proc-macro2 v1.0.85
   Compiling unicode-ident v1.0.12
   Compiling quote v1.0.36
   Compiling syn v2.0.66
   Compiling cfg-if v1.0.0
   Compiling once_cell v1.19.0
warning: unused variable: `raw`
  --> src/filter.rs:214:9
warning: field is never read: `depth`
  --> src/tree.rs:87:5
   Compiling serde v1.0.197
   Compiling anyhow v1.0.79
⋮ 1,026 more lines
    Finished dev [unoptimized] in 32.48s
使用 RTK 4 行
$ rtk cargo build
✓ build finished in 32.4s
· 214 crates compiled
· 2 warnings: filter.rs:214, tree.rs:87
不用 RTK 1,842 行
$ cargo test
running 184 tests
test filter::tests::collapses_dupes ... ok
test filter::tests::keeps_failures ... ok
test parse::tests::ansi_codes ... ok
test parse::tests::empty_input ... ok
test tree::tests::depth_limit ... ok
test gain::tests::daily_rollup ... ok
test proxy::tests::passthrough ... ok
test proxy::tests::exit_codes ... ok
test git::tests::short_status ... ok
test git::tests::diff_stat ... ok
⋮ 1,829 more lines
test result: ok. 184 passed; 0 failed
使用 RTK 3 行
$ rtk cargo test
✓ 184 passed · 0 failed · 3 ignored
· finished in 3.2s
不用 RTK 38 行
$ git status
On branch feat/filter-v2
Your branch is ahead of 'origin/feat/filter-v2'
  by 3 commits.
  (use "git push" to publish your commits)

Changes not staged for commit:
  (use "git add <file>..." to update)
  (use "git restore <file>..." to discard)
        modified:   src/filter.rs
        modified:   src/proxy.rs

Untracked files:
  (use "git add <file>..." to include)
        tests/fixtures/big_output.log
⋮ 21 more lines
使用 RTK 5 行
$ rtk git status
feat/filter-v2 ↑3
M src/filter.rs
M src/proxy.rs
? tests/fixtures/big_output.log
不用 RTK 312 行
$ find . -name "*.rs"
./src/main.rs
./src/filter.rs
./src/proxy.rs
./src/commands/git.rs
./src/commands/test.rs
./src/commands/grep.rs
./target/debug/build/libc-8f00…/out/lib.rs
./target/debug/build/serde-71ab…/out/de.rs
./target/debug/build/syn-90c1…/out/gen.rs
⋮ 303 more lines
使用 RTK 3 行
$ rtk find "*.rs" .
29 matches (target/ excluded)
src/ 14 · commands/ 9 · tests/ 6

04 / 实测证据

衡量你的 rtk 收益

来自开发者日常使用的真实 rtk gain 输出。

rtk gain 仪表板显示 88.9% 效率
88.9% 效率

日常使用几周后:处理 15,720 条命令,节省 1.30 亿 token。

rtk gain 的每日与每周明细
按命令统计

按命令查看每日、每周和每月统计。运行 rtk gain 查看你的数据。

在 Discord 的 #show-your-gains 频道查看其他开发者的节省数据

05 / 带来的改变

更高的效率

更少噪音。更有用的上下文。更少 token。

更少噪音

更干净的上下文窗口。

更好的推理

更相关的信息抵达代理。

更少 token

更少无用输出进入上下文。

兼容你的 AI 编程工具链

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Codex
  • Gemini CLI
  • Windsurf
  • Cline
  • OpenCode

06 / 开始使用

30 秒即可运行

安装、激活钩子,之后每条命令都会被自动压缩。

快速安装

适用于 Linux 与 macOS 的一行命令。

$ curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh

Homebrew

macOS 与 Linux。

$ brew install rtk-ai/tap/rtk
$ brew upgrade rtk-ai/tap/rtk

预编译二进制

macOS、Linux、Windows。

从 Releases 下载

然后激活自动重写钩子

$ rtk init --global

在 Claude Code 的 settings.json 中安装 PreToolUse 钩子()每次 Bash 调用都会被自动重写。

完整安装指南 →

常见问题

高频提问

What is RTK (Rust Token Killer)?

RTK is an open-source CLI tool that compresses command outputs before they reach the AI context window. It cuts up to 90% of that output noise with zero configuration changes, which leaves more of the context window for reasoning and lowers the token cost of every command that runs. RTK is written in Rust, Apache 2.0 licensed, and works transparently with Claude Code, Cursor, and any terminal-based AI assistant.

How many tokens does RTK actually save?

On the commands RTK rewrites, output drops by 56% on average, and by up to 90% on the noisiest ones. Across the community that adds up to billions of tokens saved. The exact figure depends on the command, so the benchmarks page publishes the methodology and the per-command results, and the blog covers what independent studies measured, including the cases where RTK did not come out ahead. For your own numbers, run rtk gain after a few days of use.

Is RTK free? Are there usage limits?

RTK is completely free. It is open source under the Apache 2.0 license, with source code available on GitHub at github.com/rtk-ai/rtk. There are no usage limits, no API keys required and no accounts. Telemetry is opt-in: it is off until you explicitly enable it, and it collects no personal data. For teams, RTK Pro is available at pro.rtk-ai.app.

Which AI coding tools and commands does RTK support?

RTK works with Claude Code (Anthropic), Cursor, Gemini CLI, Aider, and any AI assistant that reads terminal output. It supports all major CLI commands: cargo test, pytest, go test, git diff, git status, git log, grep, find, ls, pnpm list, tsc, eslint, prisma, docker, kubectl, and more.

How does RTK work without changing my workflow?

Running rtk init --global installs a PreToolUse hook in Claude Code that automatically rewrites Bash commands to rtk equivalents at the proxy layer. You continue using your normal commands. RTK intercepts and compresses the output before it enters the context window, with no manual changes to prompts or workflows needed.

Does RTK affect code quality or AI reasoning accuracy?

No. RTK removes verbose boilerplate and repetitive output noise, not meaningful content. Test failures, error messages, diffs, and stack traces are preserved in full. The AI receives the same essential information with far less noise around it, which leaves more of the context window for reasoning.

给你的代理
留出思考空间

安装 RTK,让噪音远离你的上下文。

分享 RTK

RTK Pro

为你的团队打造的 AI 控制层

RTK 运行在每位开发者的机器上。RTK Pro 把这些机器连成统一的控制层,用成本分析、安全护栏与治理让整个团队一次就位。

  • 可观测性

    覆盖整个团队的详细分析:按项目和开发者查看用量与成本。看清真正的开销,并定义真实的 token 效率指标。

  • 安全

    每一位接入的开发者都在护栏之后工作:阻止密钥泄露,拦截危险操作,对敏感数据做匿名化。

  • 治理

    细粒度 RBAC、ACL 与项目管理。新成员只需连接一次即可全部就位:压缩、护栏、可观测性、skills、MCP。

了解 RTK Pro

CLI 始终保持免费与开源。