mdcp-token-meter
Skill2 starsChanged 5 days agoMITView on GitHub
Show how much of the session's context and tokens have been used. Use when the user asks "token meter", "how much session is used", "context usage", "how many tokens", or wants a usage readout in the status line (Claude Code).
In this repository108 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/composition-patterns/AGENTS.mdAGENTS.md
- skills/react-best-practices/AGENTS.mdAGENTS.md
- skills/react-view-transitions/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skills/master-developer/references/CLAUDE.mdCLAUDE.md
- agent-fabricSkill
- api-anythingSkill
- creator-security-automationSkill
- feature-implementationSkill
- omniroute-free-llm-routingSkill
- repository-auditSkill
- security-reviewSkill
- unslopSkill
- youtube-studioSkill
- agent-developmentSkill
- agent-fabricSkill
- agent-security-hardeningSkill
- algorithmic-artSkill
- api-anythingSkill
- api-designSkill
- backend-patternsSkill
- brand-guidelinesSkill
- build-mcp-appSkill
- build-mcpbSkill
- build-mcp-serverSkill
- canvas-designSkill
- claude-apiSkill
- claude-md-improverSkill
- coding-standardsSkill
- command-developmentSkill
- vercel-composition-patternsSkill
- creator-security-automationSkill
- database-migrationsSkill
- deployment-patternsSkill
- dispatching-parallel-agentsSkill
- docker-patternsSkill
- e2e-testingSkill
- executing-plansSkill
- finishing-a-development-branchSkill
- frontend-a11ySkill
- frontend-designSkill
- frontend-patternsSkill
- hook-developmentSkill
- master-developerSkill
- mcp-builderSkill
- mcp-dependency-reviewSkill
- mcp-integrationSkill
- mdcp-self-checkSkill
- nextjs-turbopackSkill
- omniroute-free-llm-routingSkill
- plugin-settingsSkill
- plugin-structureSkill
- postgres-patternsSkill
- prisma-patternsSkill
- vercel-react-best-practicesSkill
- vercel-react-view-transitionsSkill
- receiving-code-reviewSkill
- replica-architectSkill
- replica-backendSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Add to ~/.claude/settings.json (use the real path to scripts/token-meter.py):
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Token meter
Reads the session transcript and reports real API usage numbers: context in use now, output tokens, fresh input, cache writes and cache reads, number of API calls.
Run it
python3 "$(find ~/.claude -name token-meter.py -path '*scripts*' | head -1)"Options: --window N (context window to compare against; env MDCP_CONTEXT_WINDOW), --json, a transcript path as the last argument.
Show the user the output as printed, then one sentence: how full the context is and whether to compact or start a new session (suggest this above about 70%).
Always-on status line (Claude Code)
Add to ~/.claude/settings.json (use the real path to scripts/token-meter.py):
{ "statusLine": { "type": "command", "command": "python3 /path/to/token-meter.py --statusline" } }Shows e.g. ctx 285.7k/1000.0k (28.6%) | out 45.2k | 37 calls.
Limits to tell the user
- Works from Claude Code's local transcript. It does not see claude.ai web chats.
- The context window size is not in the transcript. The default is 200k; if usage already exceeds it, 1M is assumed. Set
--windowto be exact. - This is session context, not plan quota. Quota is shown by
/usagein Claude Code or Settings > Usage on claude.ai. - Cache reads repeat the same context each call, so they are large; they are not new text.
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.

