cache-stats

cache-stats is a command for Claude Code from smrafiz/claude-supercharger. It costs 0 tokens per session (409 once invoked), scanned A, original, MIT.

A command that reports the state of cached results for type checking and quality checks.

In plain words
What is it for?
Use it to inspect cache files across projects and identify stale or unreadable entries.
Why use it?
It shows how many cached entries exist, how many refer to missing files, and when the cache was last written.

Command for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_DATA} variable.

Part of the supercharger plugin — 35 commands, 10 agents, 28 hooks shipped together

Good fit Use it to inspect cache files across projects and identify stale or unreadable entries.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/smrafiz/claude-supercharger/cache-stats
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/smrafiz/claude-supercharger

Made for: Claude Code.

Or install supercharger, the plugin that ships this one along with the rest of its 35 commands, 10 agents, 28 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cache-stats

README.md
[![agentmods](https://agentmods.dev/badge/commands/smrafiz/claude-supercharger/cache-stats.svg)](https://agentmods.dev/commands/smrafiz/claude-supercharger/cache-stats)
Your own site
<a href="https://agentmods.dev/commands/smrafiz/claude-supercharger/cache-stats"><img src="https://agentmods.dev/badge/commands/smrafiz/claude-supercharger/cache-stats.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 409 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00409
Opus 5 $0.00000 $0.00204
Sonnet 5 $0.00000 $0.00082
Haiku 4.5 $0.00000 $0.00041

Measured 7d ago against content hash f8d18fb9f918, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

cache-stats scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/cache-stats.md · 42 lines

What it actually says

Show hook cache statistics for typecheck and quality-gate. Arguments: $ARGUMENTS

Run this inline Python to report cache state:

python3 << 'EOF'
import os, json, glob, time

scope = os.path.expanduser("${CLAUDE_PLUGIN_DATA}/scope")

def report_cache(label, pattern):
    files = glob.glob(os.path.join(scope, pattern))
    if not files:
        print(f"{label}: no cache files found")
        return
    total_entries = 0
    stale = 0
    for path in files:
        try:
            with open(path) as f:
                d = json.load(f)
            entries = len(d)
            dead = sum(1 for k in d if not os.path.exists(k))
            age_days = (time.time() - os.path.getmtime(path)) / 86400
            print(f"{label} [{os.path.basename(path)}]: {entries} entries, {dead} stale, last written {age_days:.1f}d ago")
            total_entries += entries
            stale += dead
        except Exception as e:
            print(f"{label} [{os.path.basename(path)}]: unreadable ({e})")
    print(f"  Total: {total_entries} entries, {stale} stale across {len(files)} project(s)")

report_cache("typecheck   ", ".typecheck-cache-*")
report_cache("quality-gate", ".quality-gate-cache-*")
EOF

After showing output, interpret it:

  • stale > 0: stale entries exist but will self-prune on next cache write — no action needed
  • no cache files: caches haven't been written yet (hooks haven't run a clean pass on any file)
  • age > 7d: cache may be for a project no longer active — mention it but don't delete
  • large entry count (>500): note it, suggest it's normal for large codebases
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 42 lines · 0 tokens per session scan A f8d18fb9f918

Subscribe to this mod's changes

cache-stats is a command published in the GitHub repository smrafiz/claude-supercharger (11 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 409 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.