Original Reddit post

Claude Code treats your codebase as a pile of files. It has the source but doesn’t know how the source got there. So it rewrites a shared module without knowing what breaks, every time I’ve been building an open source MCP layer to fix this called repowise. Self-hosted, pip install, AGPL-3.0. It indexes your repo into five layers that sit between the codebase and the model: Graph - AST dependency graph. Knows what depends on what before it touches anything. Git - hotspots, ownership, co-change, bus factor. Tells the model “this file always changes with these three.” Docs - auto-generated wiki from your code. Searchable. Decisions - why the code is shaped the way it is. Stops the model from “fixing” stuff that was intentional. Code Health - 25 static biomarkers per file. Complexity, duplication, untested hotspots, declining trends. Zero LLM. Auto generated and up to date Claude.md, hooks that The code health score actually predicts bugs. We ran it across 21 open source repos in 9 languages. Score every file at an old commit, then count which files got bug-fixes over the next 6 months. No leakage. Mean ROC AUC 0.74, up to 0.90 on individual repos. It still holds after controlling for file size, so it’s not just flagging the big files. 9 MCP tools, built around tasks not files. I kept the count low deliberately. Claude won’t use an MCP tool unless it’s clearly faster than grep, so each tool returns complete context in one call instead of making the agent chain 5 of them It also generates a CLAUDE.md from the actual code and keeps it current on every commit, so the model isn’t reading a stale hand-written one. Hooks re-sync the index after edits. And distill wraps noisy commands like pytest or git log, strips the passing-test spam, and feeds the agent errors-first. Saves 60 to 90% of the tokens those commands dump into context Benchmarked on real repos with and without repowise: up to 70% fewer tool calls, 89% fewer file reads, 36% lower cost per query, answer quality at parity. 2.2K+ stars on GitHub. https://github.com/repowise-dev/repowise submitted by /u/Obvious_Gap_5768

Originally posted by u/Obvious_Gap_5768 on r/ClaudeCode