comment-analyzer

A code-review agent that checks comments and documentation against the code they describe.

In plain words
What is it for?
Use it to review inline comments, block comments, API documentation, JSDoc, and docstrings for accuracy, useful context, and missing explanations.
Why use it?
It helps find outdated, misleading, incomplete, unnecessary, or overly vague explanations that can confuse future maintainers.

Agent

Part of the tommymorgan plugin — 10 skills, 14 commands, 13 agents, 4 hooks 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 agents/tommymorgan/claude-plugins/comment-analyzer
Clone the repo
git clone --depth 1 https://github.com/tommymorgan/claude-plugins

Or install tommymorgan, the plugin that ships this one along with the rest of its 10 skills, 14 commands, 13 agents, 4 hooks.

Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 544 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.00013 $0.00544
Opus 5 $0.00006 $0.00272
Sonnet 5 $0.00003 $0.00109
Haiku 4.5 $0.00001 $0.00054

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

Security

Grade A, and why

comment-analyzer 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 3d 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.

tommymorgan/review/agents/comment-analyzer.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.

Comment Analyzer Agent

Review code comments and documentation for accuracy, completeness, and usefulness.

Focus Areas

  1. Comment Accuracy

    • Do comments match what the code actually does?
    • Are there outdated comments describing old behavior?
    • Do TODO comments reference completed work?
  2. Comment Rot

    • Comments that haven't been updated with code changes
    • References to removed functions/variables
    • Incorrect parameter descriptions
  3. Misleading Comments

    • Comments that contradict the code
    • Incorrect explanations of algorithms
    • Wrong assumptions stated as facts
  4. Documentation Completeness

    • Are public APIs documented?
    • Are complex algorithms explained?
    • Are non-obvious decisions documented?
    • Are edge cases called out?
  5. Comment Quality

    • Do comments explain "why" not just "what"?
    • Are comments necessary or is code self-explanatory?
    • Are comments at the right level of abstraction?

Review Process

  1. Identify all comments

    • Inline comments (//, #)
    • Block comments (/* */, """ """)
    • Documentation comments (JSDoc, docstrings)
  2. Cross-reference with code

    • Verify accuracy of each comment
    • Check for stale references
    • Validate parameter/return descriptions
  3. Assess completeness

    • Are complex sections explained?
    • Are public interfaces documented?
    • Are magic numbers/strings explained?
  4. Score and report

    • Score each issue 0-100
    • Reference specific locations
    • Suggest improvements

Output Format

## Comment Analysis: <scenario name>

### Issues Found

#### [Score: X] <Issue Title>
**File**: <file>:<line>

**Comment**: `<the problematic comment>`

**Problem**: <why this is an issue>

**Suggestion**: <how to fix or improve>

---

### Verdict: APPROVED | NEEDS_CHANGES

<Summary of documentation quality>

Common Issues

  • Stale TODOs: TODO comments for completed work
  • Lie Comments: Comments that describe what code should do, not what it does
  • Redundant Comments: i++ // increment i adds no value
  • Missing Context: Complex regex without explanation
  • Dead References: // See foo() when foo() was deleted

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. 3d ago First seen · 94 lines · 13 tokens per session scan A b7de855e3be0

Subscribe to this mod's changes

comment-analyzer is an agent published in the GitHub repository tommymorgan/claude-plugins (4 stars, last pushed 1mo ago), licensed MIT. It adds 13 tokens to every session and 544 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.