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

code-memory-router

v1.0.0

Published

Claude Code skill that routes code and memory queries between MemPalace (project memory) and QMD (codebase search), fusing both when the question spans code and decisions.

Readme

code-memory-router

code-memory-router banner

A Claude Code skill that routes memory and retrieval tasks to the right tool — MemPalace for project memory, QMD for codebase search.


The problem

Without routing guidance, Claude defaults to grep for everything — even questions like "why did we build it this way?" or "what did we decide last week?". That burns tokens, misses the answer, and ignores the memory systems you set up.

The solution

This skill teaches Claude:

  • WHERE something is in code → use QMD (hybrid BM25 + semantic search)
  • WHY something exists or was decided → use MemPalace (persistent project memory)
  • BOTH → combined flow, code-first or history-first depending on the question

Benchmark

Tested on 3 real tasks across 6 parallel runs (with skill vs without):

| Task | With skill | Without skill | |------|-----------|---------------| | Find WebSocket disconnect handler in Rust backend | 4/4 ✅ | 1/4 ❌ | | Why did we switch from SSE to WebSocket? | 4/4 ✅ | 1/4 ❌ | | Show AI chat entry point + architecture decisions | 5/5 ✅ | 2/5 ❌ | | Total | 13/13 | 4/13 | | Avg tokens (memory tasks) | 36k | 58k (+61%) | | Avg time (memory tasks) | 175s | 339s (+94%) |

Without the skill, agents missed MemPalace entirely on every memory task — burning 61% more tokens to find the same answer via brute-force grep.


Requirements

  • QMD — codebase indexer with hybrid search
  • MemPalace — persistent AI memory

Both must be installed and indexed. See references/setup-guide.md.

Install

Universal (works with Claude Code, Cursor, Codex, Gemini CLI, and 40+ agents):

npx skills add OthmanAdi/code-memory-router

Or from npm: pi install npm:code-memory-router (package)

Claude Code only:

claude skills install github:OthmanAdi/code-memory-router

Usage

Once installed, the skill triggers automatically on relevant queries. No slash command needed.

Triggers on: "where is X", "find X in the code", "what did we decide about X", "why does X work this way", "show me X and why we built it", "what's in the handoffs about X"

You can also trigger it explicitly:

/code-memory-router find the authentication middleware
/code-memory-router what was the decision behind the streaming architecture?

How it routes

User question
     │
     ├─ WHERE is X? ──────────────────────► QMD (codebase search)
     │                                        qmd query "..."
     │
     ├─ WHY was X built? ─────────────────► MemPalace (project memory)
     │                                        mempalace search "..."
     │
     └─ HOW does X work + WHY? ──────────► Combined
                                             QMD → MemPalace (code-first)
                                             MemPalace → QMD (history-first)

Both MCP tools (mcp__qmd__*, mcp__mempalace__*) and CLI fallbacks are supported.

Skill structure

code-memory-router/
├── SKILL.md                          — routing logic + execution paths
├── references/
│   ├── tool_selection.md             — routing heuristics + examples
│   └── setup-guide.md                — how to index your project
└── scripts/
    └── inspect_embedding_metadata.py — auto-detects QMD/MemPalace config

License

MIT