token-optimizer
Skill7 starsChanged 5 months agoMITView on GitHub
优化 Claude Code 上下文 Token 消耗——重新组织项目文档结构,只保留 4 个核心文件 在启动时自动加载(约 800 token),其他内容按需加载(0 token 成本)。 实测省 90% token(11000 → 1300),一条命令 30 秒搞定。 支持 13 种框架专项模板,含 .claudeignore 机制和维护工具链。 Trigger keywords: token optimizer, token优化, 优化token, 节省token, 上下文优化, claude-token-optimizer, cto, .claudeignore, 减少token消耗, token管理, 清理上下文, 文档结构优化, 按需加载。
24 other projects use a version of this.
Adopted by
Most recently taken up by
- blinkboxhq/Blinkboxtheir own version, first seen Nov 8, 2026
- Tejas9406/vibe-coding-ostheir own version, first seen Nov 1, 2026
- vikneshwaran16032005-alt/claude-skillstheir own version, first seen Oct 23, 2026
- Anmolop97/Agent-Skillstheir own version, first seen Oct 20, 2026
- tingyulu/MyR2D2their own version, first seen Oct 16, 2026
- leogallego/claude-skills-tokenstheir own version, first seen Oct 15, 2026
Used with
Projects with it also use skill-creator.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 5 projects that use this
Other versions24 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 24
- alexgreensh/token-optimizer★ 2.9ksame name
- nitinjain999/platform-skills★ 71same name
- georgekhananaev/claude-skills-vault★ 28same name
- aayushostwal/nexus★ 19same name
- tingyulu/MyR2D2★ 19same name
- thesaifalitai/claude-setup★ 9same name
- GPire/claude-skills-swarm★ 8same name
- samibajwaisking/Token-Optimizer-Skill★ 6same name
- amunozdev/token-optimizer★ 4same name
- blinkboxhq/Blinkbox★ 4same name
14 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository129 other files it gives its agents.
- last30days-skill/AGENTS.mdAGENTS.md
- tutor/AGENTS.mdAGENTS.md
- vercel-labs-skills/AGENTS.mdAGENTS.md
- baoyu-skills/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- claude-to-im-skill/CLAUDE.mdCLAUDE.md
- html-video/CLAUDE.mdCLAUDE.md
- last30days-skill/CLAUDE.mdCLAUDE.md
- ui-ux-pro-max-skill/CLAUDE.mdCLAUDE.md
- academic-research-skillsSkill
- agency-agents-zhSkill
- algorithmic-artSkill
- animation-craftSkill
- apple-designSkill
- archifySkill
- architecture-diagramSkill
- article-posterSkill
- baokuan-title-generatorSkill
- baoyu-skillsSkill
- brand-workshopSkill
- canvas-designSkill
- cc-dispatchSkill
- claude-to-imSkill
- code-reviewSkill
- code-simplifierSkill
- codex-claude-pmSkill
- comprehensive-thinkingSkill
- context7Skill
- creator-buddySkill
- dashi-pptSkill
- dbskillSkill
- design-buddySkill
- dog-frontierSkill
- dog-posterSkill
- dog-pptSkill
- Dog-Project-EvaluateSkill
- dog-tutorSkill
- emil-design-engSkill
- excalidraw-diagramSkill
- family-doctorSkill
- feynman-learningSkill
- fireworks-tech-graphSkill
- first-principlesSkill
- ghostwriterSkill
- gpt-researcherSkill
- handshakeSkill
- html-videoSkill
- huashu-agent-swarmSkill
- huashu-article-editSkill
- huashu-article-to-xSkill
- huashu-data-proSkill
- huashu-designSkill
- huashu-douyin-scriptSkill
- huashu-image-uploadSkill
- huashu-info-searchSkill
- huashu-material-searchSkill
- huashu-md-to-pdfSkill
- huashu-prompt-saveSkill
- huashu-proofreadingSkill
- huashu-researchSkill
- The first 60 shown.
The file
Files
token-optimizer — 上下文 Token 消耗优化
装完以后立刻见效最明显的一个。实测:优化前每次启动烧 11000 token,优化后降到 1300,省了将近 90%。
为什么需要它
Claude Code 启动时自动加载项目根目录下的所有文档文件。如果你的 CLAUDE.md 里塞了三年前的架构决策、去年的 bug 记录、上个月的会话笔记,它全给你加载进去。这些文档可能 90% 跟当前任务无关,但 token 照烧。
核心原理
优化前:启动加载所有文档 → 11000 token
优化后:只加载 4 个核心文件 → 800 token
其他内容按需加载 → 0 token 启动成本安装
npx claude-token-optimizer init一条命令,30 秒搞定。自动检测你的技术栈(从 package.json、requirements.txt、go.mod 里读),创建优化后的文档目录结构。
维护工具链
| 命令 | 作用 |
cto measure | 查看当前 token 消耗 |
cto audit | 健康检查,扫描冗余内容 |
cto compress | 压缩冗余内容 |
cto prune | 清理过期文档 |
cto audit --json | 输出机器可读结果,可接入 CI |
支持的框架
Express、Next.js、Django、Rails、Go 等 13 种框架的专项优化模板。
维护建议
每周跑一次 cto audit,看到 token 数涨了就做一轮清理。这玩意儿本质上是在给 AI 编程工具做"内存管理"。
最佳搭配
- 安装新项目时第一时间运行,比后期清理省事得多
- 配合 Superpowers + Planning with Files:确保 plan 文件和白名单配置不被误清理
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

