← ClaudeAtlas

compress-commentslisted

Use when a session's work left verbose or redundant code comments to clean up — after finishing a feature, before commit/merge, when the compress-comments-reminder hook fires, or when asked to "compress the comments", "clean up your comments", or "review the comments you added". NOT for reviewing code structure (use code-simplifier) or whole-repo audits (use repo-review).
mickzijdel/dev-hooks · ★ 0 · Code & Development · score 71
Install: claude install-skill mickzijdel/dev-hooks
# compress-comments Review the comments this session's work added and cut them down. AI-authored comments skew verbose: they restate the code, narrate the change, or argue with an imagined reviewer. One rule decides everything: > **A comment survives only if it states something the code cannot show** — a constraint, > invariant, gotcha, why-not-the-obvious-way, spec/issue link, or domain fact. Delete-biased: when in doubt, delete. Compress only when a real "why" is buried in verbosity — keep the why, drop the narration. ## Find the comments Judge only comments on lines this session's work added or changed. Never touch pre-existing comments. - **On a feature branch**: `git diff $(git merge-base main HEAD)` for committed work plus `git diff HEAD` for uncommitted work (substitute `master` where that's the default branch). Untracked new files are entirely yours — review all their comments. - **On the default branch itself**: review the commits you remember making this session (`git log --oneline` to jog memory; your commits carry the Claude co-author trailer), plus the uncommitted diff. ## Dispositions | Disposition | When | |---|---| | **Delete** (default) | The comment fails the survival rule: code-echo, change narration, planning forensics, reviewer justification, section headers, leftovers — see [references/comment-smells.md](references/comment-smells.md) for the taxonomy with examples. | | **Compress** | A real why is buried in narration: rewrite to just the