no-comments
Lists every comment an edit added and asks whether it earns its place.
The comment guard runs inside skills hook post-tool-use after a file edit and lists every full-line comment the call added to a code file, then blocks with the rule: default none, keep one line only for an external constraint, a landmine, or why the obvious approach lost. Up to six lines are shown with their file name.
What counts as added depends on the edit:
- An Edit:
new_stringminusold_string. - A Write or MultiEdit: the file re-read from disk and diffed against git HEAD.
- In Codex, each hunk of an
apply_patchcall is diffed like an Edit, whether it arrives as theapply_patchtool or as a shell command that runsapply_patch.
A comment you keep is flagged once, when it is written, and the tree sweeps of the commit guard and the reply guard skip it for the rest of the session. OpenCode is the exception, since its tool events carry no session id. A later Edit reports only the lines its own new_string adds. A Write compares the whole file against HEAD, so a kept comment in a file with uncommitted changes shows up again on the next Write or MultiEdit of that file, and stops once the file is committed.
The lines come from the shared detector, which knows full-line comments only.
When It Stays Silent
- No comment line was added.
- The file has no marker table in the detector, prose files included, or its path matches
AGENT_HOOKS_SKIP. - Every added line is a shebang, a lint, type or compiler pragma, or part of a license header.
AGENT_HOOKS=0is set.
A Write to a file git HEAD does not have, or outside a repository, is diffed against nothing, so every comment in it counts as added.
An Edit with an empty new_string is still checked. The hook puts the deleted text back to
rebuild the file as it was and diffs that against the file on disk.
When the event matcher lets through a tool that is not a file edit and the payload names no file, the hook blocks and asks for the matcher on the Claude Code page, so nothing passes unscanned by accident. A payload that is not JSON is silent.