reponet
v0.2.1
Published
Social network analysis for code — a local MCP server for graph-mediated code intelligence
Maintainers
Readme
██████╗ ███████╗██████╗ ██████╗ ███╗ ██╗███████╗████████╗
██╔══██╗██╔════╝██╔══██╗██╔═══██╗████╗ ██║██╔════╝╚══██╔══╝
██████╔╝█████╗ ██████╔╝██║ ██║██╔██╗ ██║█████╗ ██║
██╔══██╗██╔══╝ ██╔═══╝ ██║ ██║██║╚██╗██║██╔══╝ ██║
██║ ██║███████╗██║ ╚██████╔╝██║ ╚████║███████╗ ██║
╚═╝ ╚═╝╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝ ╚═╝
social network analysis for codeWhy 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."

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 setupRestart 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
- Parse — Rust native addon parses source files with tree-sitter in parallel (Rayon thread pool)
- Extract — per-language extractors pull out symbols, calls, types, inheritance, decorators
- Resolve — Aho-Corasick single-pass cross-file resolution + hybrid type resolution for method calls
- Store — SQLite with WAL mode, every edge has provenance and confidence
- Analyze — graphology runs PageRank, Louvain, HITS, betweenness, smell detection, risk scoring
- 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 buildLicense
Apache 2.0
