@choochye/tc
v0.1.0
Published
CLI to calculate markdown token usage for AI (Claude/OpenAI)
Readme
tc
tc (token calculator) is a small CLI for estimating how much markdown context your agent automation files consume.
It scans:
ai/**/*.md./CLAUDE.md./AGENT.md
It reports:
- file size
- line count
- word count
- OpenAI token count
- Claude rough token estimate
Install
Install globally:
npm install -g @choochye/token-calcAfter install, run:
tcUsage
From any project root:
tcScan a different directory:
tc /path/to/projectEmit JSON:
tc --jsonShow fewer top files:
tc --top 5Output Notes
- OpenAI token counts are calculated locally with
js-tiktokenusing theo200k_baseencoding. - Claude values are offline rough estimates only. They are useful for budgeting and comparison, but they are not Anthropic API counts.
- The tool is intentionally scoped to common agent markdown files instead of trying to reconstruct every framework's hidden runtime prompt assembly.
