Remove Dumb Comments
Flag comments that say what the code already says; keep every comment that explains why. The user chooses which flagged comments to remove.
Invocation
| Command |
Behavior |
/remove-dumb-comments |
Find the 10 lowest-value comments. |
/remove-dumb-comments <number> |
Find that many lowest-value comments. |
/remove-dumb-comments all |
Find every low-value comment. |
Never Remove
Keep any comment that carries a why the code cannot convey:
- backports, compatibility, or version-specific behavior;
- infrastructure, deployment, or architecture;
- workarounds, gotchas, or non-obvious reasons;
- documentation, specifications, RFCs, or ADRs;
- bugs, issues, tickets, or contextual TODOs/FIXMEs;
- intent, trade-offs, or constraints.
When unsure, keep it. Flag only pure restatements.
Workflow
- Resolve the limit from the invocation (default 10).
- Search source files; skip generated output, vendored dependencies, lockfiles, and documentation.
- Rank candidates from most redundant to least.
- Get each candidate's age with
git blame (see Comment Age).
- Present the table below, then ask whether to remove all recommended (see Feedback).
- If yes, treat every
Remove item as approved. If no, ask Remove or Keep for each, naming it by its exact text, not its location.
- Remove only the approved comments.
- Run the project's lint and typecheck; fix anything the changes broke.
Delegate the read-only search to a fast, low-reasoning subagent when one is available: request at most the limit, each with exact path, line, comment text, and one to three adjacent code lines. Otherwise search directly.
Comment Age
For each candidate, run:
git blame -L <line>,<line> --date=relative -- <file>
Use the relative date; mark uncommitted lines uncommitted.
Required Output
Use exactly these columns:
| Comment | Age | Why |
|---------|-----|-----|
| `// increment the counter` | 8 months ago | *Remove.* Restates `count++` verbatim. |
| `/** Returns the user id. */` | 3 weeks ago | *Remove.* Describes the function word by word. |
| `// debounce avoids hammering the API on each keypress` | 1 year ago | *Keep.* Explains intent, not mechanics. |
- Comment: Include the exact comment text in backticks.
- Age: Use the relative
git blame age.
- Why: Start with
*Remove.* or *Keep.*, then give one short reason.
Feedback
After presenting the table, ask:
Remove all recommended?
- Yes, remove all recommended
- No, I want to review each comment
1---2name: remove-dumb-comments3description: Flag comments that merely restate the code instead of explaining why, and remove only those the user approves. Use when asked to remove dumb, redundant, or obvious comments, clean up comments, or invoke `/remove-dumb-comments [<number>|all]`.4---56# Remove Dumb Comments78Flag comments that say *what* the code already says; keep every comment that explains *why*. The user chooses which flagged comments to remove.910## Invocation1112| Command | Behavior |13|---|---|14| `/remove-dumb-comments` | Find the 10 lowest-value comments. |15| `/remove-dumb-comments <number>` | Find that many lowest-value comments. |16| `/remove-dumb-comments all` | Find every low-value comment. |1718## Never Remove1920Keep any comment that carries a *why* the code cannot convey:2122- backports, compatibility, or version-specific behavior;23- infrastructure, deployment, or architecture;24- workarounds, gotchas, or non-obvious reasons;25- documentation, specifications, RFCs, or ADRs;26- bugs, issues, tickets, or contextual TODOs/FIXMEs;27- intent, trade-offs, or constraints.2829When unsure, keep it. Flag only pure restatements.3031## Workflow32331. Resolve the limit from the invocation (default 10).342. Search source files; skip generated output, vendored dependencies, lockfiles, and documentation.353. Rank candidates from most redundant to least.364. Get each candidate's age with `git blame` (see Comment Age).375. Present the table below, then ask whether to remove all recommended (see Feedback).386. If yes, treat every `Remove` item as approved. If no, ask `Remove` or `Keep` for each, naming it by its exact text, not its location.397. Remove only the approved comments.408. Run the project's lint and typecheck; fix anything the changes broke.4142Delegate the read-only search to a fast, low-reasoning subagent when one is available: request at most the limit, each with exact path, line, comment text, and one to three adjacent code lines. Otherwise search directly.4344## Comment Age4546For each candidate, run:4748```bash49git blame -L <line>,<line> --date=relative -- <file>50```5152Use the relative date; mark uncommitted lines `uncommitted`.5354## Required Output5556Use exactly these columns:5758```markdown59| Comment | Age | Why |60|---------|-----|-----|61| `// increment the counter` | 8 months ago | *Remove.* Restates `count++` verbatim. |62| `/** Returns the user id. */` | 3 weeks ago | *Remove.* Describes the function word by word. |63| `// debounce avoids hammering the API on each keypress` | 1 year ago | *Keep.* Explains intent, not mechanics. |64```6566- **Comment**: Include the exact comment text in backticks.67- **Age**: Use the relative `git blame` age.68- **Why**: Start with `*Remove.*` or `*Keep.*`, then give one short reason.6970## Feedback7172After presenting the table, ask:7374> **Remove all recommended?**75> - Yes, remove all recommended76> - No, I want to review each comment