comment-scan

An advisory tool that scans changed code for comments that are unnecessary or too long.

In plain words
What is it for?
Use it on the difference between your branch and the default branch to review comments before finishing verification.
Why use it?
It makes comment rules checkable and records findings without blocking the verification process.

Agent

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/lugassawan/swe-workbench/comment-scan
Clone the repo
git clone --depth 1 https://github.com/lugassawan/swe-workbench
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 826 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.00000 $0.00826
Opus 5 $0.00000 $0.00413
Sonnet 5 $0.00000 $0.00165
Haiku 4.5 $0.00000 $0.00083

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

Security

Grade A, and why

comment-scan 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.

shared/agents/comment-scan.md · 57 lines

How it starts

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

Comment-scan invocation

Advisory scan for unnecessary or over-cap comments, backing swe-workbench:principle-clean-code's Comment discipline caps with a deterministic, checkable artifact instead of prose recall alone. Advisory-with-accounting, not a hard gate — the scan never fails your verify step; it produces findings that verdict accounting (below) requires you to account for before calling verify done.

Running the scan

No git access lives inside the script — resolve the diff yourself and pipe it in:

command -v swe-workbench-comment-scan >/dev/null 2>&1 || {
  echo "swe-workbench runtime commands not on PATH — reinstall or update the swe-workbench plugin." >&2
  exit 1
}
DEFAULT_BRANCH="${DEFAULT_BRANCH:-main}"
MERGE_BASE=$(git merge-base HEAD "origin/$DEFAULT_BRANCH" 2>/dev/null || true)
git diff -M "${MERGE_BASE:-origin/$DEFAULT_BRANCH}" | swe-workbench-comment-scan

The preflight check is load-bearing, not boilerplate. This scan runs against an arbitrary target repo — if swe-workbench-comment-scan isn't on PATH for any reason (plugin not installed, or an install predating bin/), the invocation would otherwise fail ambiguously (or, worse, get silently treated as "not applicable" rather than "misconfigured") instead of erroring loudly with a fix ("reinstall or update the swe-workbench plugin"). Same pattern as bin/README.md's canonical preflight — don't drop the check when copying the snippet.

-M detects renames so a moved function's untouched doc comment isn't misread as newly added. Diffing from the merge-base (not origin/main directly) covers committed + staged + unstaged work in one pass without picking up main's own post-branch-point changes as if they were yours. If MERGE_BASE comes back empty (unrelated-history repo), the fallback diffs straight against the branch tip — same defensive posture as swe-workbench:workflow-branch-sync's redundancy-check capture.

Verdict accounting

The script's footer reports a must-triage count, e.g. COMMENT-SCAN: 3 must-triage (OVER_CAP=2 RESTATES=1) INFO=1. Your Phase 3 / verify evidence must carry exactly one line per must-triage finding, referencing its detector:file:line id:

Read the full file on GitHub · 57 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 · 57 lines · 0 tokens per session scan A 1662762de14a

Subscribe to this mod's changes

comment-scan is an agent published in the GitHub repository lugassawan/swe-workbench (2 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 826 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-08-31.

Related

Other agents, from other repositories

architect-review

Master software architect specializing in modern architecture patterns, clean architecture, microservices, event-driven systems, and DDD. Reviews system designs and code changes for architectural integrity, scalability, and maintainability. Use PROACTIVELY for architectural decisions.

viksant/vibe-coding-tools-content · 48 tokens

demo-site

Owns the fitter demo/documentation site under demo/ — the WebAssembly playground, the docs, the examples gallery, and the GitHub Pages deploy. Use for any work on demo/index.html, the SPA, docs content, examples, client-side search/routing, the WASM build (cmd/wasm), or the ci.yaml pages job. Trigger phrases: "demo…

PxyUp/fitter · 97 tokens

consistency-checker

事实一致性与伏笔状态检查专家(只读)。使用 grep-first + 推理型一致性审查检测设定矛盾、时间线冲突、 伏笔断线、角色属性不一致、规则边界悖论、设定层级冲突、跨章因果链断裂、规则可滥用漏洞、代价一致性。输出 S1-S4 分级冲突报告。 被 story-review、story-long-write(Phase 5)、story-short-write(Phase 4)调用。 不做任何创作判断。.

Xiaoyangy/novel-studio · 120 tokens

polyglot-architect

Cross-language API design and binding parity.

Goldziher/ai-rulez · 13 tokens

unit-test-writer

Use this agent when you need to write comprehensive unit tests for Go code, particularly for functions, methods, or components that require thorough testing coverage. Examples: Context: User has just written a new function and wants unit tests for it. user: 'I just wrote this function to validate email addresses, can…

stacklok/toolhive-registry-server · 228 tokens

hierarchies

Parent-child relationships, graph building, and cycle detection.

dsswift/ion · 11 tokens