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

repomap-llm

v0.1.0

Published

Generate a stable REPOMAP.md context file for any codebase — maximizes LLM KV-cache hits across requests.

Downloads

143

Readme

repomap

A stable context layer for your codebase. One file. Maximum LLM cache hits.

npm version npm downloads CI license node

npx repomap-llm init

That single command generates a REPOMAP.md at your repo root, installs a post-commit hook that keeps it fresh, and gives every LLM you use a permanent, cache-friendly context prefix for your codebase.

Why this exists

Every time you ask Claude / Cursor / Copilot for help, the model re-reads your repo from scratch. Context tokens get billed. Latency adds up. The same files get scanned hundreds of times per week.

repomap-llm writes one structured markdown file that describes your project — overview, tech, architecture, modules, dependencies, co-changes, recent activity — and orders sections from most stable → most volatile.

Drop it at the start of every system prompt. The inference engine's KV cache fires after the first call. Every subsequent request reuses the prefix.

Result: ~90% cost reduction and ~80% latency reduction on repeated calls in the same repo.

How it works

┌─────────────────────────────────────────────────┐
│  REPOMAP.md  (stable → volatile, top to bottom) │
├─────────────────────────────────────────────────┤
│  ## overview        ◄── cached forever          │
│  ## tech            ◄── cached across commits   │
│  ## architecture    ◄── cached across commits   │
│  ## patterns        ◄── cached across commits   │
│  ## modules         ◄── changes occasionally    │
│  ## dependencies    ◄── changes occasionally    │
│  ## co-changes      ◄── changes per commit      │
│  ## hot-zones       ◄── changes per commit      │
│  ## recent          ◄── changes per commit      │
└─────────────────────────────────────────────────┘
        │
        └─► When you commit, only the suffix changes.
            The KV cache stays warm across requests.

A post-commit git hook regenerates the file in the background after each commit. Zero manual upkeep.

Commands

| command | what it does | |---|---| | npx repomap-llm init | First-time setup. Generates the file + installs the post-commit hook. | | npx repomap-llm | Regenerate REPOMAP.md (default command). | | npx repomap-llm watch | Auto-regenerate on file changes (debounced 800ms). | | npx repomap-llm status | Show health: file age, token count, hook status. |

What the output looks like

---
repomap: 1.0
generated: 2026-04-26T08:13:59Z
repo: vraj00222/repomap
files: 17
tokens: ~1131
---

## overview
A stable context layer for your codebase. Built with TypeScript.
Contains 17 source files across the tracked directories.

## tech
- language: TypeScript
- framework: Next.js
- package_manager: npm
- test_runner: vitest
- node_version: >=18

## architecture
- `src/` — application source code
- `tests/` — test suites

## patterns
- file_naming: kebab-case
- module_style: ESM TypeScript

## modules
| path | exports | purpose | stability |
|---|---|---|---|
| `src/cli.ts` | `main` | CLI entry point | 5 |
| `src/analyzer/index.ts` | `analyzeRepo` | Walk the repo and parse files | 3 |
...

## dependencies
- `src/cli.ts` → `src/commands/init.ts`, `src/commands/generate.ts`
- `src/commands/init.ts` → `src/hooks/install.ts`

## co-changes
- `src/auth/login.ts` ↔ `src/auth/session.ts` (12 commits together)

## hot-zones
- `src/api/handler.ts` (8 commits)

## recent
| hash | author | message | files |
|---|---|---|---|
| abc1234 | jane | fix login redirect | 3 |

Works with

Configuration

Drop a repomap.config.json at your repo root, or add a repomap field to your package.json. Every option has a sensible default — only set what you want to override.

{
  "include": ["src/**", "app/**", "lib/**"],
  "exclude": ["**/*.test.*", "**/node_modules/**"],
  "maxTokens": 8000,
  "maxFiles": 500,
  "stableThreshold": 2,
  "output": "REPOMAP.md",
  "languages": [],
  "coChangeLookback": 90,
  "commitFlag": false
}

| option | default | description | |---|---|---| | include | ["src/**","app/**","lib/**","pages/**"] | Globs of files to analyze | | exclude | sensible defaults | Globs to skip (always skips node_modules, dist, build, .next, __pycache__) | | maxTokens | 8000 | Token budget — volatile sections are dropped first when exceeded | | maxFiles | 500 | Hard cap on files analyzed (prevents runaway on monorepos) | | stableThreshold | 2 | Files with fewer commits in the lookback window count as "stable" | | output | REPOMAP.md | Output filename | | languages | auto | Subset of ["ts","js","py","go","rs"]; empty = auto-detect | | coChangeLookback | 90 | Days of git history used for the co-change graph and hot-zones | | commitFlag | false | If true, REPOMAP.md is committed (not gitignored) |

Install

# recommended
npx repomap-llm init

# global
npm install -g repomap-llm

# project-local
npm install --save-dev repomap-llm

Requires Node ≥ 18. Works on macOS, Linux, and Windows.

FAQ

Contributing

PRs welcome. The codebase is small and well-tested.

git clone https://github.com/vraj00222/repomap
cd repomap
npm install
npm test

License

MIT © vraj