Token Pincher — Development skill for Claude Code
铁公鸡 token-pincher: pinches every token before spending it.
How to install Token Pincher
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open LearnPrompt/token-pincher and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Token Pincher does
铁公鸡 token-pincher: pinches every token before spending it. 先判断要不要省,再决定怎么省——基于六个省 token skill 实测失败教训设计的分诊式 skill
Alternatives in Development
- GenericAgent — Self-evolving agent: grows skill tree from 3.3K-line seed, achieving full system control with 6x less token co 6.1k ★
- Claude Token Efficient — One CLAUDE.md file 3.8k ★
- Doctor — Environment diagnostics with interactive fixes — providers, auth, RTK, hooks, token optimization 2.8k ★
README
token-pincher · 铁公鸡
每个 token 都数过才决定花不花。该省的省,该花的花。
git clone https://github.com/LearnPrompt/token-pincher ~/.claude/skills/token-pincher
这是什么
六个省 token 的 skill(Caveman / Ponytail / Headroom / Graphify / Codex Token Skills / Codex Token Saver)实测都栽在同一个坑:规则常驻上下文导致 thinking 暴涨,质量竞争场景下全部倒挂——省 token 反而更贵。
token-pincher 的对策:省 token 的第一步是判断要不要省,而这个判断本身必须免费。判断交给确定性脚本,不进模型 thinking。
三层机制
用户请求
↓
[脚本分诊] 0 model token,确定性判断
↓
[按需挂载] 0~2 条规则,命中才读
↓
[裸跑兜底] 默认路径
- 脚本分诊:
scripts/triage.py用纯 Python 标准库跑一遍输入体量、规格密度、任务类型、质量信号、压缩空间,输出一个DECISION结论。这一步不用模型判断,不产生 thinking。 - 按需挂载:
DECISION为MOUNT时,最多读取 2 条rules/*.md,只对当前场景生效。stable-prefix.md永远生效,但不占挂载名额。 - 裸跑兜底:
DECISION为BARE时不加载任何规则,直接干活。这是默认路径,不是降级路径——省错的代价大于不省的代价。
什么时候它什么都不做
以下场景脚本会主动判定 `BARE`,这是设计好的行为,不是漏判:
- 请求里出现"尽可能"、"极具创意"、"电影感"这类质量竞争信号——约束会直接拖累质量
- 开放式生成任务(规格密度低)——没有硬约束可循,规则是纯增量
- 输入总量小且没有可压缩内容——没得省就别省
使用
python3 scripts/triage.py --prompt "检查这份CSS文件找出问题" --context path/to/file.css
或者从文件读取请求文本:
python3 scripts/triage.py --prompt @request.txt --context app.log --repo /path/to/repo
加 `--json` 拿机器可读输出:
python3 scripts/triage.py --prompt @request.txt --json
读 `DECISION` 行:`BARE` 就什么都不加载,`MOUNT` 就只读 `RULES` 行列出的文件。
测试
python3 tests/test_triage.py
# 或
python3 -m pytest tests/
方法论背景见 `docs/计划稿-v0.2.md`。
English
**token-pincher** — pinches every token before spending it, and knows when not to be cheap. (The Chinese name 铁公鸡, iron rooster, is the proverbial miser who won't part with a single feather.)
git clone https://github.com/LearnPrompt/token-pincher ~/.claude/skills/token-pincher
Problem
Six token-saving skills we tested (Caveman, Ponytail, Headroom, Graphify, Codex Token Skills, Codex Token Saver) failed the same way: standing rules in context inflate thinking tokens, and in quality-competitive scenarios the savings flip negative. token-pincher's answer:
Related Skills
God Of The Void
A Claude Code skill with a BODY: persistent memory across sessions, ~0-token semantic search, an errarium that
Everywhy
Content x relation for coding agents: a phrase in, a budgeted read plan out -- pointers, never prose -- so a s
Nay Costs
Use the Nay agent to do a deep-dive cost analysis of my Claude Code spending.
Fables
Four Claude Code / Codex plugins for spending tokens where they change the outcome
Analyze Spending
Deep-dive analysis of household spending patterns for a chosen period — trends, category breakdowns, anomalies
Create Monthly Budget
Create a detailed monthly budget from household context, historical spending, and active financial goals. Writ
Related Agents
Video Policy Screener
Use before spending credits on a multi-clip AI video script - predicts content-filter refusals (news/NPOV fram
Token Economy Agent
Cost-Classification Auditor. Owns whether a proposed recurring mechanism (per-sprint or per-commit) should be
Budget Architect
Use when the user needs to create or modify a household budget — monthly, annual, or custom scenarios. Analyse