A community-driven leaderboard for Claude Code usage. Submit your ccusage stats and see how you rank.
Live at viberank.app.
- π Global leaderboard by cost or tokens, with 7d / 30d / custom date filters
- π Profile pages at
viberank.app/profile/{username}with daily charts and model breakdown - π Three ways to submit:
npx viberankCLI, plaincurl, or signed-in web upload - π GitHub OAuth β verified submissions show a blue check; unverified CLI submissions show a
clipill - π‘οΈ Input validation β token math, date sanity, daily-cost ceilings
- π Merge flow β re-submitting the same range overwrites prior daily entries; merging combines unverified CLI rows into your verified profile
npx viberankThis generates a fresh cc.json via ccusage and POSTs it to /api/submit. It picks up your GitHub username from git config user.name.
npx ccusage@latest --json > cc.json
curl -X POST https://www.viberank.app/api/submit \
-H "Content-Type: application/json" \
-H "X-GitHub-User: $(git config user.name)" \
-d @cc.json- Sign in to viberank.app with GitHub
- Click Submit Stats β Upload cc.json
- Drop your
cc.jsonfile
Web uploads come back with a verified badge automatically. CLI submissions show as unverified until you sign in and merge them via the prompt on the homepage.
If you use a Claude Code MCP-compatible client, the viberank-mcp-server exposes submit and lookup tools. (Note: this package is currently unmaintained β see issue tracker for status.)
Submissions are checked at the API level. Anything that fails these rules is rejected:
- Token math β
input + output + cache_creation + cache_read = total(within 1 token of tolerance) - No negative values anywhere in totals or daily breakdowns
- Valid date format β
YYYY-MM-DD - Not too far in the future β dates after tomorrow-UTC are rejected (covers users at any global timezone offset)
- Realistic ranges β total cost can't exceed
$5,000 Γ 365 days
Submissions can also be flagged for review by an admin via /admin; flagged rows are hidden from the leaderboard by default.
See VALIDATION.md for the full ruleset.
If you submit via the CLI before signing in, the row lands on the leaderboard as unverified (cli pill). Once you sign in with the matching GitHub account, the homepage shows a banner offering to verify or merge. That hits an authenticated /api/claim endpoint which:
- Finds all submissions under your GitHub username
- Picks a base submission (OAuth-verified row wins; else most recent)
- Merges daily breakdowns β overlapping dates take the OAuth version
- Recomputes totals, sets
verified: true, deletes the duplicates
Known limitation: submitting from multiple machines with overlapping dates currently overwrites instead of summing daily data β see #43. Submit from one machine at a time until that's resolved.
- Node.js 18+ and pnpm 10+
- A Supabase project (free tier is fine)
- A GitHub OAuth app
git clone https://github.com/sculptdotfun/viberank.git
cd viberank
pnpm install
cp .env.example .env.localFill in .env.local (see .env.example for the full list). The required keys are:
NEXT_PUBLIC_SUPABASE_URL=https://<project-ref>.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=<anon-key>
SUPABASE_SERVICE_ROLE_KEY=<service-role-key>
NEXT_PUBLIC_DATABASE_BACKEND=supabase
NEXTAUTH_URL=http://localhost:3001
NEXTAUTH_SECRET=<openssl rand -base64 32>
GITHUB_ID=<github-oauth-client-id>
GITHUB_SECRET=<github-oauth-client-secret>Apply the schema:
# Run the SQL in supabase/migrations/001_initial_schema.sql against your project,
# either via the Supabase SQL editor or the supabase CLI.Run the dev server:
pnpm devOpen http://localhost:3001.
| Command | What it does |
|---|---|
pnpm dev |
Start Next dev server (Turbopack) on port 3001 |
pnpm build |
Production build |
pnpm start |
Serve the production build |
pnpm lint |
Run next lint |
pnpm exec tsc --noEmit |
Type-check without emitting |
- Frontend: Next.js 16, React 19, TypeScript 5, Tailwind CSS 4
- Backend: Next.js API routes + Supabase (Postgres)
- Auth: NextAuth.js v4 with GitHub OAuth
- Charts: Recharts
- Animation: Framer Motion
- Hosting: Vercel
The repo also contains a dormant Convex implementation behind a feature flag (NEXT_PUBLIC_DATABASE_BACKEND=convex); Supabase is the active backend in production.
Submit usage data. Authenticated submissions (with a NextAuth session cookie) are marked verified: true; otherwise the request must include an X-GitHub-User header.
Body: contents of cc.json (output of npx ccusage --json).
Response:
{
"success": true,
"submissionId": "...",
"message": "Successfully submitted data for username",
"profileUrl": "https://viberank.app/profile/username"
}Authenticated β merges unverified CLI submissions into the caller's verified profile. Username is taken from the session, not the request body. Returns 401 without a session.
Returns backend status:
{ "api": "ok", "backend": "supabase", "backendConnection": "ok", "timestamp": "..." }Designed to run on Vercel. Push to main to trigger an auto-deploy. The required production env vars are the same as .env.example; make sure SUPABASE_SERVICE_ROLE_KEY and the NEXT_PUBLIC_* Supabase vars are also listed in turbo.json's build.env allowlist so Turbo passes them through.
See CONTRIBUTING.md.
MIT.
- Claude Code by Anthropic
- ccusage β the usage tracker that produces
cc.json