Help us improve
Share bugs, ideas, or general feedback.
From code-habits
Use when writing or editing code that contains repeated-looking calls on different structures, bitmask/bit-fiddling, ordering-sensitive sequences, or multi-step state mutations across data structures — adds a short inline comment per step explaining WHY each step is distinct, so a reader doesn't stop and ask "wait, why are there three of these?". Does not apply to trivial code with self-explanatory identifiers.
npx claudepluginhub amitkot/claude-code-tools --plugin code-habitsHow this skill is triggered — by the user, by Claude, or both
Slash command
/code-habits:comment-non-obvious-stepsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Default is no comments. The carve-out: when a step's intent isn't obvious from the identifiers — repeated-looking calls on different structures, bit fiddling, ordering-sensitive sequences, or the same field mutated at multiple layers — add a brief inline comment per step explaining WHY this step is distinct.
Guides technical evaluation of code review feedback: read fully, restate for understanding, verify against codebase, respond with reasoning or pushback before implementing.
Share bugs, ideas, or general feedback.
Default is no comments. The carve-out: when a step's intent isn't obvious from the identifiers — repeated-looking calls on different structures, bit fiddling, ordering-sensitive sequences, or the same field mutated at multiple layers — add a brief inline comment per step explaining WHY this step is distinct.
A future reader (often the same human, a week later) scanning the function shouldn't have to stop and ask "wait, why are there three remove() calls — is one redundant?". One short comment per step turns "I have to reverse-engineer this" into "ah, secondary index, then primary store, then GC". The comment is the difference between a 10-second read and a 5-minute investigation.
This does NOT contradict "no comments by default" — trivial code with self-explanatory names still needs none. The trigger is: a reader will plausibly stop and ask why.
Add a comment when a step is one of:
remove, 2x insert, etc.)x & !FLAG_FOO, bits >> 3)Comment the WHY/WHAT-IS-DIFFERENT, not the what. // remove from cache is noise; // drop cached view so next read repopulates from primary earns its line.
Multi-remove (the live case):
// BEFORE — reader: "why three removes?"
self.by_sender.remove(&sender);
self.orders.remove(id);
self.parents.remove(&group_id);
// AFTER
self.by_sender.remove(&sender); // secondary index
self.orders.remove(id); // primary storage
self.parents.remove(&group_id); // GC empty parent group
Bitmask:
// BEFORE
flags = (flags & !0b0011) | (new & 0b0011);
// AFTER
flags = (flags & !0b0011) | (new & 0b0011); // replace low 2 priority bits, keep upper flags