ctx-stats — Claude Code skill: session context savings stats
Reports how much context window context-mode saved in the current session: token use, savings ratio and a per-tool breakdown.
npx skills add mksglu/context-mode --skill ctx-stats -a claude-codeWhat ctx-stats does
The skill calls the mcp__context-mode__ctx_stats MCP tool with no arguments and returns tables covering token consumption, the savings ratio and a breakdown per tool. It is read-only. There is no way to reset or wipe anything from it. Clearing the knowledge base is a separate job, handled by ctx_purge(confirm: true) through /context-mode:ctx-purge.
The instructions tell the agent to paste the tool output into the reply in full, tables and all, without summarising or collapsing it, then add a single line naming the headline savings figure. If context-mode has not been called yet in that session, you get a note saying so instead of tables.
Without the context-mode MCP server installed and connected, the skill has nothing to call — ctx_stats is one of its tools. The skill installs separately from the server, so check the server is already configured for your agent first.
What it helps with
- see token spend for the current session
- check what share of data stayed in the sandbox
- spot the tool eating the most context
- confirm context-mode is actually running
- decide whether to clear the knowledge base with ctx_purge
Example prompts for the agent
- Show me the context savings stats for this session
- How many tokens did context-mode save, broken down by tool?
- Print the full ctx_stats tables, don't summarise them
How to install ctx-stats
1Skills CLI (Vercel)
npx skills add mksglu/context-mode --skill ctx-stats -a claude-code2Manually: put the files in place
~/.claude/skills/ctx-stats/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/ctx-stats/
1Skills CLI (Vercel)
npx skills add mksglu/context-mode --skill ctx-stats -a codex2Manually: put the files in place
.agents/skills/ctx-stats/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add mksglu/context-mode --skill ctx-stats -a cursor2Manually: put the files in place
.cursor/skills/ctx-stats/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install mksglu/context-mode ctx-stats2Manually: put the files in place
.github/skills/ctx-stats/SKILL.md1Skills CLI (Vercel)
npx skills add mksglu/context-mode --skill ctx-stats -a gemini-cli2Platform CLI
gemini skills install https://github.com/mksglu/context-mode --path skills/ctx-statsManually: put the files in place
.devin/skills/ctx-stats/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add mksglu/context-mode --skill ctx-stats -a opencodeClaude.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 ctx-stats
How do I install ctx-stats in Claude Code?
Run npx skills add mksglu/context-mode --skill ctx-stats -a claude-code. The skill file lands at ~/.claude/skills/ctx-stats/SKILL.md.
What does ctx-stats do?
It calls the mcp__context-mode__ctx_stats MCP tool and shows token consumption, the context savings ratio and a per-tool breakdown for the current session.
Can ctx-stats clear the knowledge base?
No, it only reads stats. Wiping indexed content is done with ctx_purge(confirm: true) or the /context-mode:ctx-purge command.