I want to find the riskiest file in this repo
A ranked list of the files most likely to break production, with reasoning for each.
A ranked list of the files most likely to break production, with a short reasoning trace on each one.
The prompt
Paste this into Claude Code
$ Scan this repo and tell me which file is the riskiest right now. Explain your reasoning.
What the Algorithm does
The Algorithm classifies this as a multi-file investigation with a judgment call at the end. It routes to the Sentinel Scan workflow to discover conventions and hotspots, then hands the findings to the Thinking Pack for a first-principles risk ranking.
What you'll see
$ ♻︎ Entering the DOS ALGORITHM… (v0.0.1) ═════════════🗒️ TASK: Find the riskiest file in this repo━━━ 👁️ OBSERVE ━━━ 1/7🔎 REVERSE ENGINEERING:• Wants: ranked risk, reasoning, actionable• Not wanted: lint noise, false positives, full rewrite💪🏼 EFFORT LEVEL: Extended | Needs codebase discovery plus judgment🏹 CAPABILITIES SELECTED:• Sentinel (Scan) — map conventions and hotspots• Thinking (FirstPrinciples) — decompose risk dimensions• MemPalace — store conventions for future Guard runs━━━ 📋 PLAN ━━━ 3/7Scan → extract hotspot candidates → score across 5 risk dimensions → rank.━━━ ⚡ EXECUTE ━━━ 5/7Sentinel Scan completes in ~45s, populates KG with conventions. Thinking ranks 7 candidates across blast radius, test coverage, churn, complexity, and coupling.✓ Done. Top suspect: src/billing/webhookRouter.ts — 4 reasons listed.
What you get back
A short report: the top file, why it is the top file, a ranked list of the next 5 candidates, and one concrete remediation suggestion per file. Conventions discovered during the scan are stored in MemPalace so every subsequent session already knows them.
Variations
- Find the top 10 riskiest files and group them by subsystem
- Focus only on files changed in the last 30 days
- Rank by blast radius only, ignore complexity
- Scan the repo and open a GitHub issue for the top 3
Was this page helpful?