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 agentic-tool-labsv0.5.0Apache-2.0In 1 marketplace
Blocks comments that only make sense next to the diff.
You run one by typing its /name in Claude Code.
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
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Stops Claude from writing comments that only make sense while the diff is on screen:
// changed from foo to bar
// NEW: added validation
// now uses the new API
// as suggested, kept this for backwards compat
// increment counter ← above counter++
// temporary
Once the change merges, every one of those describes a change nobody can see any more. Git history already records what changed. The code doesn't need to narrate its own edit.
/code-critic in github-pr-toolkit catches
these at review time. This plugin stops them being written in the first place.
/plugin marketplace add agentic-tool-labs/agent-tools
/plugin install comment-discipline@agent-tools
Then run /comment-discipline init (see Setup).
Don't write change narration; references of any kind (ticket or issue IDs,
spec numbers, finding IDs, review-round labels, decision markers); asides
aimed at the reviewer; comments that restate the line; task narration
(// Step 1: …); or bare time markers.
Do write public-API behavior and contracts, and why non-obvious code is the way it is: a workaround, an external constraint, a deliberate tradeoff. A comment describes how the current code works, never what changed, which spec applied, or what was decided.
Two guards keep it from backfiring.
First, it never asks you to document anything. A review lens can be purely subtractive, but an authoring rule can't, because the model is deciding whether to write a comment at all. Without this guard the rule turns into defensive doc-comments added to prove compliance, which is worse than the original problem. When in doubt, write nothing.
Second, it only covers comments you write or edit. It doesn't go cleaning up comments that were already there. That makes for noisy diffs and is out of scope.
Time markers are fine with a condition attached.
// TODO: remove once the v2 endpoint lands is good and stays. A bare // for now isn't, and neither is an
issue number standing in for the condition. A TODO is the one place a reminder
about a decided deferral belongs.
A SessionStart hook injects the rule on startup, resume, clear, fork,
and compact. The last one matters most: compaction is what quietly drops a
directive mid-session and lets the old habit creep back.
SessionStart only fires for the main session. A subagent isn't a session, so
that hook never runs inside one. That gap matters more here than for most
plugins, because subagents write plenty of code, and an Implementor or a
general-purpose agent is exactly who leaves // NEW: added validation behind.
So the rule reaches subagents two ways.
SubagentStart. A hook injects the rule into
the subagent's own context as it starts, before its first turn. This event
does deliver into the subagent, but only when the hook emits a JSON
hookSpecificOutput object. The same text written as plain stdout is
thrown away silently with no error. That's the opposite of how
SessionStart behaves, and it's why this channel is easy to write off as
broken. Agent types known not to write code (Explore, Plan, a
task-gopher runner) are skipped, so the roughly 2.4KB is only spent where
code might get written.PostToolUse hook on
Edit/Write/NotebookEdit injects the rule once per subagent.
SubagentStart marks each agent it reached, so for a normal dispatch this
hook finds the mark and stays quiet.Before 0.3.0 the first channel was a relay clause: the directive asked the
dispatching agent to copy the rule by hand into any dispatch prompt that might
write code. That cost the parent output tokens on every dispatch, depended on
the model cooperating, and had to place its copy below any block already at the
top of the prompt so it didn't break another plugin's check for a sentinel at
the top. SubagentStart needs none of that, and it doesn't compete for the
Agent tool's input, which task-gopher's relay already owns.
It has two limits.
The backstop is probably redundant now. Measured on 2026-07-29,
SubagentStart fires for workflow-spawned agents too, meaning agents created
without any Agent tool call, which a prompt-rewriting channel can't reach at
all. So the case the backstop was kept for, a spawn with no SubagentStart
event, may never happen. It stays for the one case that's still real: the hook
fired but couldn't save its mark. It costs one file read per edit, set against
a channel whose failures are silent.
The first edit isn't covered by the backstop, because that injection arrives
with the edit's result. SubagentStart is what covers edit #1, and it's the
only thing covering a subagent that makes exactly one edit.
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 agentic-tool-labs/agent-tools --plugin comment-disciplinePlugins from other owners that cover similar ground