code-comments

code-comments is a skill for Claude Code, Codex from luabagg/agent-skills. It costs 34 tokens per session (1,713 once invoked), scanned A, original, MIT.

A writing guide for code comments, type comments, tuned constants, and README sentences that state measured facts. It explains when a comment adds useful context and when the code should be renamed or restructured instead.

In plain words
What is it for?
Use it when writing or reviewing comments, documenting measured values, explaining unusual implementation choices, or checking README wording.
Why use it?
It helps documentation explain constraints, guarantees, and non-obvious choices without repeating what the code already says. This makes comments more useful and less likely to become clutter.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when writing or reviewing comments, documenting measured values, explaining unusual implementation choices, or checking README wording.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/luabagg/agent-skills/code-comments
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add luabagg/agent-skills --skill code-comments
Clone the repo
git clone --depth 1 https://github.com/luabagg/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for code-comments

README.md
[![agentmods](https://agentmods.dev/badge/skills/luabagg/agent-skills/code-comments/github.svg)](https://agentmods.dev/skills/luabagg/agent-skills/code-comments)
Your own site
<a href="https://agentmods.dev/skills/luabagg/agent-skills/code-comments"><img src="https://agentmods.dev/badge/skills/luabagg/agent-skills/code-comments/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for code-comments

Your own site · 80×15
<a href="https://agentmods.dev/skills/luabagg/agent-skills/code-comments"><img src="https://agentmods.dev/badge/skills/luabagg/agent-skills/code-comments.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,713 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00034 $0.01713
Opus 5.5 $0.00014 $0.00685
Sonnet 5.5 $0.00007 $0.00343
Haiku 4.5 $0.00003 $0.00171

Measured 16d ago against content hash f8c86b896048, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

code-comments scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 16d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/code-comments/SKILL.md · 167 lines

How it starts

The opening of the file, as written. The whole thing — 167 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Code Comments

A comment carries what names, types, and structure cannot. Write it for a reader who knows the product but not the code, the library, or the field's jargon. Most code needs no comment. When one is needed, it reads without the body: a reader who has not opened the function must understand every sentence.

When to comment

Write a comment when one of these is true:

  • The code owns a guarantee, constraint, side effect, or failure mode a reader cannot see from the signature.
  • The code does something a reader would call a mistake: a provider bug, a compliance rule, a value chosen from evidence.
  • The code follows an order that matters and the order is not obvious.
  • A value is tuned and a different value has a known cost.

When not to comment

  • A trivial function gets no comment.
  • Do not comment a type whose name and fields say what it holds. Rename a field before you explain it. Use code-naming to find the name.
  • Do not comment an ordinary block inside a function. Extract a named function instead.
  • Do not narrate the implementation or write a full docstring.
  • A file gets a header only when it is an index, or when the file-level rule is not the sum of its functions' comments.

Shape

  • A function gets at most one comment, above it. The first sentence says what the function does. The sentences after it carry the rule, edge case, guarantee, or failure the signature cannot show.
  • The first sentence may overlap the name. It exists so the reader does not have to open the body. "Do not restate the name" applies to the sentences after it.
  • A type or table comment opens with what it holds, then states the invariant its fields cannot express: two fields that must agree, a unit, a range, a lifecycle rule. Do not comment fields or union members.
  • A tuned constant states the failure the value prevents. When the obvious value fails, state the cause that makes it fail.
  • An order comment states what breaks under the other order.
  • When a comment lists an order or several distinct points, write a list. Do not join the points into one paragraph.
  • Start a list on the line after the sentence that introduces it. Do not put a blank // line before the first item.

Read the full file on GitHub · 167 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 16d ago Changed · +2 lines f8c86b896048
  2. 1mo ago Changed · +44 lines · +4 tokens per session 9a74e56332fe
  3. 1mo ago First seen · 121 lines · 30 tokens per session scan A 0dcf4906b374

Subscribe to this mod's changes

code-comments is a skill published in the GitHub repository luabagg/agent-skills (3 stars, last pushed 9d ago), licensed MIT. It adds 34 tokens to every session and 1,713 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.

Related

Other skills, from other repositories

harness

Connect this Bankr account to the user's Harness account (tryharness.ai) and manage everything Harness-side from here. Pair with a signed wallet proof, then inspect the Harness trading wallet and portfolio, fund it on the user's request, request withdrawals back to this wallet, buy Harness credits with $HARNESS over…

BankrBot/skills · 114 tokens

web-ui-motion

Build polished front-end UI together with a signature motion effect in a single self-contained HTML file, combining SVG.js / SVG filters and the Canvas 2D API. Use when the user asks to build a web page, landing page, dashboard, or component that has a special visual effect, animation, particle system, fluid/water…

creativedswork/dscode · 152 tokens

openspec-propose

Create a complete OpenSpec proposal with design, specs, prototype, and tasks. Use when the user wants a change ready for implementation.

creativedswork/dscode · 32 tokens

prototype-workflow

Generate and lifecycle-manage HTML prototypes for UI exploration and OpenSpec changes. Use when creating, validating, completing, or archiving a UI prototype.

creativedswork/dscode · 34 tokens

html-output

Produce rich, self-contained, single-file HTML as the default output format instead of Markdown — for specs, plans, code reviews, PR write-ups, reports, explainers, design explorations, slide decks, SVG diagrams, and small interactive editors with copy-as-prompt/JSON export. USE WHEN the user asks to "make an HTML…

creativedswork/dscode · 0 tokens

harness-engineering-guide

Audit, design, and implement AI agent harnesses for any codebase. A harness is the constraints, feedback loops, and verification systems surrounding AI coding agents — improving it is the highest-leverage way to improve AI code quality. Three modes: Audit (scorecard), Implement (set up components), Design (full…

OdradekAI/harness-engineering-guide · 182 tokens