I scored every file in Hugo 1 to 10 for code health, then checked the 20 worst against the next 6 months of bug fixes. 17 of those 20 got a real fix, against a 15% base rate. The messiest 20% of files held about 60% of every recently bug-fixed file. It holds beyond Hugo. Across 21 repos and 9 languages the score predicts bug-prone files at about 0.74 AUC, around 0.81 for Go. The strongest predictors were process signals, developer churn and untested hotspots, not McCabe complexity or nesting depth. I also ran it head to head against CodeScene on the same files: tied on raw accuracy, and on the worst 20% of files mine caught about twice as many bugs. Mine is open, theirs isn’t. The score is 25 deterministic biomarkers per file. No LLM, just tree-sitter AST plus git history, so the same commit always gives the same number. Complexity, duplication via a Rabin-Karp rolling hash that survives renames, untested hotspots, developer churn, change entropy, recent bug-fix history. Where this matters for Claude Code: it runs as an MCP tool, so the model can pull a file’s health score before it edits. Right now Claude Code opens a brittle 1/10 file with cyclomatic complexity 60 and three recent bug fixes with the same confidence as a clean helper. With the score in context it knows which files are landmines and reads the dependents first. This is one layer of an open source codebase intelligence tool (Repowise, pip install, AGPL-3.0). The other four map the dependency graph, git hotspots, auto-docs, and architectural intent. Across real tasks the whole thing cut tool calls 49%, file reads 89%, and cost 36% versus bare Claude Code. 9 MCP tools. 2.2K+ stars. Repo: https://github.com/repowise-dev/repowise Live Hugo health report: https://www.repowise.dev/repo/gohugoio/hugo Feedback and contributions welcome. submitted by /u/Obvious_Gap_5768
Originally posted by u/Obvious_Gap_5768 on r/ClaudeCode
