Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By systemfsoftwarev0.3.7Apache-2.0In 1 marketplace
Flags comments that restate the code after each Write, Edit or MultiEdit and sends the reasons back so Claude deletes them. Its installed hook command only echoes that comment-checker did not run.
Trending plugins
7-day copy clicks
Run automatically on Claude Code events. Claude doesn't decide.
1 caution to review before installing
A hook runs when Claude writes or edits files
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
code-comments, comment-cleanup, linting, hooks, code-review, comments, claude-code
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Coding agents tend to write comments that restate the code next to them: // increment counter above counter += 1;. comment-checker is a PostToolUse hook for Claude Code that runs after every Write, Edit or MultiEdit, flags those comments, and sends the reason back to the model so it can delete them.
It is a single native binary built on tree-sitter. It parses 37 languages, keeps comments that carry a reason (licence headers, linter directives, @param docs, // Workaround for ...), and never calls a model or the network.
$ echo '{"tool_name":"Write","tool_input":{"file_path":"src/math.ts","content":"// increment counter\ncounter += 1;\n"}}' | comment-checker
An automated reviewer flagged 1 comment(s) in src/math.ts as unnecessary.
Each is stated with the specific reason it should be removed. Do not
dismiss these as "justified" — the reason is given so the claim can be
checked, not argued away.
line 1 — // increment counter — restates what the code already says (shares counter; increment ↔ +=)
Action: delete the flagged comments. If the code is unclear without
one, make the code self-explanatory instead — better names, extraction,
a clearer type — and do not re-add the comment.
The exit code is 2 in that case. Clean input prints [check-comments] Skipping: No unnecessary comments found and exits 0.
| Class | Flagged example |
|---|---|
| Restatement | // increment counter above counter += 1; |
| Control-flow narration | // loop through items above for item in items: |
| Changelog memo | // Changed from old_api to new_api |
| Dead code | // console.log("debug", value); |
| Untracked TODO | // TODO: fix this later |
It keeps comments that carry a reason or a tool directive: licence headers and SPDX tags, linter directives such as # noqa and // @ts-ignore, structured API docs such as @param, @returns, Args: and # Safety, BDD annotations such as // Given, and rationale such as // Workaround for upstream race in connection pool.
Verdicts that depend on surrounding code never convict a fragment. On Edit and MultiEdit, only comments the edit introduces are checked.
The package is not published to npm. Take the binary from this repository's Nix flake, which is built at each release tag. The flake provides packages.default and packages.comment-checker, wrappers that run the binary under bubblewrap on Linux and sandbox-exec on macOS, with no network access and no host environment. packages.comment-checker-unwrapped is the raw binary for a host that already provides its own sandbox.
nix profile install github:systemfsoftware/comment-checker \
--option extra-substituters https://nix.systemfsoftware.com \
--option extra-trusted-public-keys 'nix-cache-1:wXA8I4DayNW9q6enUyQA/P/nT38pGSTLt374t3gsn7M='
comment-checker --version
In a flake of your own, add the input and reuse its package:
{
nixConfig = {
extra-substituters = [ "https://nix.systemfsoftware.com" ];
extra-trusted-public-keys = [ "nix-cache-1:wXA8I4DayNW9q6enUyQA/P/nT38pGSTLt374t3gsn7M=" ];
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
comment-checker.url = "github:systemfsoftware/comment-checker";
};
outputs = { nixpkgs, comment-checker, ... }: {
devShells.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.mkShell {
packages = [ comment-checker.packages.x86_64-linux.default ];
};
};
}
Supported systems are x86_64-linux, aarch64-linux and aarch64-darwin. On Linux, an unprivileged bubblewrap needs unprivileged user namespaces: Ubuntu 24.04 and later ship kernel.apparmor_restrict_unprivileged_userns=1, which makes the wrapper fail at loopback setup (bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted); the wrapper works once that sysctl is 0.
Add the hook to .claude/settings.json in a project, or to ~/.claude/settings.json for every project:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit|MultiEdit",
"hooks": [
{ "type": "command", "command": "comment-checker" }
]
}
]
}
}
Claude Code treats exit 2 as a block and passes stderr back to the model. Any other non-zero exit, including 127 when the binary is missing from PATH, does not block the write, so confirm the binary resolves with command -v comment-checker from the directory where Claude Code runs.
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub systemfsoftware/comment-checker --plugin comment-checkerPlugins from other owners that cover similar ground