Almost every production codebase is littered with comments like // TODO: handle error retry or // FIXME: memory leak under load. Over time, they become invisible noise.
In TokenCap, we built src/debt/ledger.js to catalog and prioritize technical debt automatically.
How the Debt Ledger Operates
- Tokenizer Scan: Scans source lines for standard debt prefixes (
TODO,FIXME,HACK,DEBT,OPTIMIZE). - Git Metadata Anchoring: Runs local git blame to capture the original author, commit hash, and creation date.
- Symbol and Cluster Mapping: Associates the debt marker with its enclosing function and architectural cluster.
- Output Generation: Writes an auditable ledger to
.tokencap/debt/ledger.jsonand.tokencap/debt-map.md.
CLI Command
tokencap analyze debt
CLI Output:
Indexed 38 technical debt markers across 84 files:
- [CRITICAL] src/auth/session.js:84: FIXME: Refresh token race condition
Authored: 2026-03-12 by vansharora21 | Cluster: Auth
- [MEDIUM] src/pack/fold.js:120: TODO: Support nested bracket folding
Authored: 2026-06-20 by vansharora21 | Cluster: Pack
- [LOW] src/utils/format.js:14: HACK: Temporary regex for legacy dates
Authored: 2026-08-01 by vansharora21 | Cluster: Utilities
Because debt items are scored and tracked, your AI coding agent can be instructed to resolve high-priority debt items alongside planned feature work.
Read more at tokencap.vansharora.app
Top comments (0)