Home / Prioritize

How to Prioritize Technical Debt Repayment

Updated 26 March 2026

Not all technical debt deserves equal attention. The goal is not to eliminate every imperfection but to remove the debt that is actively costing you the most in velocity, reliability, and team morale. These frameworks help you decide what to tackle first.

Hotspot Analysis: Start Where It Hurts

The highest-priority debt lives in files that are both complex and frequently changed. A file that is messy but never touched causes less day-to-day pain than a messy file that every developer touches every sprint.

How to run a hotspot analysis

  1. 1Pull git log data for the past 6 months and rank files by commit frequency. These are your change hotspots.
  2. 2Run a static analysis tool (SonarQube, CodeClimate) and rank files by complexity score.
  3. 3Multiply the two scores: commit frequency rank x complexity rank. The highest combined scores are your debt hotspots.
  4. 4Add a third dimension: files involved in the most production incidents over the same 6-month period. Cross-reference with your incident tracker.
  5. 5The files at the top of all three lists are your top-priority refactor candidates, regardless of size.

Tool shortcut: CodeScene automates this analysis by combining git history with code complexity. Adam Tornhill's book "Software Design X-Rays" covers the methodology in depth.

Impact-Effort Scoring Framework

Score each debt item on four dimensions, each rated 1 to 5. Divide total impact score by total effort score. Items with the highest ratio are highest priority.

Impact

Developer Time Saved Per Sprint

How many developer hours per sprint would be freed up if this debt were resolved? Score 1 for less than 1 hour saved, 5 for more than 8 hours saved.

Impact

Incident Risk Reduction

How likely is this debt to cause or worsen a production incident? Score 1 for minor aesthetic issues, 5 for debt in a critical path with no test coverage.

Effort

Refactor Effort Required

How many sprint days would it take to properly address this debt item? Score 1 for a morning of work, 5 for a multi-sprint architectural rewrite.

Effort

Coupling and Migration Risk

How many other systems, services, or teams does this change affect? Score 1 for an isolated local change, 5 for a cross-service API contract change.

Priority score formula: (Developer Time Score + Incident Risk Score) divided by (Refactor Effort + Coupling Risk). A score above 1.5 means the item should be in the next sprint. Below 0.8 means it can wait unless it sits in a hotspot file.

Cost of Delay Model

Some debt is not costing you much today but will cost you dramatically more in six months. The cost-of-delay model asks: what is the cost of leaving this debt unresolved for one more quarter?

Urgent debt

Debt that is actively blocking a feature on the roadmap or causing weekly incidents. Cost of delay is immediate and compounding. Prioritise unconditionally.

Signal: Blocks roadmap item or caused 2+ incidents last quarter

Decay debt

Debt that is not urgent today but is getting worse with each sprint because new features are being built on top of it. The cost of fixing it grows 10 to 30% per quarter. Schedule within 2 sprints.

Signal: New features regularly touch this area; complexity trend is increasing

Latent debt

Debt that is ugly but stable. It is not in a hotspot, it does not cause incidents, and no upcoming features touch it. This debt has low priority. Document it and revisit quarterly.

Signal: Rarely changed; no related incidents; no roadmap features nearby

How to Fit Debt Work into Sprints

1

The 20% rule

Allocate a fixed 20% of every sprint to debt work. This is consistent with the Boy Scout Rule applied at team level: leave the code better than you found it. A 10-person team running 2-week sprints has 16 developer-days of debt capacity per sprint. That is enough for meaningful refactors without halting feature delivery.

2

Debt tax on feature work

When a feature requires developers to touch a debt hotspot, budget an additional 30% on top of the feature estimate to clean up the area being modified. This is not optional extra work; it is a sunk cost prevention strategy. Leaving the hotspot dirty while building on top of it multiplies the future debt tax.

3

Debt sprints on a schedule

Every quarter, run one dedicated debt sprint. Do not call it a 'maintenance sprint' (leadership will deprioritise it). Call it a 'reliability and velocity sprint' and measure output in terms of: build time reduction in minutes, coverage percentage gained, incidents prevented, and hotspot complexity scores reduced.

4

Strangler fig pattern for large rewrites

Never attempt a big-bang rewrite of a core system. Instead, use the strangler fig pattern: build the new implementation alongside the old one, route traffic to it incrementally, and decommission the old version only after full parity is confirmed. This turns a 6-month risk into a 12-month certainty.

Ready to pitch the reduction plan to leadership?

Once you have a prioritised list, the next step is making the ROI case to get budget approved.