leaderboard · karanb192 — Claude Code skill: what it does, how to install
leaderboard prints a per-repo ranking of the files costing the most context tokens, with fixes suggested for the worst offenders.
MIT ★ 586 updated 2026-10-26
/plugin marketplace add karanb192/claude-code-hooks
/plugin install context-hogs@claude-code-hooksWhat leaderboard does
This skill renders a table of the repository's most expensive files by context usage: how many times each was read, total tokens accumulated, and an estimated cost. The numbers come from the context-hogs hook, which logs file access as work happens; the skill itself just runs node context-hogs.js --render to display what that hook recorded.
After the table, Claude is expected to point out the top 1-3 worst files and give one fix per file: splitting an oversized file, excluding a generated or vendored path, or adding a CLAUDE.md entry or permissions.deny rule for something Claude keeps re-reading. No commands get re-run for this; model invocation is disabled by default, so you call it directly.
The table has nothing to show without the context-hogs hook running alongside it, since that hook is what collects the data in the first place.
What it helps with
- spot which files bloat a session's context
- get a rough token-cost estimate per file
- decide which file to split or drop from context
- write a CLAUDE.md or permissions.deny rule for a problem file
Example prompts for the agent
- Show me the context-cost leaderboard for this repo
- Run leaderboard and suggest fixes for the worst files
- /plugin:leaderboard
How to install leaderboard
1Plugin marketplace
/plugin marketplace add karanb192/claude-code-hooks/plugin install context-hogs@claude-code-hooksThis installs the whole context-hogs plugin with all its skills
2Skills CLI (Vercel)
npx skills add karanb192/claude-code-hooks --skill leaderboard -a claude-code3Manually: put the files in place
~/.claude/skills/leaderboard/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/leaderboard/
1Skills CLI (Vercel)
npx skills add karanb192/claude-code-hooks --skill leaderboard -a codex2Manually: put the files in place
.agents/skills/leaderboard/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add karanb192/claude-code-hooks --skill leaderboard -a cursor2Manually: put the files in place
.cursor/skills/leaderboard/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install karanb192/claude-code-hooks plugins/context-hogs/skills/leaderboard2Manually: put the files in place
.github/skills/leaderboard/SKILL.md1Skills CLI (Vercel)
npx skills add karanb192/claude-code-hooks --skill leaderboard -a gemini-cli2Platform CLI
gemini skills install https://github.com/karanb192/claude-code-hooks --path plugins/context-hogs/skills/leaderboardManually: put the files in place
.devin/skills/leaderboard/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about leaderboard
How do I install leaderboard in Claude Code?
Run /plugin marketplace add karanb192/claude-code-hooks, then /plugin install context-hogs@claude-code-hooks.
What does the leaderboard skill do?
It prints a table ranking the repository's files by token cost in recent sessions and calls out the worst ones with a concrete fix for each.
Where does leaderboard get its data from?
The context-hogs hook records file reads as you work; the skill just renders that log through context-hogs.js --render.
Source text
SKILL.md · MIT
---
name: leaderboard
description: Show this repo's context-cost leaderboard: the files that pulled the most tokens into context
disable-model-invocation: true
---
# Context-cost leaderboard
!`node "${CLAUDE_SKILL_DIR}/../../context-hogs.js" --render 2>/dev/null || node "${CLAUDE_PLUGIN_ROOT}/context-hogs.js" --render`
The table above is this repository's most token-expensive files, aggregated across
your recent sessions (read count, cumulative tokens, estimated cost). It is produced
by the `context-hogs` hook, which records as you work.
Briefly call out the top 1-3 offenders and suggest one concrete fix each: for
example: split an oversized file, exclude a generated/vendored path, or add the
suggested CLAUDE.md / `permissions.deny` block for a file Claude keeps re-reading.
Keep it short; do not re-run any commands.
© Karan Bansal · MIT · karanb192/claude-code-hooks
Similar skills
All skills for Agent setup: memory, context, orchestration →leaderboard by other authors comes first.