code-comments

code-comments is a skill for Claude Code, Codex from luabagg/agent-skills. It costs 64 tokens per session (2,452 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 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,452 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.00064 $0.02452
Opus 5.5 $0.00026 $0.00981
Sonnet 5.5 $0.00013 $0.00490
Haiku 4.5 $0.00006 $0.00245

Measured 1mo ago against content hash fbea17a282bf, 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 1mo 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 · 213 lines

How it starts

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

Code Comments

A comment has one of two jobs:

  • A documentation comment sits above a declaration. It tells a caller what the code does, how to use it, and how it behaves. A caller does not read the body.
  • An implementation comment sits inside a body. It tells a maintainer why the code is the way it is.

Write for a reader who knows the product but not the code, the library, or the field's jargon. Most code needs neither. First try to make the code say it. Use a better name (see code-naming), extract a function, or return a typed result in place of a sentinel. Comment only what is left.

When to write a documentation comment

  • If the name and signature already say it all, write no comment. For a type, that means its name and fields.
  • Exports get one by default. Their callers live in other files and read only the import and the signature. Leave an export without one only when the rule above clearly holds.

Documentation comments: functions

  1. The first sentence says what the caller gets or what the function changes. Start it with a third-person verb: "Returns…", "Looks up… and stores…". Do not start with an imperative ("Return…") or a noun phrase ("One row for each…"). Keep it to one fact.
  2. Then list the other facts a caller needs, one bullet each. Each bullet is a fact about the behavior, not a step of the body and not something the signature already says. A surprising null, error, side effect, or cost often qualifies.
    // Uses spare potatoes to raise demand across workforces.
    // - Only potatoes older than a week count as spare.
    // - A workforce with no stock gets nothing.
    
    Not: "- Takes the input", "- Catches exceptions", "- Returns the potato count".
  3. Stop. Do not say how the body does its work. The body can change while the contract stays the same.

Then test each sentence after the first. If the name, the parameter names, or the types already say it, delete the sentence. The body does not count, because a caller does not read it. A function that keeps more than four facts after the test often does too much. Extract a function before you cut a fact.

Read the full file on GitHub · 213 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. 1mo ago Changed · +17 lines fbea17a282bf
  2. 1mo ago Changed · +29 lines · +30 tokens per session 19dc5905aad3
  3. 2mo ago Changed · +2 lines f8c86b896048
  4. 2mo ago Changed · +44 lines · +4 tokens per session 9a74e56332fe
  5. 2mo 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 4d ago), licensed MIT. It adds 64 tokens to every session and 2,452 once invoked, about $0.0003 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

code-comments compared with skills from other repositories

code-comments next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
code-commentsluabagg/agent-skillsSkill34d agoMITA64Claude Code, Codex
minipostiz-facebook-setupjavimosch/supercliSkill585d agoMITA32Claude Code, Codex
mmx.agent-guidejavimosch/supercliSkill585d agoMITA34Claude Code, Codex
minipostiz-reddit-setupjavimosch/supercliSkill585d agoMITA34Claude Code, Codex
minipostiz-telegram-setupjavimosch/supercliSkill585d agoMITA34Claude Code, Codex
minipostiz-x-setupjavimosch/supercliSkill585d agoMITA37Claude Code, Codex
clawteam.case_study.veg_basket_pocjavimosch/supercliSkill585d agoMITA35Claude Code, Codex