npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mbeato/contextscope

v0.3.2

Published

Local dashboard auditing Claude Code's per-turn token context (skills, agents, commands, CLAUDE.md, MEMORY.md, hooks, MCP) with toggle-based disable and session analytics.

Readme

contextscope

A CLI + local dashboard that audits the per-turn token context Claude Code loads on every conversation turn — and gives you toggle-based control to disable what you don't use.

/stats, /cost, and ccusage show aggregate spend. None of them break down what's inside the per-turn baseline or let you act on the audit. At 1M-context Opus, every unused skill, agent, command, or hook output that lives in the available-list block is paying full cache-read cost on every turn — for a heavy user, that's hundreds of millions of tokens per month.

Quick look (CLI)

npx @mbeato/contextscope

Prints a 30-day audit to stdout in ~3s. Per-turn baseline, 30-day burn + API-equivalent cost, top disable candidates, context overhead. No browser, no server.

Full dashboard (browser)

npx @mbeato/contextscope ui

Picks a free port starting at 3939, opens your browser. Adds: toggle-to-disable buttons, per-session drilldown, daily burn graph, by-project breakdown, hook + MCP detail.

Or install globally so the contextscope command stays around:

npm install -g @mbeato/contextscope
contextscope        # quick CLI summary
contextscope ui     # dashboard

Flags (ui only):

  • --port <n> — pin a port
  • --no-open — don't auto-open the browser
  • --help — full usage

Optional: Claude Code slash command

After installing globally, run:

contextscope install-plugin

This copies a /usage slash command into ~/.claude/commands/usage.md. Restart Claude Code, then /usage in any session asks Claude to launch the dashboard in the background and report the URL. Remove with contextscope uninstall-plugin.

What it shows

  • Skills, agents, slash commands (user + plugin) — per-turn description cost + body cost on invocation
  • CLAUDE.md (global + every project) + MEMORY.md (per-project auto-memory) — full token count, where loaded
  • SessionStart + UserPromptSubmit hook output — dry-run with sample input, output tokenized
  • MCP servers — direct + PTC-proxied downstream
  • Session analytics — top expensive sessions, daily burn, cache hit ratio, output:input ratio, p75/p95
  • Invocation counts per skill/agent over the last 30 days from JSONL transcripts
  • Recommendation engine — bulk-disable unused user items in one click, surface long-session patterns

What it does

  • Toggles individual user-level skills / agents / commands (renames file with .disabled suffix — reversible)
  • Toggles whole plugins (flips enabledPlugins[<plugin>@<marketplace>] in ~/.claude/settings.json)
  • Backs up settings.json before every mutation (~/.claude/settings.json.usage-bak-<timestamp>, 5 most recent kept)
  • Bulk-disables every user item never invoked in the last 30 days

Toggles take effect on the next Claude Code restart — CC reads skills, agents, commands, and settings.json at startup. There's no hot-reload mechanism.

Known constraint

Plugin-bundled skills/agents (e.g. superpowers:brainstorming, gsd:plan-phase) cannot be individually disabled in Claude Code's current model — you can only toggle the whole plugin. The "By plugin" table handles this; individual plugin items in the main table show (plugin) as their toggle status.

How it measures tokens

Uses js-tiktoken with the cl100k_base encoder as a proxy for Anthropic's tokenizer (not publicly released). Expect ~5–10% absolute deviation; relative rankings should be accurate.

What it can't measure

  • The base Claude Code system prompt (built into the binary)
  • Tool-call results that compound mid-session
  • The available skills / available agents wrapper blocks the harness adds around your descriptions

Development

git clone <repo> contextscope
cd contextscope
npm install
npm run dev       # localhost:3000 — slow page loads from Next.js dev bundling
npm run prod      # build + start in production mode — ~0.6s warm reload

Requires Node 18+. macOS/Linux paths; Windows untested but uses os.homedir() throughout.

Architecture

  • lib/transcripts.ts — unified single-pass JSONL parser with per-file mtime cache; consumed by usage.ts + sessions.ts
  • lib/inventory.ts — scans skills, agents, commands; detects .disabled siblings; reads enabledPlugins
  • lib/usage.ts — invocation counts per skill/agent from transcripts
  • lib/sessions.ts — per-session token aggregation + summary stats
  • lib/files.ts — CLAUDE.md + MEMORY.md scanner with denylist for dependency-bundled noise
  • lib/hooks.ts — reads settings.json hooks, parallel dry-runs SessionStart + UserPromptSubmit
  • lib/mcp.ts — reads .claude.json mcpServers, parses PTC's downstream config.yaml
  • app/actions.ts — server actions for toggles + bulk disable; backs up settings before write
  • app/page.tsx — single server-rendered page; filesystem re-read on every load (cached internally)
  • bin/cli.js — CLI entry: routes to summary.js (default) or launches the Next.js dashboard (ui subcommand)
  • bin/summary.js — pure-JS CLI summary; mirrors the lib/* logic without Next.js for the fast first-impression printout

License

MIT