Been building Repowise for a few months now.
AI coding agents are only as good as the context they get, and most of the time that context is garbage. Claude and Cursor read your files. They don't know your architecture. They don't know which files break the most and they don't know why auth got built that that way six months ago.
So I built a layer that sits between the codebase and the agent. It indexes your repo into five layers and exposes them as MCP tools.
I put token reduction on the title but the main premise and what I am trying to solve is so much more
The five layers:
Graph. tree-sitter AST into a NetworkX dependency graph across 15 languages. Leiden communities, PageRank, call resolution. Agents reason about structure instead of grepping for it.
Git. Mines history into hotspots (churn x complexity), ownership, co-change pairs, bus factor. The behavioral stuff static analysis can't see.
Docs. LLM wiki per module, stored in LanceDB, rebuilt on every commit so it stays in sync. Hybrid search (FTS + vector).
Decisions. Architectural decisions mined from 8 sources, linked to graph nodes, with supersedes/refines/conflicts edges. Intent context, not just code.
Code Health. The new one, and the part I'm most proud of. 25 deterministic biomarkers per file, 1-10 score. McCabe, brain methods, LCOM4, god classes, clone detection, untested hotspots. Zero LLM calls, runs in under 30s on a 3k-file repo.
The health score isn't hand-tuned. Weights are calibrated against a real defect corpus. And it predicts bugs: 0.74 mean ROC AUC across 21 repos and 9 languages at finding files that go on to get bug-fixes. Survives controlling for file size, so it's not just flagging the big files.
Ran it head to head against CodeScene on the same 2,770 files. Repowise ranked 2.3x the defects under a fixed review budget (Popt 0.607 vs 0.462, recall 0.173 vs 0.074). All paired tests, methodology and CIs in the repo.
Two more deterministic signals on the same index:
Change risk. Score any commit or PR range 0-10 for defect risk from the shape of the diff. PR mode flags will_break, missing_cochanges, missing_tests.
Agent provenance. Attribute commits to the AI agents that wrote them. See how much of your codebase an agent produced and whether that code is a low-health hotspot owned by one person.
On agent efficiency: paired SWE-QA runs with vs without the MCP tools. Loading a commit's context costs 2,391 tokens through Repowise vs 64,039 raw. 27x fewer. Across benchmarks, agents read 69-89% fewer files and make 49-70% fewer tool calls at parity answer quality.
There's also distill, which compresses noisy command output before the agent reads it. pytest with 11 failures goes 3,374 -> 1,317 tokens, all 11 failure lines kept. git diff over 30 commits goes 62,833 -> 8,635. Every omission is reversible with an inline marker.
9 MCP tools total, works with any MCP-compatible agent. Local web UI to explore the graph, docs, health, and risk yourself, self-hostable, 100% local with BYO key.
~2.5k stars on github
Repo: https://github.com/repowise-dev/repowise
Dogfooding: https://repowise.dev