cxcscmu/skilllearnbench/run1-token-usage-tracking
Claude Code and agent skill by cxcscmu/skilllearnbench
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Methods for calculating or retrieving the number of tokens consumed during an LLM inference task.
Install
npx vskill@latest install cxcscmu/skilllearnbench/run1-token-usage-trackingSKILL.md
The same SKILL.md was published earlier as cxcscmu/skilllearnbench/run1-token-usage-tracking.
To meet the requirement of logging consumed tokens:
- API Metadata: If using an external API (like OpenAI or Anthropic), retrieve
usage.total_tokensfrom the response object. - Local Calculation: If using a local model or needing a manual count, use a library like
tiktokenor the model's native tokenizer.
``python # Example for tiktoken import tiktoken encoding = tiktoken.get_encoding("cl100k_base") num_tokens = len(encoding.encode(text_input)) + len(encoding.encode(text_output)) ``
- Validation: Always ensure the
tokensvalue in the final JSON is a numeric type (e.g.,123) and not a string ("123").
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/b3-teacher-feedback-gemini-3-flash-preview/enterprise-information-search/run1_token-usage-tracking/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cxcscmu/skilllearnbench/run1-token-usage-tracking)