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

reponet

v0.2.1

Published

Social network analysis for code — a local MCP server for graph-mediated code intelligence

Readme

         ██████╗ ███████╗██████╗  ██████╗ ███╗   ██╗███████╗████████╗
         ██╔══██╗██╔════╝██╔══██╗██╔═══██╗████╗  ██║██╔════╝╚══██╔══╝
         ██████╔╝█████╗  ██████╔╝██║   ██║██╔██╗ ██║█████╗     ██║
         ██╔══██╗██╔══╝  ██╔═══╝ ██║   ██║██║╚██╗██║██╔══╝     ██║
         ██║  ██║███████╗██║     ╚██████╔╝██║ ╚████║███████╗   ██║
         ╚═╝  ╚═╝╚══════╝╚═╝      ╚═════╝ ╚═╝  ╚═══╝╚══════╝   ╚═╝

                   social network analysis for code

Why this exists

When you ask an AI "what happens if I change this function?", it reads files. Lots of files. It greps, it cats, it scrolls through hundreds of lines looking for connections. Then it does it again for the next question. Every structural question costs thousands of tokens answering something that isn't really a reading comprehension problem — it's a graph problem.

"What calls this function?" is not a question about text. It's a question about relationships. The same way "who are this person's friends?" isn't answered by reading everyone's diary — you look at the social graph.

That's what RepoNet does. It builds a social network of your code — functions, classes, and types are people, imports and calls are relationships — and then runs the same algorithms that analyze real social networks. PageRank finds the most influential code. Community detection reveals the real module boundaries (which often don't match your folder structure). Bridge detection finds the functions where, if they break, two entire subsystems lose contact.

An AI with access to this graph can answer "what's the blast radius of changing this file?" in 500 tokens instead of reading 50 files at 10,000+ tokens. It can tell you "this function is a bridge between auth and billing — change it carefully" without ever opening the source. It understands architecture the way a senior engineer does: by knowing how things connect, not by memorizing every line.

Other tools build dependency graphs. RepoNet does social network analysis on top of them — and that's the difference between "here's a list of callers" and "here's why this function matters."


RepoNet analyzing Django's code network

200 of Django's 40,130 symbols — the most-connected subgraph. Node size = connection count. Color = community (Louvain). Red = god object. Green = authority. Interactive version (download and open locally to explore).


Get started

npm install -g reponet
reponet setup

Restart Claude Code. RepoNet is now available in every project, every conversation. It auto-indexes on first use.

What it does

18 tools an AI can call instead of reading source files:

| Graph tools | SNA tools | |------------|-----------| | graph_search_symbols — find by name/kind/path | sna_centrality — PageRank, betweenness, HITS | | graph_get_definition — where is this defined? | sna_communities — Louvain module discovery | | graph_find_references — who uses this? | sna_health — codebase health score (0-100) | | graph_get_callers — walk up the call chain | sna_roles — hub/authority/bridge/connector | | graph_get_callees — walk down the call chain | sna_bridges — critical coupling points | | graph_get_file_dependencies — imports | sna_smells — architectural smell detection | | graph_get_dependents — reverse imports | sna_risk — change risk scoring (0-100) | | graph_get_dependents — reverse imports | | | graph_shortest_path — how are A and B connected? | | | graph_temporal_coupling — git co-change analysis | | | graph_code_fetch — grab specific lines | | | graph_context_summary — module overview | |

Every tool returns explanations, not data dumps — the AI gets architectural reasoning, not raw JSON.

What makes it different

Other tools build dependency graphs. RepoNet does social network analysis.

PageRank — not "who has the most references" but "who is referenced by important things, recursively." A function called by the main request handler ranks higher than one called by a test utility, even if the test utility has more raw references.

Community detection — Louvain finds clusters of tightly-connected code that may not match your folder structure. When a detected community spans src/auth/, src/billing/, and src/user/, that's hidden coupling your directory tree doesn't show.

Noise filtering — naive PageRank on code graphs surfaces logger and config every time. RepoNet's three-layer filter (edge weighting, utility detection, pre-algorithm filtering) removes noise before running algorithms so scores reflect real architectural importance.

Role classification — every symbol gets a structural label: hub (orchestrator), authority (core logic), bridge (connects subsystems), connector, peripheral, or god-object. An AI reading "this function is a bridge between the auth and billing clusters" gets more insight than "this function has 12 callers."

Benchmarks

Tested on 6 open-source repos across 5 languages. Powered by a Rust native addon for parsing — up to 9x faster than v0.1.

| Repo | Language | LOC | Symbols | Edges | Index time | Health | |------|----------|----:|--------:|------:|-----------:|-------:| | express | JS | 21K | 530 | 66 | 0.06s | 60/100 | | fastify | TS | 75K | 1,584 | 466 | 0.16s | 74/100 | | flask | Python | 18K | 1,054 | 454 | 0.28s | 76/100 | | django | Python | 517K | 40,130 | 32,671 | 11s | 78/100 | | gin | Go | 24K | 1,520 | 678 | 0.08s | 77/100 | | tokio | Rust | 173K | 9,705 | 3,958 | 0.38s | 76/100 |

v0.2 with Rust native addon (NAPI-RS). v0.1 (WASM) indexed Django in 88s — v0.2 does it in 11s. Speed is competitive with codebase-memory-mcp (8s on Django) while providing 18 analysis tools they don't have.

Token efficiency: 98% weighted savings on structural queries vs. reading raw files. On 11 task-based evaluation questions, RepoNet averaged 432 tokens per answer vs. 20,783 for grep+read — with 74% recall.

Full results: benchmarks/RESULTS.md · task evaluation

Languages

TypeScript, JavaScript, Python, Go, and Rust. Adding a language means writing one extractor file and installing a tree-sitter grammar.

How it works

  1. Parse — Rust native addon parses source files with tree-sitter in parallel (Rayon thread pool)
  2. Extract — per-language extractors pull out symbols, calls, types, inheritance, decorators
  3. Resolve — Aho-Corasick single-pass cross-file resolution + hybrid type resolution for method calls
  4. Store — SQLite with WAL mode, every edge has provenance and confidence
  5. Analyze — graphology runs PageRank, Louvain, HITS, betweenness, smell detection, risk scoring
  6. Serve — MCP server exposes 18 tools over stdio

Falls back to WASM tree-sitter on platforms without the native addon. Incremental indexing. Git history mining. Three-layer noise filtering. All local, no cloud.

Development

git clone https://github.com/TannerTunstall/RepoNet.git
cd RepoNet
npm install
npm test        # 239 tests
npm run build

License

Apache 2.0