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

@ctxlite/mcp

v0.1.34

Published

ctxlite MCP server for Cursor editor and Cursor agent CLI

Readme

ctxlite

Token optimizer for OpenCode, Cursor, and Claude Code — automatic context optimization + stats reporting.

CI npm License: MIT + Commons Clause Sponsor on Ko-fi

If ctxlite is saving you tokens, consider supporting the project on Ko-fi.

How it works

ctxlite reduces tokens at several points in a session: quieter command flags and blocked low-signal reads before a tool runs, output compression and symbol-only file reads after, duplicate/stale context pruning before each request, BM25-based relevant-file selection, and conciseness instructions for the model's own output.

Which of these run automatically vs. on demand depends on what each tool's plugin/hook API actually allows — see the table below.

| | Automatic (no action needed) | On demand (agent calls a tool) | |---|---|---| | OpenCode | pre-call rewrite, output compression, context pruning, conciseness, sidebar widget + toast + session title | get_stats, trim_context, smart_read | | Claude Code | pre-call rewrite (Bash quiet flags, blocked reads), output compression — via hooks | get_stats, trim_context, smart_read (MCP) | | Cursor | pre-call rewrite only — Cursor's hooks can't rewrite output for built-in tools, so output compression has no automatic path here | get_stats, trim_context, smart_read (MCP) | | Claude Desktop | — (no hook/plugin API) | get_stats, trim_context, smart_read (MCP) |

Add a project-root .ctxliteignore (gitignore-style patterns) to block reads and trim_context candidates from project-specific generated/vendor paths that aren't already covered by ctxlite's built-in blocked-path list — see the format reference.

Install

OpenCode

npx @ctxlite/cli install --tool opencode --scope global --yes

Registers the plugin (~/.config/opencode/opencode.json) and the sidebar widget (tui.json). Restart OpenCode.

Claude Code

npx @ctxlite/cli install --tool claude-code --scope global --yes

Registers the MCP server (~/.claude.json) and the PreToolUse/PostToolUse hooks (~/.claude/settings.json) — two separate files, both written.

Cursor

npx @ctxlite/cli install --tool cursor --scope global --yes

Registers the MCP server (~/.cursor/mcp.json) and the preToolUse hook (~/.cursor/hooks.json).

Claude Desktop

npx @ctxlite/cli install --tool claude-desktop --scope global --yes

MCP only — Claude Desktop has no plugin/hook API.

Interactive installer (pick tools + global/project scope)

npx @ctxlite/cli install

Use --scope project to scope any of the above to the current repo instead of your whole machine, and --remove to undo.

Viewing stats

All surfaces read from the same ~/.ctxlite/stats.db, so the CLI shows combined totals no matter which tool generated the savings.

From any terminal:

npx @ctxlite/cli stats
npx @ctxlite/cli stats --last 7d
npx @ctxlite/cli stats --export json

OpenCode: the sidebar widget shows live savings the whole session — no action needed. You can still ask in chat:

You: how much has ctxlite saved this session?

Claude Code: ask in chat — the agent calls the get_stats MCP tool:

You: show me ctxlite's token savings for the last 7 days

Cursor: same as Claude Code — ask in chat and the agent calls get_stats:

You: how much has ctxlite saved on this project?

If the agent doesn't reach for get_stats on its own, ask explicitly: "use the ctxlite get_stats tool."

Packages

| Package | Description | |---|---| | @ctxlite/opencode | OpenCode plugin (server + TUI sidebar) | | @ctxlite/mcp | MCP server for Cursor, Claude Code, Claude Desktop | | @ctxlite/core | Shared logic (BM25, tree-sitter symbol extraction, stats) | | @ctxlite/cli | CLI for stats, install, and the Claude Code / Cursor hook bridge |

Go proxy (legacy)

The Go binary in go/ provides an HTTP proxy with L1/L2 caching for Cursor and Claude Code — an earlier architecture, superseded by the plugin/MCP/hooks approach above.
See docs/configuration.md and docs/architecture.md.

Contributing

See docs/contributing.md.

License

  • v0.1.0 – v0.1.25: plain MIT, permanently (already published, not retroactively changed).
  • v0.1.26 and later: MIT with the Commons Clause condition — free to use, modify, and run for any purpose, including commercial/internal use at a company. What requires a separate commercial license: reselling or rebranding ctxlite itself (or a derivative whose value comes substantially from it) as a competing product or service.

See LICENSE for the full text.