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

@mrclrchtr/supi-context

v1.14.1

Published

SuPi Context extension — detailed context usage report via /supi-context command

Readme

@mrclrchtr/supi-context

Adds a /supi-context command to the pi coding agent so you can inspect how the current session is spending its context window.

Install

pi install npm:@mrclrchtr/supi-context

For local development:

pi install ./packages/supi-context

Context usage report

What you get

After install, pi gets one user command:

  • /supi-context — render a detailed context-usage report for the current session
  • /supi-context full — render the same report with the full guideline and tool-definition lists instead of previews

The command sends a custom supi-context message, and this package registers a dedicated renderer so the report shows up as a structured TUI view instead of plain text.

What the report shows

The report is meant to answer questions like:

  • what is taking up space in the current context window?
  • how much room is left before compaction pressure gets worse?
  • which instruction files, context files, skills, guidelines, or tools are expensive?
  • what extra context was injected by other SuPi extensions?

It includes:

  • model name, context-window size, and total token usage
  • approximation or pending-usage notes when exact usage data is not available yet
  • a visual usage bar for system prompt, user messages, assistant messages, tool calls, tool results, other, autocompact buffer, and free space
  • a category breakdown table for the same usage buckets
  • a system-prompt composition breakdown for:
    • base prompt content
    • instruction files (AGENTS.md, CLAUDE.md, etc.)
    • other context files loaded into the system prompt
    • active skills
    • guidelines
    • tool snippets
    • append text
  • instruction-file details with token cost, line count, and detected origin (project vs global)
  • injected subdirectory context files from supi-claude-md, including turn number, line count, and token cost
  • active skill names with per-skill token counts
  • guideline bullet previews, plus source attribution for PI defaults, known built-in tools (read, write, edit), and other
  • active tool definitions with per-tool definition token counts and snippet-token columns when available
  • a compaction note when older turns were summarized
  • extra provider sections from extensions registered through the shared context-provider registry in @mrclrchtr/supi-core

Configuration

No settings are required.

This package does not add a model-callable tool; it adds a user command only.

Notes

  • The command uses the latest cached systemPromptOptions captured during before_agent_start.
  • If those prompt options are missing or incomplete, the package backfills context files and skills by re-parsing the current system prompt.
  • Exact totals come from pi's current context-usage data when available. Otherwise the report falls back to rough estimates and/or scales estimated category totals to the latest measured total.
  • If no model is selected yet, the report can still render, but the context-window bar cannot show capacity.

Source

  • src/context.ts — command registration, cached prompt-option handling, and renderer wiring
  • src/analysis.ts — token accounting, attribution, and report data assembly
  • src/format.ts — report orchestration for the TUI view
  • src/format-helpers.ts — shared numeric and category helpers for report rendering
  • src/format-summary.ts — summary, usage bar, category, and composition sections
  • src/format-sections.ts — instruction file, context file, skill, guideline, tool, compaction, and provider sections
  • src/prompt-inference.ts — fallback recovery of context files, skills, and guideline sections from the live system prompt
  • src/renderer.ts — custom renderer for supi-context messages
  • src/utils.ts — token and plural-format helpers

Tests live under __tests__/unit/.