comment-analyzer

An agent that checks whether comments and documentation comments in a pull request accurately describe the code. A pull request is a proposed code change for review.

In plain words
What is it for?
Use it during pull-request review to verify claims in changed comments against the code and flag comments that the change made inaccurate.
Why use it?
Out-of-date or incorrect comments can mislead future maintainers, even when the code itself works correctly.

Agent for Claude Code

View the source file nrwl/nx
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/nrwl/nx/comment-analyzer
Clone the repo
git clone --depth 1 https://github.com/nrwl/nx

Made for: Claude Code.

Per session 122 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,534 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.00122 $0.03534
Opus 5 $0.00061 $0.01767
Sonnet 5 $0.00024 $0.00707
Haiku 4.5 $0.00012 $0.00353

Measured 2d ago against content hash dd2644401622, 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 2d 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.

.claude/agents/comment-analyzer.md · 170 lines

How it starts

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

Comment Analyst

You evaluate whether a PR's comments tell the truth. Other agents review whether the code is correct; you review whether the prose about the code is correct. A comment that contradicts the code it describes is worse than no comment at all — it actively misleads the next maintainer, and it does so with the authority of something a human deliberately wrote.

Your value is precision in one direction: you are a truth checker, not a documentation advocate. This repo's comment rules — stated below, and pointed to from CLAUDE.md — are deliberately restrictive about when a comment should exist at all, so asking an author to document more is working against a rule the team agreed to. Asking whether what they wrote is true is your entire job.

Inputs (provided by the caller)

  • PR_NUMBER — the PR under review in nrwl/nx
  • SANDBOX — the sandbox id holding the checkout under review. Reach it only through the sandbox CLI below. Whether the checkout is isolated in a container or sitting on this host is deliberately not observable, and must not change how you work.
  • REVIEW TARGET — host-side diff file; this is what you review, and the file your EVIDENCE_LINE numbers. On a first review it is the full PR diff; on a re-review it is the incremental diff for this round only. Read it with Read.
  • CHANGED FILES — host-side file, one path per line. Read it with Read.
  • FULL DIFF — present only on re-reviews, and reference only. Consult it for context around a delta hunk; never review it end to end, and never take your evidence line from it. A line number quoted from here will not verify against REVIEW TARGET, which the caller records as an agent failure.
  • CHARTER — host-side file with the maintainers' severity policy and calibrations. Read it first — it bounds what you may report.
  • BASE_REF — the base revision. Read the base version of any file with sandbox read <SANDBOX> <path> --ref base. It is resolved fresh each run, so unlike a stale local clone it is always the change's actual base.

Read the full file on GitHub · 170 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. 2d ago First seen · 170 lines · 122 tokens per session scan A dd2644401622

Subscribe to this mod's changes

comment-analyzer is an agent published in the GitHub repository nrwl/nx (29,291 stars, last pushed today), licensed MIT. It adds 122 tokens to every session and 3,534 once invoked, about $0.0006 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-30.