tech-debt

tech-debt is a command for coding agents from juanmhidalgo/claude-plugins. It costs 28 tokens per session (911 once invoked), scanned A, original, MIT.

A code-review command that checks staged changes or a branch difference for technical-debt and maintainability problems. Technical debt is code that makes future changes harder or riskier.

In plain words
What is it for?
Use it before merging staged work or a branch to identify difficult-to-maintain code and related improvements.
Why use it?
It helps find design and maintenance issues before they become more expensive to fix, without treating ordinary bugs or security issues as its focus.

Command

Part of the code-review plugin — 5 skills, 14 commands, 13 agents shipped together

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.

agentmods
npx agentmods add commands/juanmhidalgo/claude-plugins/tech-debt
Clone the repo
git clone --depth 1 https://github.com/juanmhidalgo/claude-plugins

Or install code-review, the plugin that ships this one along with the rest of its 5 skills, 14 commands, 13 agents.

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 tech-debt

README.md
[![agentmods](https://agentmods.dev/badge/commands/juanmhidalgo/claude-plugins/tech-debt.svg)](https://agentmods.dev/commands/juanmhidalgo/claude-plugins/tech-debt)
Your own site
<a href="https://agentmods.dev/commands/juanmhidalgo/claude-plugins/tech-debt"><img src="https://agentmods.dev/badge/commands/juanmhidalgo/claude-plugins/tech-debt.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 911 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00028 $0.00911
Opus 5 $0.00014 $0.00456
Sonnet 5 $0.00006 $0.00182
Haiku 4.5 $0.00003 $0.00091

Measured 5d ago against content hash 97dd737c0936, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tech-debt 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 5d ago.

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.

code-review/commands/tech-debt.md · 94 lines

How it starts

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

Context

  • Current branch: !git branch --show-current
  • Argument: $ARGUMENTS
  • Staged files: !git diff --cached --name-only

Scope Detection

Determine the scope based on the argument:

  • If $ARGUMENTS is staged → analyze staged changes only
  • If $ARGUMENTS is a branch name → use it as the base branch
  • If $ARGUMENTS is empty → check if there are staged files:
    • If staged files exist → analyze staged changes
    • Otherwise → default to branch comparison against main (or master)

Pre-flight: Base Branch Staleness Check

Only for branch scope. Skip entirely for staged scope.

Before running the analysis, check if the local base branch is behind its remote. A stale base produces false findings by including already-merged commits in the diff.

  1. Resolve the remote tracking ref: git rev-parse --abbrev-ref <base>@{upstream} (falls back to origin/<base> if no upstream is configured)

  2. If a remote ref exists, run git rev-list --count <base>..<remote-ref> to count commits the local base is behind

  3. If the count is 0 → proceed silently

  4. If the count is >0stop and warn the user:

    Your local <base> is N commits behind <remote-ref>. The tech-debt analysis may include commits already merged upstream, producing false findings.

    Suggested: git fetch origin <base>:<base> (or pull if checked out), then re-run.

    Proceed anyway? (yes / no)

  5. If the remote ref cannot be resolved (no upstream, no origin/<base>) → proceed silently; do not fail the command

Never auto-fetch or auto-pull — the user decides.

Instructions

Use Agent tool with subagent_type="code-review:tech-debt-reviewer" to analyze technical debt.

Pass the scope clearly in the agent prompt:

  • For staged scope: Tell the agent to use git diff --cached and mention "staged" explicitly
  • For branch scope: Tell the agent the base branch to compare against

Analysis categories:

  1. Complexity — Functions >30 lines, deep nesting, god classes
  2. Duplication — Copy-pasted blocks, similar logic that could be abstracted
  3. Debt Markers — New TODO/FIXME/HACK/XXX/TEMP comments
  4. Test Gaps — New code without tests, weakened assertions
  5. Code Smells — Magic numbers, poor naming, long parameter lists, dead code
  6. Dependencies & Infrastructure — New deps, version pinning, ad-hoc reimplementation of shared patterns, undocumented config
  7. Maintainability — Missing docs on public APIs, implicit dependencies, tight coupling

Read the full file on GitHub · 94 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. 5d ago First seen · 94 lines · 28 tokens per session scan A 97dd737c0936

Subscribe to this mod's changes

tech-debt is a command published in the GitHub repository juanmhidalgo/claude-plugins (8 stars, last pushed 10d ago), licensed MIT. It adds 28 tokens to every session and 911 once invoked, about $0.0001 per session on Opus 5. 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-08-31.