The Deska blog
Triaging Five Years of TODO Comments
Learn a technical debt recipe for triaging five years of TODO comments using AI coding agents and local-first development tools.
10 min read
Software repositories often resemble archaeological sites. Within the layers of feature releases and emergency patches, you will find thousands of lines starting with the word TODO. It is common to find a codebase where triaging five years of TODO comments becomes a primary blocker for long term maintainability. These comments represent deferred decisions, forgotten optimizations, and warnings from past developers that never reached the issue tracker. Addressing this volume of technical debt manually is an exercise in futility. A structured recipe is required to categorize, prioritize, and resolve these fragments without losing weeks of engineering time to context switching.
The Taxonomy of Stale Comments
Not all TODO comments are created equal. After half a decade of development, a repository usually contains three distinct types of technical debt hidden in plain sight. Understanding these categories is the first step toward a successful triage process.
The first category consists of specific implementation details. These are small tasks, such as replacing a temporary mock with a real service call or refactoring a single function for better readability. These are the easiest to resolve but the most numerous.
The second category involves architectural warnings. These comments often start with "Fix this later" and point to deep structural issues, like circular dependencies or inefficient data flows. These cannot be resolved in a single commit and require mapping to a formal project roadmap.
The third category is what we call ghost debt. These are TODOs that refer to features that no longer exist or requirements that have been completely superseded. These should be deleted immediately to reduce cognitive load for the team.
A Recipe for Debt Triage
To handle thousands of lines of code effectively, you must move away from the standard IDE global search. You need a systematic approach to filter the noise.
- Extraction: Use
greporripgrepto export every TODO, FIXME, and HACK comment into a structured format. Include the file path, line number, and two lines of context. - Contextualization: Map the file creation dates to the comments. A TODO from 2019 in a file that has been refactored ten times since then is likely a ghost.
- Batching: Group comments by directory or module. This allows a developer to stay in one mental model while reviewing related tasks.
- Agentic Analysis: Utilize AI coding agents to read the surrounding logic. An agent can often determine if a comment is still relevant by checking the current state of the implementation.
When you use coding agents to assist in this process, the speed of triage increases significantly. An agent can navigate between code and git files to see who wrote the comment and whether the referenced logic still exists.
Managing the Workspace During Triage
Triaging years of debt is a high context task. You are usually looking at the source code, the terminal output of a search, and the project documentation simultaneously. Standard tabbed interfaces often fall short here because they require constant flipping between views, leading to memory fatigue.
An alternative is using an infinite canvas. By placing your search results in one panel, the relevant code editor in another, and a terminal for tests in a third, you can see the entire lifecycle of a bug without losing focus. In Deska, you can run multiple tools like Claude Code or OpenCode side by side in this manner. This allows one agent to search for patterns while you manually verify the critical architectural decisions.
Because the triage involves sensitive internal logic, a local-first approach is often preferred. Keeping the code and the session data on your machine ensures that your technical debt map does not leak to a third party cloud. You can manage these sessions through data and storage settings that prioritize privacy.
Comparing Triage Strategies
Different teams approach debt in various ways. Some prefer a "Burn Down Friday" where everyone picks five comments to fix. Others prefer a centralized task force.
| Approach | Pros | Cons |
|---|---|---|
| Manual Review | High accuracy, deep learning | Extremely slow, high cost |
| Scripted Regex | Very fast, automatable | Misses context, high false positives |
| AI Agent Triage | Fast, context aware | Requires human verification |
| Ignore and Delete | Fastest way to clean code | Risk of losing critical warnings |
Tools like SonarQube or ESLint differ in approach from specialized coding agents. While static analysis tools find bugs based on syntax rules, agents can understand the intent behind a natural language comment. For a five year old repository, combining both is the most robust strategy.
Leveraging Modern Workspaces
If you are using Deska for this process, the Ask Deska assistant can speed up the setup. You can use your voice or a chat command to open four terminals, navigate to specific directories, and start a coding agent session. This reduces the friction of starting a deep work session.
If you need to step away from your desk, the mobile app allows you to monitor long running agent tasks. Since the devices pair directly with no ports exposed, you can check if an agent has finished its scan of the /src directory while you are away from the office. You can also review the notifications to see if a critical vulnerability was flagged during the triage.
FAQ
How to automate todo comment management?
Automation involves using git hooks to prevent new unlabeled TODOs and employing AI agents to scan existing ones. Agents can categorize comments by checking if the code they refer to has already been updated.
Are coding agents safe for internal repositories?
Safety depends on the tool architecture. Local-first tools that use your own API keys or local inference models ensure that your proprietary logic stays on your hardware rather than being used for training.
How to prioritize ancient technical debt?
Prioritization should be based on execution frequency and business impact. Use a profiler to see if a TODO exists in a hot path of the application. If the debt affects performance or security, it moves to the top of the list.
Start Cleaning Your Codebase
Managing years of technical debt does not have to be a manual chore. By combining structured triage recipes with a flexible, local-first workspace, you can turn a mountain of comments into a manageable roadmap. You can download the Deska desktop app for Mac, Windows, and Linux to start organizing your panels and agents today.