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

@n50/agent-entropy-scanner

v0.1.0-alpha.0

Published

Measure citation entropy in multi-agent codebases. Counts agent files that no other code in the same repo imports or spawns. High % = high technical debt — files exist but nothing reaches them.

Readme

@alef-prime/agent-entropy-scanner

Measure citation entropy in a multi-agent codebase. One CLI command. Mechanical, reproducible, opinionated about nothing — just counts.

npx @alef-prime/agent-entropy-scanner /path/to/repo

What it measures

For each agent file (any *.mjs|*.ts|*.py inside agents/, tools/, skills/, etc.), counts how many other files in the same repo reference it — by import, require, spawn, exec, or string-stem match.

Citation entropy = % of agent files with zero downstream references. They exist in the repo but nothing reaches them. They are either dead code, undocumented dependencies, or files staged for future use that never landed.

Why this matters

A multi-agent system that grows past N=50 agents will accumulate "ghost agents" — files that compile, files that no other file imports, files that nobody remembers writing. They survive because nothing breaks if they're there, but they expand the surface for bugs, security drift, and code review fatigue.

This scanner measures the rate.

Origin

The metric was first observed in ALEF, an autonomous engine maintaining the public catalog at n50.io/patterns. At time of v0.1.0-alpha:

  • ALEF had 241 agent files
  • 199 of them (82%) had zero downstream references
  • The number was found by running the precursor script mutation_pressure.mjs on the engine's own source

The hypothesis worth testing: is 82% an ALEF-specific artifact, or do multi-agent codebases in general accumulate this kind of debt? You can test the hypothesis on any agent codebase you have access to:

git clone https://github.com/<repo>
cd <repo>
npx @alef-prime/agent-entropy-scanner .

Output

agent-entropy-scanner v0.1.0-alpha.0
repo: my-agent-project
scanned: 1247 files · 89 agent files · 312ms

  Citation Entropy: 62%
  ███████████████████████████████░░░░░░░░░░░░░░░░░░░
  55 / 89 agent files have ZERO downstream references.

interpretation:
  0-30%      healthy — agents are well-connected
  30-60%     moderate technical debt
  60-100% ← you  high entropy — many "dead" or undocumented agent files

top 5 no-citation files (candidates for tombstone review):
  agents/legacy_planner.mjs
  agents/tool_dispatcher_v2.mjs
  ...

top 5 well-cited (architectural anchors):
  agents/router.mjs · 47 references
  ...

CI integration

# Fail CI if entropy is above 70%
npx @alef-prime/agent-entropy-scanner . --threshold 70
echo $?   # 0 if pass, 1 if entropy% > threshold

JSON output for tooling

npx @alef-prime/agent-entropy-scanner . --json | jq '.citation_entropy_pct'

Methodology — be skeptical

The scanner uses mechanical string matching. It does not understand:

  • Dynamic imports computed at runtime
  • File-system-based plugin loaders
  • Conditional spawning based on user input

So citation_entropy is an over-estimate of dead code. A file with 0 references in source may still be reachable via runtime mechanisms. Treat the number as a starting point for investigation, not a verdict. The scanner's job is to surface candidates, not to decide.

Reproducibility

Any third party can clone any public repo and run this scanner. The number is deterministic modulo file-system encoding and case-sensitivity. If two scans of the same SHA produce different numbers, it's a bug — file an issue.

Roadmap

  • v0.2: smarter heuristics for dynamic loaders (registry patterns, plugin systems)
  • v0.3: language-specific scanners (Python AST, TS compiler API) instead of regex
  • v0.4: longitudinal mode (git log → entropy% over time)

License

MIT. Fork it, modify it, redistribute it. Citation appreciated but not required.

Citing

If you use this in research or in a public claim:

ALEF Pattern Catalog. Agent Entropy Scanner v0.1. n50.io/patterns. CC-BY-4.0.

Origin essay

The full case for why this metric matters is at: n50.io/patterns