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

knowcards

v0.2.0

Published

Filesystem-first knowledge cards for coding agents — durable facts reinjected as trusted memory

Readme

Knowcards

Local-first durable facts for coding agents, reinjected as trusted memory

"A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E." — Tom Mitchell

Alpha — this package is early. The API and host hook shapes may change.

npm version npm Node Claude Code Codex Cursor license

Highlights · Quick start · Agent protocol · How it works · Benchmarks · Docs


Highlights

Knowcards = project-local markdown facts + automatic inject/reflect on supported hosts.

  • Filesystem-first — cards are plain markdown under .agents/knowledge_cards. No DB, no vectors.
  • Trusted memory — hits are preferred over rediscovery or a conflicting README unless the card is stale.
  • Host edgesinstall wires Claude Code / Codex / Cursor hooks; CLI and MCP remain for manual use.

Coding agents forget between sessions. They re-grep the tree, re-read the README, and still miss the constraint that mattered last time. That wastes tokens and wall clock — and fails when the workspace is wrong.

Knowcards keeps those facts as local cards and reinjects them. The agent prefers the card unless new evidence shows it is wrong.


Quick start

# Install automatic inject + reflect hooks (pick your host)
npx knowcards install cursor
npx knowcards install claude-code
npx knowcards install codex

# Write a durable fact (creates dirs if needed)
npx knowcards propose --title "JWT auth header" \
  "JWTs go in the Authorization header"

# Search the local card library
npx knowcards query jwt

# Show notebook paths and card counts
npx knowcards status

# MCP stdio server (for host config below)
npx knowcards mcp

Cards live at .agents/knowledge_cards/<notebook-id>/*.md:

---
title: Payment amounts are integer cents
---

Amounts are stored as integer cents; never use floating point for money.

Optional: put a custom reflection prompt in project-root REFLECT.md. If missing, knowcards uses the packaged default.

MCP

{
  "mcpServers": {
    "knowledge-cards": {
      "command": "npx",
      "args": ["knowcards", "mcp"]
    }
  }
}

Install the knowcards skill (or equivalent host instructions) so the agent can still query/propose mid-session without hooks.


Agent protocol

With hooks installed, inject and end-of-session reflect run automatically. The manual loop still works:

  1. Before actingnpx knowcards query "<keywords>" (or the MCP tool). Skip only for routine edits in code you already hold.
  2. Apply hits — Prefer card facts. Verify against the repo when a card may be old.
  3. Propose at end — Write durable facts from the outcome (what proved true), not the path you took. One atomic fact per card.

Do not propose plans, unverified guesses, or near-duplicates. Query first; if a card already covers it, skip.


How it works

first prompt → retrieve → inject
session stop → reflect follow-up → agent proposes cards
propose → store (markdown) → loadAll → retrieve → inject → host

| Step | What happens | | ---- | ------------ | | Install | knowcards install merges host hooks (Claude Code / Codex / Cursor) | | Inject | On the user prompt, retrieve relevant cards and inject titles (query or MCP for full text) | | Reflect | On Stop, the host continues in the same session so the agent can propose cards. Claude Code wakes after the turn (asyncRewake). Cursor and Codex continue synchronously (host limit). | | Propose | Write one fact worth keeping as a card (CLI, MCP, or reflect turn) | | Store | One markdown file per card under .agents/knowledge_cards/<notebook>/ | | Load | Full library loads into memory when the process starts | | Retrieve | Rank cards for the current query (MiniSearch) | | Prefer | Agent treats cards as earned memory over README/rediscovery |

Knowcards does not bundle an LLM — the primary agent always proposes cards.

Product

Two boxes:

  • Memory owns the units and the ops: init, ingest (store), storage, retrieve, maintain, reflect (extract / promote).
  • Adapters are how a host uses memory: hooks, plugin, MCP. knowcards install wires hooks only.

Only L1 (knowledge cards) is in code today.

                 ▲
                /L3\     weights
               /----\
              /  L2  \   compiled: procedural skill · wiki · graph
             /--------\
            /    L1    \ atomic units (knowledge cards)
           /------------\
          /      L0      \ chats (host sessions; we do not store these)
         ----------------

Reflect extracts from the layer below and writes the layer above:

  1. Reflect to build cards (v0) — the live chat is the source. Stop continues the session with a reflect prompt. The agent ingests cards via propose.
  2. Reflect to build a procedural skill (later) — cards that describe a repeat procedure compile into an L2 skill.

Ingest is how you store a unit at the current layer (propose today). Init is a first fill for a new repo (for example, onboard and build a first wiki). Init is not wired; propose still creates card dirs. The CLI init command is hidden.

Code layout

  • src/core/ and src/lifecycle/ — memory (cards, retrieve, ingest, reflect prompt)
  • src/adapters/ — host hook envelopes (Claude Code / Cursor / Codex)
  • src/mcp/ and src/cli/ — memory API; install is adapter wiring

Benchmarks

On Continual Learning Bench, knowledge cards beat ICL, ACE, and Mem0 in early matched runs (PR).

Harbor A/B uses four SWE-bench Verified instances (pytest, requests, pylint, sphinx) with the official Harbor tests and oracle. See eval/README.md.

Harbor evals are the primary product judge for this slice (manual; not CI).


Docs

| Document | Contents | | -------------------------------- | --------------------------------------------- | | CONTRIBUTING.md | Setup, Harbor evals, how to contribute | | ROADMAP.md | Testable knobs and A/B hypotheses | | AGENTS.md | Conventions for agents working in this repo | | eval/README.md | Harbor A/B (bare Pi vs skill + CLI) | | skills/knowcards/SKILL.md | Agent skill: when to query / propose |

License

MIT. See LICENSE.

Author: mbajaj_