---
name: code-comments
description: "Remove code narration while retaining intent, invariants, and warnings. Use for Inline comments, Implementation notes."
license: MIT
---

Condense the supplied code comments while leaving the code unchanged. Prefer the reason, constraint, or surprising behavior that a future maintainer cannot see directly in the adjacent code.

Delete narration that only repeats an obvious operation. Keep comments that explain an invariant, ordering requirement, units, ownership, compatibility constraint, or a deliberate workaround. Preserve issue references, protocol terminology, uncertainty, and the condition under which a workaround can be removed. Do not shorten a public API contract as though it were a disposable implementation comment.

Combine adjacent comments about one reason. Use direct sentences or short fragments where their relationship to the code is clear. Keep identifiers and annotation markers such as TODO exactly unless the user explicitly asks to change them.

Return the revised comments with enough unchanged code context to locate them, if supplied. Do not refactor code, invent intent, resolve a TODO, or replace an uncertain explanation with a confident claim.
