{"id":872,"date":"2026-08-17T10:42:24","date_gmt":"2026-08-17T02:42:24","guid":{"rendered":"http:\/\/www.tantan.ink\/index.php\/2026\/08\/17\/%e5%a3%b0%e7%a7%b0%e7%9c%81-90-token-%e7%9a%84-cli%ef%bc%8c%e8%b4%a6%e5%8d%95%e4%b8%ba%e4%bb%80%e4%b9%88%e6%b2%a1%e9%99%8d\/"},"modified":"2026-08-17T10:45:23","modified_gmt":"2026-08-17T02:45:23","slug":"%e5%a3%b0%e7%a7%b0%e7%9c%81-90-token-%e7%9a%84-cli%ef%bc%8c%e8%b4%a6%e5%8d%95%e4%b8%ba%e4%bb%80%e4%b9%88%e6%b2%a1%e9%99%8d","status":"publish","type":"post","link":"https:\/\/www.tantan.ink\/index.php\/2026\/08\/17\/%e5%a3%b0%e7%a7%b0%e7%9c%81-90-token-%e7%9a%84-cli%ef%bc%8c%e8%b4%a6%e5%8d%95%e4%b8%ba%e4%bb%80%e4%b9%88%e6%b2%a1%e9%99%8d\/","title":{"rendered":"\u58f0\u79f0\u7701 90% token \u7684 CLI\uff0c\u8d26\u5355\u4e3a\u4ec0\u4e48\u6ca1\u964d"},"content":{"rendered":"<p>RTK\uff08Rust Token Killer\uff09\u6700\u8fd1\u5728 GitHub \u4e0a\u4e86 7 \u4e07\u661f\u3002\u505a\u4e86\u4e00\u4ef6\u5f88\u7b80\u5355\u7684\u4e8b\uff1a\u5728\u7ec8\u7aef\u8f93\u51fa\u8fdb\u5165 AI \u7f16\u7801 Agent \u4e4b\u524d\u5148\u538b\u4e00\u9053\u3002git status\u3001cargo test\u3001pytest \u8fd9\u4e9b\u547d\u4ee4\u52a8\u8f84\u51e0\u767e\u4e0a\u5343\u884c\uff0cRTK \u53ea\u7559\u4e0b\u6709\u7528\u7684\u90e8\u5206\u3002`brew install rtk` \u88c5\u5b8c\uff0c`rtk init -g` \u4e00\u6761\u547d\u4ee4\u914d\u597d hook\uff0c\u4e4b\u540e Claude Code \u8dd1\u7684\u6240\u6709 bash \u547d\u4ee4\u90fd\u4f1a\u81ea\u52a8\u8d70 RTK \u538b\u7f29\uff0cAgent \u5b8c\u5168\u65e0\u611f\u3002<\/p>\n<p>\u4e0d\u53ea\u662f Claude Code\uff0c\u652f\u6301\u7684 Agent \u6709 16 \u4e2a\uff1a<\/p>\n<ul>\n<li>Claude Code\uff08PreToolUse hook \u900f\u660e\u91cd\u5199\uff09<\/li>\n<li>Cursor \/ Cline \/ Windsurf\uff08\u9879\u76ee\u7ea7\u89c4\u5219\u6587\u4ef6\uff09<\/li>\n<li>GitHub Copilot\uff08VS Code + CLI\uff09<\/li>\n<li>Codex\uff08AGENTS.md \u6307\u4ee4\uff09<\/li>\n<li>Gemini CLI \/ Kimi \/ Antigravity \/ Hermes \u7b49<\/li>\n<\/ul>\n<p>\u8986\u76d6\u7684\u547d\u4ee4\u8d85\u8fc7 100 \u4e2a\uff0c\u4ece git\u3001cargo\u3001npm \u5230 docker\u3001kubectl\u3001aws \u90fd\u6709\u3002\u4e5f\u652f\u6301\u7528 TOML \u5199\u81ea\u5b9a\u4e49\u8fc7\u6ee4\u5668\uff0c\u4e0d\u7528\u5199 Rust\u3002<\/p>\n<p>\u538b\u5b8c\u4e4b\u540e\u6548\u679c\u786e\u5b9e\u5938\u5f20\u3002git log \u538b\u7f29 92%\uff0cvitest \u538b\u7f29 99% \u4ee5\u4e0a\uff0ccargo test \u5e73\u5747 89%\u3002\u4e00\u4e2a\u8dd1 262 \u4e2a\u6d4b\u8bd5\u7684 cargo test\uff0c\u539f\u59cb\u8f93\u51fa 4823 token\uff0c\u538b\u5b8c\u5269 11 \u4e2a\u3002\u6d4b\u8bd5\u5168\u8fc7\u7684\u65f6\u5019\u53ea\u7559\u4e00\u884c\u8ba1\u6570\uff0c\u5931\u8d25\u9879\u624d\u5c55\u5f00 traceback\u2014\u2014\u8ddf\u4eba\u8bfb\u8f93\u51fa\u7684\u4e60\u60ef\u4e00\u6837\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1400\" height=\"900\" class=\"wp-image-870\" src=\"https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/rtk-compression.png\" alt=\"\" srcset=\"https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/rtk-compression.png 1400w, https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/rtk-compression-300x193.png 300w, https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/rtk-compression-1024x658.png 1024w, https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/rtk-compression-768x494.png 768w\" sizes=\"auto, (max-width: 1400px) 100vw, 1400px\" \/><\/p>\n<p>\u4f46 90% \u8fd9\u4e2a\u6570\u5b57\u5bb9\u6613\u8ba9\u4eba\u4ea7\u751f\u9519\u89c9\u3002<\/p>\n<p>\u6709\u4eba\u5206\u6790\u4e86\u771f\u5b9e\u7684 Claude Code \u8d26\u5355\uff08926 \u7f8e\u5143\u90a3\u4e2a\uff09\uff0cbash \u8f93\u51fa\u53ea\u5360\u603b token \u7684 12%\uff0c\u5269\u4e0b 65% \u662f\u6587\u4ef6\u8bfb\u53d6\u3002\u5728 bash \u8f93\u51fa\u4e0a\u7701 90%\uff0c\u5bf9\u603b\u8d26\u5355\u7684\u5f71\u54cd\u5927\u7ea6\u662f 6-10%\u3002\u8fd9\u4e2a\u5dee\u8ddd\u4e0d\u5c0f\u3002<\/p>\n<p>JetBrains \u505a\u4e86\u4e2a A\/B \u6d4b\u8bd5\u3002\u4ed6\u4eec\u5728\u4f4e\u63a8\u7406\u6a21\u5f0f\u4e0b\u8dd1\u4e86\u4e00\u904d\uff0c\u7528\u4e86 RTK \u7684\u4f1a\u8bdd\u53cd\u800c\u8d35\u4e86 7.6%\uff0c\u591a\u4e86 13.8% \u7684\u8f6e\u6b21\u3002\u9ad8\u63a8\u7406\u6a21\u5f0f\u4e0b\u57fa\u672c\u6ca1\u5dee\u522b\u3002\u539f\u56e0\u4e0d\u590d\u6742\uff1a\u538b\u7f29\u540e\u7684\u8f93\u51fa\u6709\u65f6\u4fe1\u606f\u4e0d\u591f\uff0cAgent \u4f1a\u591a\u53d1\u4e00\u6b21\u5de5\u5177\u8c03\u7528\u6216\u591a\u7ed5\u4e00\u8f6e\u6765\u8865\uff0c\u53cd\u800c\u70e7\u66f4\u591a token\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"560\" class=\"wp-image-871\" src=\"https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/rtk-terminal.png\" alt=\"\" srcset=\"https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/rtk-terminal.png 900w, https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/rtk-terminal-300x187.png 300w, https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/rtk-terminal-768x478.png 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>RTK \u81ea\u5df1\u7684 README \u5012\u662f\u633a\u8bda\u5b9e\u7684\u3002\u628a\u4ee5\u524d\u4e00\u4e9b\u6ca1\u6765\u6e90\u7684\u6570\u5b57\u5220\u4e86\u2014\u201499.5% \u5b89\u88c5\u6210\u529f\u7387\u3001\u865a\u6784\u7684\u4f1a\u8bdd\u8868\u683c\u3001&#8221;\u7701 90% \u8d26\u5355&#8221;\u7684\u8868\u8ff0\u3002\u73b0\u5728\u660e\u786e\u5199\u4e86&#8221;\u7701\u7684\u662f bash \u8f93\u51fa\u5b57\u8282\u6570\uff0c\u4e0d\u662f\u603b\u8d26\u5355\u7684 90%&#8221;\u3002\u8fd8\u6709\u4e2a\u7ec6\u8282\uff1aRTK \u4e0d\u5e26 tokenizer\uff0ctoken \u6570\u9760 bytes \u9664\u4ee5 4 \u4f30\u7b97\uff0c\u767e\u5206\u6bd4\u53ef\u9760\u4f46\u7edd\u5bf9\u503c\u662f\u8fd1\u4f3c\u3002<\/p>\n<p>\u53e6\u5916 hook \u53ea\u4f5c\u7528\u4e8e Bash \u5de5\u5177\u8c03\u7528\u3002\u50cf Claude Code \u5185\u7f6e\u7684 Read\u3001Grep\u3001Glob \u8fd9\u4e9b\u4e0d\u8d70 Bash\uff0c\u4e0d\u4f1a\u88ab\u81ea\u52a8\u91cd\u5199\u3002\u60f3\u538b\u7f29\u6587\u4ef6\u8bfb\u53d6\u5f97\u663e\u5f0f\u7528 `rtk read`\u3002<\/p>\n<p>\u6211\u89c9\u5f97\u8fd9\u5de5\u5177\u4e0d\u662f\u6ca1\u7528\uff0c\u5b9a\u4f4d\u8981\u6446\u5bf9\u3002\u957f\u8f93\u51fa\u573a\u666f\uff08\u8dd1\u6d4b\u8bd5\u3001\u770b diff\u3001\u67e5\u65e5\u5fd7\uff09\u4e0b\u7701 token \u662f\u5b9e\u5b9e\u5728\u5728\u7684\uff1b\u8c03\u8bd5\u548c\u6392\u9519\u65f6\u8be5\u7ed5\u8fc7\u5c31\u7ed5\u8fc7\uff0c`RTK_DISABLE=1` \u4e00\u4e2a\u73af\u5883\u53d8\u91cf\u4e34\u65f6\u5173\u6389\u3002\u8981\u771f\u60f3\u780d\u603b\u8d26\u5355\uff0c\u5f97\u914d\u5408\u6587\u4ef6\u8bfb\u53d6\u538b\u7f29\u5de5\u5177\u4e00\u8d77\u4e0a\uff0c\u5149\u538b bash \u8f93\u51fa\u4e0d\u591f\u3002<\/p>\n<p>crates.io \u4e0a\u8fd8\u6709\u4e2a\u540c\u540d\u7684 rtk\uff08Rust Type Kit\uff09\uff0c\u522b\u88c5\u9519\u4e86\u3002`cargo install &#8211;git` \u8d70\u5b98\u65b9\u4ed3\u5e93\u6700\u7a33\u3002<\/p>\n<p>\u5de5\u5177\u672c\u8eab\u6ca1\u95ee\u9898\uff0c\u95ee\u9898\u662f&#8221;\u7701 90%&#8221;\u8fd9\u4e2a\u8bf4\u6cd5\u3002\u538b 90% \u7684 bash \u8f93\u51fa\u548c\u7701 90% \u7684\u94b1\uff0c\u5dee\u8fdc\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>RTK\uff08Rust Token Killer\uff09\u6700\u8fd1\u5728 GitHub \u4e0a\u4e86 7 \u4e07\u661f\u3002\u505a\u4e86\u4e00\u4ef6\u5f88\u7b80\u5355\u7684\u4e8b\uff1a\u5728\u7ec8\u7aef\u8f93 &#8230; <a title=\"\u58f0\u79f0\u7701 90% token \u7684 CLI\uff0c\u8d26\u5355\u4e3a\u4ec0\u4e48\u6ca1\u964d\" class=\"read-more\" href=\"https:\/\/www.tantan.ink\/index.php\/2026\/08\/17\/%e5%a3%b0%e7%a7%b0%e7%9c%81-90-token-%e7%9a%84-cli%ef%bc%8c%e8%b4%a6%e5%8d%95%e4%b8%ba%e4%bb%80%e4%b9%88%e6%b2%a1%e9%99%8d\/\" aria-label=\"\u9605\u8bfb \u58f0\u79f0\u7701 90% token \u7684 CLI\uff0c\u8d26\u5355\u4e3a\u4ec0\u4e48\u6ca1\u964d\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":2,"featured_media":869,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-872","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software"],"_links":{"self":[{"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/posts\/872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/comments?post=872"}],"version-history":[{"count":1,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/posts\/872\/revisions"}],"predecessor-version":[{"id":873,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/posts\/872\/revisions\/873"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/media\/869"}],"wp:attachment":[{"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/media?parent=872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/categories?post=872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/tags?post=872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}