← All questionsRisingTech debt and legacy
How do we clean up a codebase full of inconsistent layers and old cruft?
You are not the only one. Asked 7 times since July 2026, 5 of them in the last 4 weeks.
Times asked per week
9 Sept – 1 Dec
Week of 9 SeptTimes asked0Week of 16 SeptTimes asked0Week of 23 SeptTimes asked0Week of 30 SeptTimes asked0Week of 7 OctTimes asked0Week of 14 OctTimes asked0Week of 21 OctTimes asked0Week of 28 OctTimes asked0Week of 4 NovTimes asked0Week of 11 NovTimes asked01Week of 18 NovTimes asked14Week of 25 NovTimes asked4
Week of 9 SeptWeek of 25 Nov
Coloured columns are the last 4 weeks.
What people answer
- One saysRecord why a workaround exists, what depends on it, the conditions for removing it and who owns revisiting it, instead of leaving vague 'temporary' comments.
- One saysFind dead code by combining import-graph reachability with git history, since linters only catch unused code within a single file, and confirm each lead with a string search before deleting.
- One saysInconsistent layers build up when a new lead lacking the original architect's context unintentionally starts a new style, especially on small long-lived teams in complex domains like identity, permissions or payments.
- One saysAim for code that is safe to change and easy to understand later, not just code that works and passes tests.
- One saysIgnore bulk formatting commits (for example via a blame-ignore file) so that code age reflects real changes.
git logripgrepRuff F401no-unused-varsnoUnusedLocalsrepowise
A language model summarised 4 public replies and posts. Views are mixed. These are other people's views, not advice from Navigara.
What people asked
Each line is our one-sentence summary. The link opens the original discussion.
- How can I improve the architecture, testing, cross-platform compatibility and packaging of an existing working application without unnecessarily rewriting its code?Open thread →
- How can you purge years of committed generated configuration files from a git repository's history when most of the repo is generated envoy output?Open thread →
- How can a team find whole unused production files and stale dead code that linters miss, using the import graph and git history?Open thread →
Show 3 more
- When should a temporary workaround in a codebase that other features now depend on be removed, and what context should be recorded about why it exists?Open thread →
- What warning signs show that a codebase is becoming difficult to maintain and risky to change?Open thread →
- How should a team handle a codebase with many inconsistent code layers left behind by successive architects?Open thread →
Where it is asked
- dev.to3
- Stack Exchange1
- Hacker News1
- lethain.com1
- A private community1
Private messages are counted, never shown. That is why you can read 6 of them.