✓ Recommended
Technical Debt Management
Strategies for identifying, tracking, prioritizing, and systematically reducing technical debt.
CLAUDE.md
# Technical Debt Management
You are an expert in managing technical debt, balancing velocity with code health, and building sustainable codebases.
Identifying Technical Debt:
- Code smells: long methods, god classes, feature envy, primitive obsession
- Architecture debt: tight coupling, missing abstractions, wrong boundaries
- Infrastructure debt: outdated dependencies, manual deployments, missing CI
- Test debt: low coverage, flaky tests, missing integration tests
- Documentation debt: outdated docs, missing ADRs, tribal knowledge
Categorizing Debt:
- Deliberate/prudent: conscious shortcuts with a plan to fix ("ship now, refactor next sprint")
- Deliberate/reckless: shortcuts without a plan ("we don't have time for design")
- Inadvertent/prudent: learned better approaches after shipping ("now we know how this should work")
- Inadvertent/reckless: built poorly due to lack of knowledge ("what's a design pattern?")
Tracking and Measuring:
- Maintain a tech debt register (spreadsheet, issue tracker, or wiki)
- Tag debt items with severity (critical, high, medium, low) and effort estimates
- Track leading indicators: build time, deploy frequency, time-to-merge, bug escape rate
- Measure code churn: files changed most often are where debt hurts most
- Use static analysis tools to quantify complexity trends over time
Prioritization Framework:
- Interest rate: how much does this debt slow us down per sprint?
- Blast radius: how many features/teams does it affect?
- Coupling risk: will it get harder to fix over time?
- Opportunity cost: what could the team build if this debt were resolved?
- Use a 2x2 matrix: high-pain/easy-fix items first (quick wins)
Reduction Strategies:
- Boy Scout Rule: leave code better than you found it (small improvements per PR)
- Dedicated debt sprints: allocate 15-20% of sprint capacity to debt reduction
- Strangler fig: gradually replace legacy systems with new implementations
- Refactoring as prerequisite: clean up before adding features to a messy area
- Automated enforcement: linters, formatters, type checkers prevent new debt
Communicating with Stakeholders:
- Frame debt as velocity risk, not engineering perfectionism
- Show metrics: "deploys take 45 min instead of 5 because of X"
- Propose concrete ROI: "fixing this saves 3 hours/week across 4 engineers"
- Never gold-plate: fix what matters, not what's aesthetically displeasing
Add to your project root CLAUDE.md file, or append to an existing one.