tokenflex
v1.0.7
Published
Track your Claude Code token usage on the leaderboard https://tokenflex.me/
Maintainers
Readme
Claude Code Leaderboard
Track your Claude Code token usage and compete on the global leaderboard!
Installation
npm install -g tokenflexOr use directly with npx:
npx tokenflex uploadQuick Start
Submit Your Token Score
Install the package:
npm install -g tokenflexUpload your tokens:
tokenflex uploadFirst time? You'll be prompted to choose a display name for the leaderboard.
Check your ranking: After successful upload, visit https://tokenflex.me to see your score on the leaderboard!
What Happens When You Run tokenflex upload
Setup (first time only):
- Prompts you to choose a display name
- Auto-detects your Claude Code username if available
- Saves configuration locally
Token Extraction:
- Reads your Claude Code token usage from
~/.claude/stats-cache.json - Falls back to
tokscaleor manual parsing if needed
- Reads your Claude Code token usage from
Upload:
- Sends your token count to the leaderboard server
- Displays confirmation with your total tokens
View Results:
- Link to https://tokenflex.me to see your ranking
Example
$ tokenflex upload
👋 Welcome to Token Flex!
Let's set up your account...
? Choose a display name for the leaderboard: your_name
✅ Setup complete!
📊 Extracting your token usage...
🚀 Uploading to leaderboard...
✅ Successfully uploaded your token usage!
Total tokens: 150000
🏆 Check your score on https://tokenflex.meHow It Works
Token Extraction
The CLI reads your Claude Code token usage from multiple sources:
- Primary:
~/.claude/stats-cache.json- Most accurate - Fallback:
tokscalepackage - Last Resort:
~/.claude/history.jsonl- Manual parsing
Privacy
- Only total token count is uploaded
- No conversation content or prompts are sent
- Your data is anonymized
- Uploads are completely opt-in
Configuration
Configuration is stored in:
~/.config/configstore/tokenize.json
To reset your configuration and start over:
rm ~/.config/configstore/tokenize.json
tokenflex uploadTroubleshooting
"No Claude Code history found"
Make sure you have:
- Used Claude Code at least once
- Have token usage data in
~/.claude/stats-cache.jsonor~/.claude/history.jsonl
"Upload failed"
Check:
- Your internet connection
- The leaderboard server is accessible
"Username already taken"
Choose a different display name:
rm ~/.config/configstore/tokenize.json
tokenflex uploadLicense
MIT
