audit-comment-residue

A read-only checker that classifies comments containing references to past code, planning sessions, requests, tickets, pull requests, or branches.

In plain words
What is it for?
Use it to find comments that should be removed or reviewed, such as obsolete history, task notes, conversational asides, and links to past development work.
Why use it?
It identifies comments that make sense only in the context of old work or conversations and may confuse people reading the current code.

Skill for Claude CodeCodex

Part of the code-tidying plugin — 5 skills 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 skills/melodic-software/claude-code-plugins/audit-comment-residue
Any agent
npx skills add melodic-software/claude-code-plugins --skill audit-comment-residue
Clone the repo
git clone --depth 1 https://github.com/melodic-software/claude-code-plugins

Made for: Claude Code, Codex.

Or install code-tidying, the plugin that ships this one along with the rest of its 5 skills.

Per session 159 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,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.00159 $0.01911
Opus 5 $0.00079 $0.00955
Sonnet 5 $0.00032 $0.00382
Haiku 4.5 $0.00016 $0.00191

Measured yesterday against content hash 79459417dc02, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

audit-comment-residue 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 yesterday.

The scan reads SKILL.md. This mod also ships 4 executable files (evals/fixtures/residue-snippet.py, scripts/detect.sh, scripts/detect.test.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

plugins/code-tidying/skills/audit-comment-residue/SKILL.md · 104 lines

How it starts

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

Pre-computed context

Current branch: !git branch --show-current 2>/dev/null || echo "unknown" Uncommitted code files (empty = none matched or the probe returned nothing): !bash "${CLAUDE_PLUGIN_ROOT}/scripts/changed-code-files.sh" 10 2>/dev/null || echo "(git status unavailable)" Residue findings (sample): !${CLAUDE_SKILL_DIR}/scripts/detect.sh 2>/dev/null | grep -E '^(Summary total:|Finding shape:)' | head -20 || echo "none"

Purpose

Code comments accumulate RESIDUE. Text that only makes sense outside the code's present state: narration of what the code used to be, references to the plan/session/changeset that produced it, asides addressed to the requester, and back-references to a ticket, PR, or branch no future reader will ever open. Version control owns history; the comment describes the present. A comment that only makes sense inside the chat thread that produced it is dead. This skill is a read-only classifier: it surfaces candidates with treatment guidance; the author hand-applies every deletion.

It detects residue on the COMMENT portion of a line only, so a residue-shaped word sitting in an identifier or string literal is never flagged. The positive question, does this comment capture something the code cannot (a non-obvious why, a constraint, an interface/design-intent contract)?, is left to the author; the shapes below are the comments that fail it.

Residue shapes and treatments

Shape What it looks like Default tier Treatment
history-narration The comment narrates the code's past: "used to…", "no longer…", "previously", "renamed from X", "we switched from…", "now returns…" 1 Delete. Version control owns history. Keep only if the reason for the change is a load-bearing constraint, rewritten as present-tense rationale ("must stay ordered because…")
plan-reference References a work plan, session, or changeset rather than the code: "Task 2 replaces the old…", "as planned", "in this PR/commit/refactor" 1 Delete, the plan is not part of the code's meaning. Fold any surviving intent into a present-tense why-comment
conversational-antecedent Addresses the requester or the producing conversation: "per your request", "as you asked", "like you said", "per our discussion" 1 Delete, the conversation is invisible to every future reader
ticket-pr-residue Back-reference to a tracker/PR/branch a reader can't follow: "see PR #45", "from the feature branch", "JIRA-123" 2 Review. Delete a bare provenance reference; a TODO(#issue) tracking real outstanding work is the sanctioned exception and is NOT flagged

Read the full file on GitHub · 104 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday Changed 79459417dc02
  2. 3d ago First seen · 104 lines · 159 tokens per session scan A ec537e3a6594

Subscribe to this mod's changes

audit-comment-residue is a skill published in the GitHub repository melodic-software/claude-code-plugins (13 stars, last pushed yesterday), licensed MIT. It adds 159 tokens to every session and 1,911 once invoked, about $0.0008 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.

Related

Other skills, from other repositories

deep-research

Conducts iterative deep research on any topic using web search, progressive exploration, and structured synthesis. Use when asked for comprehensive research, deep investigation, thorough analysis, or multi-source exploration of any topic. Triggers: research, investigate, deep dive, comprehensive analysis, explore…

jimmc414/claude-code-plugin-marketplace · 64 tokens

error-ux

Principles and patterns for writing error messages that help users recover. Use when auditing, writing, or improving error messages in code. Triggers: error messages, user experience, error handling, exception messages, validation errors.

jimmc414/claude-code-plugin-marketplace · 48 tokens

adversarial-patterns

Library of realistic adversarial attack vectors and anti-patterns to avoid. Contains examples of valid attacks and subtle gaming patterns to reject.

jimmc414/claude-code-plugin-marketplace · 32 tokens

documentation-testing

Provides heuristics for identifying incomplete or broken documentation. Use when validating README setup instructions, testing onboarding flows, or auditing documentation quality. Triggers: docs, readme, onboarding, setup validation, documentation audit.

jimmc414/claude-code-plugin-marketplace · 45 tokens

adversarial-analysis

Analyze code to identify explicit contracts, implicit usage patterns, and realistic boundary conditions. Contains concrete formulas for calculating input realism limits. Use before generating adversarial tests.

jimmc414/claude-code-plugin-marketplace · 37 tokens

match-stable-pairs

For two-sided matching: hospital-resident, stable marriage, college admissions. Gale-Shapley algorithm for stable matching with preferences.

jimmc414/claude-code-plugin-marketplace · 32 tokens