debt-map

debt-map is a command for Claude Code from fatihkan/badi. It costs 0 tokens per session (1,002 once invoked), scanned A, original, MIT.

A command that scans a codebase for technical debt: outdated notes, temporary workarounds, oversized files, long functions, and deeply nested conditions. Technical debt is code that makes future changes harder or riskier.

In plain words
What is it for?
Use it to scan a whole project, module, or layer; find TODO, FIXME, HACK, deprecated, and similar markers; and identify complexity that may need cleanup.
Why use it?
It replaces a broad, manual search with a structured inventory of maintenance problems. It also records locations and uses Git history to highlight older findings.

Command for Claude Code

Written for Claude Code: installed under .claude/.

Part of the badi plugin — 81 skills, 86 commands, 30 agents, 7 hooks shipped together

Good fit Use it to scan a whole project, module, or layer; find TODO…

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/fatihkan/badi/debt-map
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/fatihkan/badi

Made for: Claude Code.

Or install badi, the plugin that ships this one along with the rest of its 81 skills, 86 commands, 30 agents, 7 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for debt-map

README.md
[![agentmods](https://agentmods.dev/badge/commands/fatihkan/badi/debt-map.svg)](https://agentmods.dev/commands/fatihkan/badi/debt-map)
Your own site
<a href="https://agentmods.dev/commands/fatihkan/badi/debt-map"><img src="https://agentmods.dev/badge/commands/fatihkan/badi/debt-map.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,002 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01002
Opus 5 $0.00000 $0.00501
Sonnet 5 $0.00000 $0.00200
Haiku 4.5 $0.00000 $0.00100

Measured today against content hash 794314cbb30f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

debt-map scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/debt-map.md · 122 lines

How it starts

The opening of the file, as written. The whole thing — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Technical debt mapping command. Systematically detects and prioritizes technical debt in the codebase.

Required Tools

  • Grep (code scan)
  • Glob (file discovery)
  • Read (file reading)
  • Bash (complexity analysis, git blame)
  • Write (report writing)

Procedure (4 Steps)

Step 1: Define the Scope

Ask the user:

  • Whole project: Scan the complete codebase
  • Module: A specific module or directory
  • Layer: A specific layer (API, UI, database, etc.)

Record the scope:

  • Directories to scan
  • File types to include
  • Directories to exclude (node_modules, vendor, dist, build, etc.)

Step 2: 3 Parallel Scans

Scan A: TODO/FIXME Inventory

  • Scan and categorize TODO tags
  • Scan FIXME tags (needing urgent attention)
  • Scan HACK tags (temporary fixes)
  • Scan WORKAROUND tags (known-issue workarounds)
  • Scan DEPRECATED tags (should no longer be used)
  • Scan XXX and BUG tags
  • For each finding record file path, line number, and context
  • Date them via git blame and highlight the old ones

Scan B: Complexity Analysis

  • Detect 500+ line files (oversized)
  • Find 100+ line functions (overlong)
  • Find 3+ level nested conditionals (deep nesting)
  • Files with too many imports/dependencies
  • Duplicated code blocks (copy-paste detection)
  • Functions with 5+ parameters
  • Deep inheritance hierarchies (3+ levels)
  • God class / god function detection

Scan C: Staleness and Dead Code Detection

  • Unused exports/functions
  • Deprecated API usage (per language and framework)
  • Outdated dependencies
  • Incompatible version pairings
  • Removed or unsupported libraries
  • Old configuration formats
  • Commented-out code blocks (zombie code)
  • Undying feature flags

Step 3: Scoring

Compute a score per debt item:

Impact Score (1-5):

  • 5: Production-outage risk, security vulnerability
  • 4: Performance degradation, data inconsistency
  • 3: Significantly slows development
  • 2: Reduces readability and maintainability
  • 1: Cosmetic issue, minor inconsistency

Read the full file on GitHub · 122 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 122 lines · 0 tokens per session scan A 794314cbb30f

Subscribe to this mod's changes

debt-map is a command published in the GitHub repository fatihkan/badi (7 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,002 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-06.