{"id":1770,"date":"2026-06-28T22:09:15","date_gmt":"2026-06-28T14:09:15","guid":{"rendered":"https:\/\/www.izhuhn.cn\/?p=1770"},"modified":"2026-06-28T22:09:15","modified_gmt":"2026-06-28T14:09:15","slug":"rtk-token%e5%8e%8b%e7%bc%a9%e4%bb%a3%e7%90%86%e9%83%a8%e7%bd%b2%e7%ae%80%e8%ae%b0","status":"publish","type":"post","link":"https:\/\/www.izhuhn.cn\/index.php\/2026\/06\/28\/rtk-token%e5%8e%8b%e7%bc%a9%e4%bb%a3%e7%90%86%e9%83%a8%e7%bd%b2%e7%ae%80%e8%ae%b0\/","title":{"rendered":"rtk Token\u538b\u7f29\u4ee3\u7406\u90e8\u7f72\u7b80\u8bb0"},"content":{"rendered":"<h1 class=\"wp-block-heading\">rtk Token\u538b\u7f29\u4ee3\u7406\u90e8\u7f72\u7b80\u8bb0<\/h1>\n\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u80cc\u666f<\/h2>\n\n<p class=\"wp-block-paragraph\">\u7528 LLM coding agent \u6700\u5927\u7684\u9690\u5f62\u6210\u672c\u662f context \u81a8\u80c0\u3002\u4e00\u6b21 `ls` \u7ed9 65KB \u8f93\u51fa\uff0c\u4e00\u6b21 `git diff` \u51e0\u5343\u884c\uff0c\u8fd9\u4e9b\u5168\u90fd\u7b97 token\u3002rtk\uff08Rust Token Killer\uff09\u662f\u4e2a Rust \u5199\u7684 CLI \u4ee3\u7406\uff0c\u5728\u547d\u4ee4\u8f93\u51fa\u8fdb\u5165 LLM \u4e0a\u4e0b\u6587\u4e4b\u524d\u5148\u8fc7\u6ee4\u538b\u7f29\uff0c\u5b9e\u6d4b\u80fd\u7701 60-90% token\u3002<\/p>\n\n<p class=\"wp-block-paragraph\">\u5b98\u7f51\uff1ahttps:\/\/github.com\/rtk-ai\/rtk<\/p>\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u5b89\u88c5<\/h2>\n\n<p class=\"wp-block-paragraph\">macOS \u76f4\u63a5 brew \u88c5\u6216\u8005\u4e0b\u8f7d\u9884\u7f16\u8bd1\u4e8c\u8fdb\u5236\u3002brew \u65b9\u5f0f\u4f1a\u62c9\u4e00\u5806\u7f16\u8bd1\u4f9d\u8d56\uff08rust\u3001llvm \u7b49\uff09\uff0c\u592a\u6162\uff0c\u76f4\u63a5\u4e0b\u4e8c\u8fdb\u5236\uff1a<\/p>\n\n<pre class=\"wp-block-code\"><code>curl -L -o \/tmp\/rtk.tar.gz \\\n  https:\/\/github.com\/rtk-ai\/rtk\/releases\/download\/v0.43.0\/rtk-x86_64-apple-darwin.tar.gz\nmkdir -p ~\/.local\/bin\ntar xzf \/tmp\/rtk.tar.gz -C ~\/.local\/bin\/\nchmod +x ~\/.local\/bin\/rtk<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">\u56fd\u5185\u7f51\u7edc\u62c9 GitHub Releases \u53ef\u80fd\u4f1a\u8d85\u65f6\uff0c\u8d70\u4ee3\u7406\uff1a<\/p>\n\n<pre class=\"wp-block-code\"><code>curl -x http:\/\/localhost:18888 -L -o \/tmp\/rtk.tar.gz \\\n  https:\/\/github.com\/rtk-ai\/rtk\/releases\/download\/v0.43.0\/rtk-x86_64-apple-darwin.tar.gz<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">\u9a8c\u8bc1\uff1a<\/p>\n\n<pre class=\"wp-block-code\"><code>$ ~\/.local\/bin\/rtk --version\nrtk 0.43.0<\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001\u539f\u7406<\/h2>\n\n<p class=\"wp-block-paragraph\">rtk \u7684\u6838\u5fc3\u601d\u8def\u662f\u5728 shell \u547d\u4ee4\u548c LLM \u4e4b\u95f4\u52a0\u4e00\u5c42\u8fc7\u6ee4\u5668\u3002\u5bf9 Claude Code \u8fd9\u7c7b\u5de5\u5177\uff0c\u5b83\u901a\u8fc7 Bash hook \u81ea\u52a8\u6539\u5199\u547d\u4ee4\uff08`git status` \u2192 `rtk git status`\uff09\uff0c\u8f93\u51fa\u5728\u8fdb\u5165 context \u524d\u5c31\u88ab\u538b\u7f29\u3002<\/p>\n\n<p class=\"wp-block-paragraph\">\u5bf9 OpenClaw \u8fd9\u7c7b\u4f7f\u7528 exec tool \u7684\u5de5\u5177\uff0c\u9700\u8981\u5728 agent \u4fa7\u624b\u52a8\u52a0 `rtk` \u524d\u7f00\u3002\u521b\u5efa OpenClaw skill \u8ba9 agent \u81ea\u52a8\u8bc6\u522b\u8be5\u7528 rtk \u7684\u573a\u666f\u3002<\/p>\n\n<p class=\"wp-block-paragraph\">rtk \u5185\u7f6e\u4e86 40+ \u547d\u4ee4\u7684\u538b\u7f29\u7b56\u7565\uff0c\u8986\u76d6 git\u3001docker\u3001kubectl\u3001npm\/cargo test\u3001tsc\u3001eslint\u3001grep\u3001find \u7b49\u65e5\u5e38\u9ad8\u9891\u64cd\u4f5c\u3002<\/p>\n\n<h2 class=\"wp-block-heading\">\u56db\u3001OpenClaw Skill<\/h2>\n\n<p class=\"wp-block-paragraph\">OpenClaw \u6ca1\u6709 shell hook\uff0c\u4f46\u53ef\u4ee5\u901a\u8fc7 skill \u673a\u5236\u8ba9 agent \u5728 exec \u8c03\u7528\u65f6\u81ea\u52a8\u52a0 rtk \u524d\u7f00\u3002<\/p>\n\n<p class=\"wp-block-paragraph\">Skill \u7ed3\u6784\uff1a<\/p>\n\n<pre class=\"wp-block-code\"><code>skills\/rtk-token-saver\/\n  SKILL.md<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">SKILL.md \u6838\u5fc3\u5185\u5bb9\uff1a<\/p>\n\n<ul class=\"wp-block-list\"><li>\u89e6\u53d1\u6761\u4ef6\uff1aexec \u8c03\u7528\u9ad8\u8f93\u51fa\u547d\u4ee4\uff08git\u3001ls\u3001docker\u3001test \u7b49\uff09<\/li><li>\u547d\u4ee4\u5217\u8868\uff1a40+ \u4e2a\u652f\u6301\u7684 `rtk <cmd>` \u6620\u5c04<\/li><li>\u53cd\u6a21\u5f0f\uff1a`echo`\u3001`pwd` \u7b49\u96f6\u8f93\u51fa\u547d\u4ee4\u4e0d\u52a0 rtk<\/li><li>\u76d1\u63a7\u547d\u4ee4\uff1a`rtk gain` \u67e5\u770b\u8282\u7ea6\u7edf\u8ba1<\/li><\/ul>\n\n<h2 class=\"wp-block-heading\">\u4e94\u3001\u5b9e\u6d4b<\/h2>\n\n<p class=\"wp-block-paragraph\">\u540c\u4e00\u53f0\u673a\u5668\u4e0a\u5bf9\u51e0\u4e2a\u9ad8\u9891\u547d\u4ee4\u505a\u4e86\u5bf9\u6bd4\uff1a<\/p>\n\n<ul class=\"wp-block-list\"><li>`ls -la \/usr\/local\/bin`\uff1a65539 bytes \u2192 35983 bytes\uff0c\u7701 45%<\/li><li>`docker ps`\uff1a334 bytes \u2192 130 bytes\uff0c\u7701 61%<\/li><li>`ls` \u5de5\u4f5c\u76ee\u5f55\uff1a796 bytes \u2192 253 bytes\uff0c\u7701 68%<\/li><\/ul>\n\n<p class=\"wp-block-paragraph\">`rtk gain` \u7edf\u8ba1\uff1a<\/p>\n\n<pre class=\"wp-block-code\"><code>Total commands:    6\nInput tokens:      17.5K\nOutput tokens:     9.5K\nTokens saved:      8.0K (45.6%)<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">\u4e00\u6b21\u666e\u901a\u64cd\u4f5c\u5c31\u80fd\u7701\u5c06\u8fd1\u4e00\u534a token\uff0c\u5bf9\u4e8e\u9891\u7e41 exec \u7684 agent \u5de5\u4f5c\u6d41\u6765\u8bf4\u6536\u76ca\u660e\u663e\u3002<\/p>\n\n<h2 class=\"wp-block-heading\">\u516d\u3001\u6ce8\u610f\u4e8b\u9879<\/h2>\n\n<ul class=\"wp-block-list\"><li>rtk \u5bf9\u4e0d\u8ba4\u8bc6\u7684\u547d\u4ee4\u4f1a\u900f\u4f20\uff0c\u52a0 warn \u4f46\u4e0d\u4f1a\u963b\u585e<\/li><li>\u9700\u8981\u5b8c\u6574\u539f\u59cb\u8f93\u51fa\u65f6\u4e0d\u8981\u7528 rtk\uff08\u6bd4\u5982\u8981\u5168\u6587\u89e3\u6790\u7684\u573a\u666f\uff09<\/li><li>`rtk proxy <cmd>` \u53ef\u4ee5\u8df3\u8fc7\u8fc7\u6ee4\uff0c\u7528\u4e8e\u8c03\u8bd5<\/li><li>\u4e8c\u8fdb\u5236\u4f4d\u7f6e `~\/.local\/bin\/rtk`\uff0c\u786e\u8ba4\u5df2\u5728 PATH \u4e2d<\/li><li>\u6302\u4ee3\u7406\u4e0b\u8f7d\u65f6\u6ce8\u610f GitHub Releases \u8d70\u7684\u662f `objects.githubusercontent.com` \u57df\u540d<\/li><\/ul>\n\n<p class=\"wp-block-paragraph\">\u7b80\u8bb0\u3002<\/p>","protected":false},"excerpt":{"rendered":"<p>rtk Token\u538b\u7f29\u4ee3\u7406\u90e8\u7f72\u7b80\u8bb0 \u4e00\u3001\u80cc\u666f \u7528 LLM coding agent \u6700\u5927\u7684\u9690\u5f62\u6210\u672c\u662f context \u81a8\u80c0\u3002\u4e00\u6b21  &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[38,36,35,34,37],"class_list":["post-1770","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-cli","tag-llm","tag-openclaw","tag-rtk","tag-token"],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/posts\/1770","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1770"}],"version-history":[{"count":1,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/posts\/1770\/revisions"}],"predecessor-version":[{"id":1771,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/posts\/1770\/revisions\/1771"}],"wp:attachment":[{"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1770"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1770"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.izhuhn.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1770"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}