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

smartctx

v0.3.0

Published

Smart context manager for AI coding assistants — saves millions of tokens by building a local memory of your project

Downloads

70

Readme

smartctx 🧠

Save millions of tokens per day by giving AI coding assistants smart, curated context instead of your whole codebase.

The Problem

Every time you start a Claude Code / Cursor / Copilot session, it reads your entire project — hundreds of files, thousands of lines. That's hundreds of thousands of tokens, every single session.

The Solution

smartctx builds a local memory of your project once, then gives AI tools only the files relevant to your current task.

Without smartctx:  Claude reads 500 files = ~800,000 tokens per session 😬
With smartctx:     Claude reads 8 files   = ~12,000 tokens per session  ✅

Savings: ~98% token reduction

Install

# npm
npm install -g smartctx

# pip
pip install smartctx

# Homebrew (macOS/Linux)
brew tap Abdullahbutt-143/smartctx
brew install smartctx

# Scoop (Windows)
scoop bucket add smartctx https://github.com/Abdullahbutt-143/scoop-smartctx
scoop install smartctx

Quick Start

# 1. Set your API key (one time, saved globally)
smartctx config --api-key sk-ant-xxxxx

# 2. Initialize your project (one-time scan)
cd your-project
smartctx init

# 3. Before each AI session, query for your task
smartctx query "add authentication middleware"
# → generates CLAUDE.md with only the relevant files

# 4. Start Claude Code — it reads the lean CLAUDE.md
claude

Commands

| Command | Description | |---------|-------------| | smartctx init | First-time setup — scans and summarizes all files | | smartctx sync | Refresh changed files only (run daily/weekly) | | smartctx query "task" | Generate lean context file for your task | | smartctx status | Show index stats | | smartctx config | View/set configuration |

Multi-AI Support

smartctx query "add auth" --for claude    # → CLAUDE.md
smartctx query "add auth" --for cursor    # → .cursorrules
smartctx query "add auth" --for copilot  # → .github/copilot-instructions.md
smartctx query "add auth" --for codex    # → AGENTS.md

How It Works

  1. init — Scans your project, calls Claude Haiku (cheapest model) once per file to generate a summary. Saves everything to .smartctx/index.json locally.

  2. sync — Detects changed files (by modification time) and only re-summarizes those. Free for unchanged files.

  3. query — Runs a local keyword search (zero API cost) over your summaries. Finds the top 10 most relevant files. Generates a lean context file.

  4. AI Session — Your AI tool reads a 5-15k token context file instead of your 500k+ codebase.

Cost

  • Init: ~$0.0004 per file (Claude Haiku pricing) — a 100-file project costs ~$0.04 total
  • Sync: Only pays for changed files — usually free
  • Query: $0.00 — runs locally
  • Daily use: $0.00

Works With

  • ✅ Node.js / TypeScript projects
  • ✅ Python projects
  • ✅ Go, Rust, Java, any language
  • ✅ Any file-based project

Configuration

smartctx config --api-key sk-ant-xxxxx    # Set API key
smartctx config --target cursor           # Default output format
smartctx config --schedule weekly         # Reminder schedule

.gitignore

Add .smartctx/ to your .gitignore (it's project-specific local data):

.smartctx/
CLAUDE.md

License

MIT