A token profiler for Claude Code. It parses the session transcripts Claude Code already writes to disk (~/.claude/projects/**/*.jsonl) and tells you where your tokens actually went — and what to change to spend fewer of them. ccusage tells you what you spent.
FAQ
tokenscope is a Claude Code plugin with 1 hand-picked skill for development work, indexed on Flowy. Install it with the command on its page. It includes tokenscope. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
$ npx -y skills add AviVAvi/TokenScope --agent claude-code
Repo: AviVAvi/TokenScope
A token profiler for Claude Code. It parses the session transcripts Claude Code already writes to disk (~/.claude/projects/**/*.jsonl) and tells you where your tokens actually went — and what to change to spend fewer of them.
ccusage tells you what you spent. tokenscope tells you why — and (soon) proves the fix worked.
Predicting what a task will cost is guesswork — agent runs vary 3–5x on the same prompt. But every session's real usage is already recorded with per-request precision (input, output, cache reads/writes, per tool call). Measuring beats guessing, so v1 measures.
npx @asmitbohra/tokenscope # overview of every project + top waste findings
npx @asmitbohra/tokenscope glow-os # per-session breakdown for one project
npx @asmitbohra/tokenscope codemap . # generate CODEMAP.md for a repo
Or install globally for the short command:
npm i -g @asmitbohra/tokenscope # then: tokenscope, tokenscope <project>, tokenscope codemap .
No runtime dependencies; Node ≥ 18. From a clone, the TypeScript source also runs directly on Node ≥ 23.6:
# Overview of every project + top waste findings
node src/cli.ts
# Per-session breakdown for one project (name substring match)
node src/cli.ts glow-os
# Generate CODEMAP.md — a signatures-only map of a repo the agent can read
# instead of exploring whole files
node src/cli.ts codemap path/to/repo
/tokenscope skill (judgment layer)The CLI is deliberately deterministic — it measures, it never guesses. The skill adds the judgment layer: a Claude Code session that runs the profiler, reads your project's CLAUDE.md and recent prompts to understand the workflow, and then tells you which recommendations to apply and which ones are scoring deliberate cost as waste.
Install (copies into your personal skills directory):
cp -r skills/tokenscope ~/.claude/skills/tokenscope
Then in any Claude Code session: /tokenscope (or just ask for a token audit).
.tokenscope.json)tokenscope scores context hygiene, not value — it has no model of your workflow and
can't distinguish "expensive because wasteful" from "expensive because verification is
the product". Drop a .tokenscope.json in a project root to teach it:
{
"verification": true,
"mute": ["split-sessions", "front-load-specs"]
}
"verification": true suppresses output-filtering advice (truncating output you're
measuring manufactures false confidence). "mute" silences any recommendation by id.
claude mcp remove commands for servers you configured but never call, and session-hygiene advice.CODEMAP.md, a signatures-only skeleton of a repo (files, exports, functions, line anchors) that agents can consult instead of reading whole files.~/.claude.json against tool calls in transcripts to find schema-tax with zero payoff.repeated-read — same file read 3+ times in a sessionhuge-read — single file read worth 15k+ tokenserror-loop — 5+ failed tool calls (each retry re-bills the growing context)verbose-commands — shell output flooding the contextlow-cache-hit — sessions where prompt caching mostly missedcompaction-churn — sessions that outgrew the context window repeatedlyusage objects in the transcript — exact.src/
cli.ts entry point / project discovery / commands
parser.ts JSONL transcript → structured session data
analyzer.ts metrics + waste-finding heuristics
score.ts Context Score (0-100, with $ impact per component)
recommend.ts findings → evidence-backed fixes (structure-aware)
codemap.ts CODEMAP.md generator (signatures-only repo map)
mcp.ts configured-vs-used MCP server audit
report.ts terminal rendering
pricing.ts model pricing + cache multipliers
Built by Asmit Bohra
Found something wild in your own transcripts? Open an issue — real-world waste patterns shape the roadmap.
.github/
FUNDING.yml
.gitignore
LICENSE
package-lock.json
package.json
README.md
skills/
tokenscope/
SKILL.md
src/
analyzer.ts
cli.ts
codemap.ts
mcp.ts
parser.ts
pricing.ts
recommend.ts
report.ts
score.ts
tsconfig.json© 2026 Flowy · Free and open source
Built for Claude Code · Not affiliated with Anthropic