AI Coding Weekly

Pocock's prompt sorts code comments into four buckets, deletes three

The excuse category treats a comment as evidence of a hack the agent talked itself into, not as documentation.

Matt Pocock published a prompt that walks an agent through every code comment in a codebase and sorts each one into four categories. Tautology, a comment that repeats what the code already shows. Excuse, a comment that lets a hacky implementation stand. Stale, a comment pointing at code or implementation details that no longer exist. Decision record, a comment documenting an important, non-obvious decision.

Matt Pocock
@mattpocockuk
X
I'm sold - comments considered harmful
Nov 20, 2026 · View on X
Matt Pocock
@mattpocockuk
X
many comments allow the agent to get away with a hacky implementation, which then gets propagated through the code
Nov 20, 2026 · View on X

The actions differ per bucket. Tautology and stale comments get deleted outright. Decision records get moved into an ADR, short for architecture decision record. Excuse comments get deleted too, but they also get an issue filed to fix the implementation underneath them.

Why the excuse bucket is the interesting one

Pocock's stated reasoning for that category is that "many comments allow the agent to get away with a hacky implementation, which then gets propagated through the code". That reframes a comment from documentation into evidence. The agent wrote prose explaining why the shortcut was acceptable, the shortcut shipped, and the next agent read the shortcut as precedent. Deleting the comment without filing the issue would just hide the hack, so the prompt does both.

The prompt does not stop at a cleanup pass. It asks the agent to create a lint rule banning comments for the codebase or section being cleaned, to take a ratchet approach on the assumption that not every comment gets removed in one PR, and to create a /delete-comment skill in the repo so the process can be repeated. It also asks for an estimate of how many lines of code the full deletion would shed.

That lint rule is consistent with what Pocock was earlier testing, harsh lint rules as a way of constraining agents. A ban on comments is a constraint the agent cannot talk its way around with a paragraph of justification.

For working engineers, this is one person's prompt and one person's theory, not a measured result. Pocock's own summary line is the whole argument in five words.

Have the good opinion, not the loud one

One email a day. Under three minutes. What working engineers found out about coding with AI.

Get the next one by email

Coding with AI, read daily so you do not have to. The experiments, the receipts and the arguments from engineers shipping real software. Not a changelog.