<- all tokdocs

Tell Your Coding Agent to Stop Writing Comments and Save Tokens

Watch on TikTok

View on TikTok ->

This is a ten second clip with one instruction in it. Add a rule telling your coding agent to never write comments, because AI-generated comments burn tokens on every read and write without making the code better. The caption spells out the reasoning: models default to commenting everything because comments help humans, but if an agent is the primary reader of the code, most of those comments are dead weight.

The Instruction

Add one line to your agent's rules file (CLAUDE.md, Cursor rules, or the system prompt for whatever tool you use):

Never add comments to the codebase.

That is the whole tip. The rest of this doc is why it works and where it breaks down.

Why AI Over-Comments

Models were trained on tutorial code, documentation, and style guides that reward explanation. So they narrate: a // increment counter above counter++, a docstring restating the function name, a header block summarizing what the next five lines do. A human reviewer might tolerate this. An agent does not need it, because the code itself is in context and the model can read it directly.

Where the Token Cost Comes From

Comments cost tokens at three points, and the cost repeats:

Point What happens
Generation The model writes the comments, inflating output tokens on every edit
Context Every future read of the file pulls the comments back into the context window
Iteration Each refactor pass re-reads and often re-writes the commented blocks

A codebase an agent touches daily gets read far more often than it gets written. Comment bloat compounds monthly, which is the "usage every month" claim in the video.

The Quality Argument

The claim that comments lower output quality is more debatable than the cost claim, but it has a plausible mechanism. Comments consume context window space that could hold actual code, so on large files the model sees less of the logic. Stale comments are worse: a comment that no longer matches the code can steer the model toward the wrong behavior, since it may trust the description over the implementation.

Where the Advice Breaks Down

A blanket ban fits solo projects where an agent writes most of the code. It fits less well elsewhere:

  • Humans still review pull requests on most teams, and reviewers rely on comments for intent
  • Docstrings feed API documentation, IDE hover hints, and type tooling
  • "Why" comments that record a non-obvious decision protect both humans and agents from re-litigating it later

A workable middle ground is to ban narration comments ("what" comments) while keeping docstrings on public interfaces and rare "why" comments. Agents follow that distinction fine if the rule states it.

Key Takeaways

  • One rules-file line, "never add comments," cuts recurring token spend on every read and edit
  • AI comment bloat compounds because agents re-read files constantly
  • Stale or redundant comments can degrade output by wasting context and misleading the model
  • Keep docstrings and decision-record comments if humans read or review the code
  • The advice assumes agents, not people, are the primary readers of your codebase

Published August 30, 2026. Writeup generated from a favorited TikTok.