Text tutorial: Save Kanban from installation to reading by giving Claude Code and Codex save tokens with RTK图文教程:用 RTK 给 Claude Code 与 Codex 省 token,从安装到读懂节省看板
Many people think that saving money depends on replacing a smaller model. In fact, a more effective step is not to feed the noise to the model first. This tutorial will guide you to load RTK into the AI programming assistant: do a global initialization first, then verify whether the hook is effective, then open the save Kanban board to compare before and after, and finally explain which cases it can not help, to avoid the effect of misjudgment.
很多人以为省钱要靠换更小的模型,其实更有效的一步是先别把噪声喂给模型。这篇教程带你把 RTK 装进 AI 编程助手:先做一次全局初始化,再验证钩子是否生效,然后打开节省看板对照前后来看,最后讲清楚哪些情况下它帮不上忙,避免误判效果。

Step 1: Install RTK第一步:安装 RTK
The most convenient way for Windows users is to install with winget. After a command is installed, the path is also easily configured without manually changing the environment variables.
macOS users install with Homebrew; Linux and macOS can also use the official install script, which will load the executable file into the bin in the user directory.
Users who have installed the Rust toolchain can choose to compile and install it from the source code, and the source code package accompanying this tutorial can be used directly.
After installing the executable version command and the save Kanban command once: you can see the version number, you can see the Kanban, and the instructions are correct.
If the Kanban reports an error, it is most likely to be loaded into another project of the same name on crates.io, and you can reload it by installing it from the source code.
Windows 用户最省事的方式是用 winget 安装,一条命令装完,PATH 也顺手配好,不用手动改环境变量。
macOS 用户用 Homebrew 安装;Linux 与 macOS 也可以用官方 install 脚本,脚本会把可执行文件装到用户目录下的 bin 里。
已装 Rust 工具链的用户可以选择从源码编译安装,本教程配套的源码包可直接解开使用。
装完执行版本命令与节省看板命令各一次:能看到版本号、能看到看板,说明装对了。
如果看板报错,大概率是装到了 crates.io 上同名的另一个项目,改用从源码安装的方式重装即可。

Step 2: Initialize your AI tool第二步:为你的 AI 工具做初始化
Execute the global initialization command. By default, it is oriented to Claude Code and Copilot.
Use the Gemini CLI to add the corresponding parameters, and use Codex to add codex parameters. Cursor and Windsurf also have their own agent parameters.
Initialization writes the hook configuration and automatically overwrites commands such as git status with the RTK prefix.
Once completed, restart the AI tool once for the new hook configuration to take effect.
执行全局初始化命令,默认面向 Claude Code 与 Copilot。
用 Gemini CLI 就加对应参数,用 Codex 加 codex 参数,Cursor 与 Windsurf 也有各自的 agent 参数。
初始化会写入钩子配置,把 git status 一类的命令自动改写成带 RTK 前缀的形式。
完成后把 AI 工具重启一次,让新的钩子配置生效。
Step 3: Verify that it really works第三步:验证是否真的生效
Have it execute git status once in the AI assistant to see if the returned output has changed to a compact statistical format.
Let it run the test command again to see if only the failed use cases are retained and the passed folds are counted.
If the output is still in the original long format, check that the hook configuration file was written successfully and that the AI tool has finished restarting.
Note that the built-in file reading class tool does not pass through the shell hook, and this part of the command will not be automatically overwritten.
在 AI 助手里让它执行一次 git status,观察返回输出是否已经变成紧凑统计格式。
再让它跑一次测试命令,看是否只保留失败用例、通过的折叠成计数。
如果输出还是原来的长格式,检查钩子配置文件是否写入成功,以及 AI 工具是否已完成重启。
注意内置的文件读取类工具不经过 shell 钩子,这部分命令不会被自动改写。
Step 4: Read the Save Kanban第四步:读懂节省看板
The Kanban board displays the cumulative number of processed commands and the compression ratio, which can be used to quickly determine which commands are most profitable.
The official compression ratio is "reduced bash output", which is not equal to the same percentage of bill drop. The input token also contains system prompts and conversation history, and the output token is completely unaffected.
The number reported by the tool is estimated by the number of bytes divided by four, and there is no built-in word breaker; the proportion is credible, and the absolute number of tokens is only approximate.
If you want to squeeze further, you can fix the commands commonly used by the model into rtk prefix writing, and go directly to the compression channel without relying on hooks to rewrite.
看板会显示累计处理过的命令数与压缩比例,用它可以快速判断哪些命令收益最大。
官方给出的压缩比例是「减少的 bash 输出量」,不等于账单下降同样的比例;输入 token 还包含系统提示与对话历史,输出 token 完全不受影响。
工具报告的数字按字节数除以四估算,不内置分词器;比例可信,绝对 token 数只是近似。
想进一步压榨,可以把模型常用的命令固定成 rtk 前缀写法,直接走压缩通道,不必依赖钩子改写。

Step 5: Make the most of your savings第五步:把节省效果用好
The four categories that are most worth compressing on a daily basis are testing, building, Docker logs, and git diff, which have the largest output of a single command.
If multiple people in the team share the same repository, you can submit the configuration of RTK together to the repository, so that everyone's AI assistant uses the same set of compression rules.
Compression will discard some details. If you suspect that the information is truncated when troubleshooting difficult bugs, you can temporarily run a comparison with the original command.
日常最值得压缩的是测试、构建、Docker 日志与 git diff 这四类,它们单条命令的输出量最大。
如果团队里多人共用同一个仓库,可以把 RTK 的配置一起提交进版本库,让所有人的 AI 助手都用同一套压缩规则。
压缩会丢弃部分细节,排查疑难 bug 时若怀疑信息被裁掉,临时用原始命令跑一次对照即可。
Use reminder使用提醒
The accompanying resource for this tutorial is the RTK complete source code package, see the "AI Tools" section of this site. The tool will override the shell command execution path. It is recommended to try it on non-core projects first. The compressed output may lose the details needed for troubleshooting. If you encounter problems, please review with the original command. This article is compiled from self-disclosure materials. The resources are for learning and communication only. Please follow the project Apache-2.0 license.
本教程配套资源为 RTK 完整源码包,见本站「AI工具」栏目。工具会改写 shell 命令执行路径,建议先在非核心项目试用;压缩后的输出可能丢失排查所需的细节,遇到疑难问题请用原始命令复核。本文整理自公开资料,资源仅供学习交流,请遵循项目 Apache-2.0 许可。
⬇ Download · 点击下载:RTK 完整源码包(default 分支快照)(约 1.9 MB)
教程配套资源,来自 GitHub 开源仓库 rtk-ai/rtk 默认分支源码(Apache-2.0 许可),可用 cargo install --git 编译,也可改用官方 brew / winget / 预编译二进制安装
阅读与点赞数据保存在你的浏览器本地,欢迎留下你的想法。
今日正能量学一点,用一点;今天种下的种子,会长成明天的能力。去免费下载专区 →广告
评论 文明发言,让讨论更有价值