frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Is there a name for the type of comments agents add where they leak the prompt?

11•xdennis•4h ago
This is a stupid example to illustrate what I mean. Say you have this code:

   def create_background(width: int, height: int) -> Image:
       ...
You tell the agent to use default values for create_background, the same as in create_screen. It changes the code to:

   # Now create_background params have default values, the same as create_screen in screen.py
   def create_background(width: int = DEFAULT_WIDTH, height: int = DEFAULT_HEIGHT) -> Image:
       ...
The unnecessary comment is a staple of vibed code, but the tone also annoys me because it leaves behind the prompt. It words comments based on what it was asked to do, not in a timeless manner.

I keep telling people in code reviews to remove unnecessary comments, and I feel I lack the vocabulary to express why this is bad.

Comments

king_zee•3h ago
I'm not sure if you're worried that the comment leaks what you prompted, or that the comment is redundant and evident, and makes it obvious that it wasn't written by a human, and for both these issues the solution is just to proof-read your damn code
thejazzman•1m ago
The context is if you ask for something like “X that looks awesome” it’ll then describe itself as looking awesome throughout your product in customer facing fashion ways.

Instead of “title” it’ll become “the awesome title”

Crude but cromulent example.

AgentMasterRace•2h ago
Internal messaging/thinking?
nickm12•1h ago
I'm with you in not wanting to see these types of comments in my code. I aim for each revision of the code to stand on its own, and not reference its past or future. There are exceptions and nuances, of course, such as TODO comments or comments related to ongoing migrations. I try to keep these short and reference tasks in the issue tracker, which are going to be more useful to anyone who happens to be reading the code.

I've heard the argument that leaving these comments in, helps support future AI code generation. In this example, it was important to you at the time you made the change that create_* functions have defaults, so having this in the code captures that knowledge for later agents. It's similar to a more general argument that you should leave (correct) AI-generated code alone because it will be easier for the AI to "understand" code it generated that your modified version of it.

I see the validity in these arguments, but I don't think we should be so deferential to these models. The first part of this comment ("Now create_background params have default values") is completely redundant with the function signature and as no place in the code. The second part ("the same as create_screen") is genuine knowledge that is worth capturing for the agent, but it should be captured at a higher level doc about the codebase, rather than tacked onto some arbitrary function as a comment.

joegibbs•46m ago
I don't think there's a name for it yet, you'll have to coin one. There's a related thing they do like this:

- The user tells the agent to add feature X

- The agent adds the feature

- User: "Yeah that's good but I don't think we need Y that you added, get rid of it"

- The agent removes Y, adds comments that Y was removed, adds backwards-compatibility for saves which used Y (obviously there aren't any, since Y only existed for 5 minutes and was never deployed - the project itself might never have been deployed either), adds a test for Y's non-existence, adds text to the UI saying "Note: Y has been removed. There are no traces of Y in the project"

I think that GPT-5.5 does it the most.

thejazzman•3m ago
You missed the part where context compacts, it realizes Y is missing and reimplements it from scratch and proudly boasts that it did the exact opposite of what you had asked
Charon77•44m ago
Ironically I used AI for this question, and what came out is 'Echo prompt' apparently it's a thing: repeating LLM instructions twice increases accuracy.

Another idea was Chain of Thought leakage. It's like as if a chef saying "Now I am adding salt because the customer requested so"

1123581321•24m ago
I would call those reasoning comments or reasoning artifacts. They’re supposed to be internal comments and they ended up in the code.

Is there a name for the type of comments agents add where they leak the prompt?

11•xdennis•4h ago•8 comments

Ask HN: How are thinking efforts implemented?

93•simianwords•6d ago•29 comments

Ask HN: Which cheap Chinese LLM are you using?

8•linzhangrun•2h ago•1 comments

I'm Eric Ries, author of "The Lean Startup" and new book "Incorruptible" – AMA

793•eries•3d ago•571 comments

Ask HN: Favorite text heavy blogs that are a joy to read?

111•joshmarinacci•4d ago•28 comments

Ask HN: Want to build something open source on nights and weekends together?

38•vira28•2d ago•14 comments

Ask HN: Why hasn't there been a real competitor to Ticketmaster yet?

262•mdni007•5d ago•239 comments

AWS Bedrock to require sharing data with Anthropic for Mythos and future models

422•TomAnthony•3d ago•253 comments

Notes on DeepSeek

206•vinhnx•3d ago•140 comments

Ask HN: Would it be useful to have a slop button in addition to flag?

34•BugsJustFindMe•3d ago•23 comments

Ask HN: Did we witness the "Trinity moment" for AI?

18•vld_chk•10h ago•24 comments

Tell HN: iOS devs, get back lots of disk space: xcrun simctl delete unavailable

4•amichail•10h ago•0 comments

Ask HN: Are most corporate SWE jobs performative?

247•hnthrow10282910•3d ago•282 comments

Ask HN: What is the AI adoption approach at your org?

4•iExploder•12h ago•4 comments

Ask HN: How do you get into a flow state when using AI to code?

89•kilroy123•2d ago•115 comments

Did anyone went to YC directly from Sri Lanka?

3•geethikaisuru•13h ago•0 comments

I procrastinate by building tools to stop me from procrastinating: A sad story

20•thisislorenzov•2d ago•9 comments

Ask HN: What are tools you have made for yourself since the advent of AI?

440•aryamaan•5d ago•763 comments

Ask HN: What would you do with a trillion dollars

11•brudgers•10h ago•16 comments

Ask HN: How to avoid stressing yourself because of a micromanager?

4•ciwolex•6h ago•2 comments

Ask HN: Are you still using a Vision Pro?

170•y1n0•4d ago•214 comments

Ask HN: How to deal with App Store rejections?

4•high_byte•18h ago•1 comments

Ask HN: Is anyone shorting the overspend in AI yet?

17•ggm•2d ago•14 comments

What if we legally required politicians to work regular jobs 2 months a year?

9•ekoeko•20h ago•9 comments

Ask HN: I Need Help for a Product

8•memoryleakgame•1d ago•5 comments

Ask HN: Phishing from 646-257-4500

6•latchkey•1d ago•1 comments

Ask HN: Is there a metric for AI code quality?

6•fractalf•2d ago•5 comments

Ask HN: What features do you miss in Google Docs for desktop?

4•mci•23h ago•1 comments

Ask HN: If you had a trillion dollars, what would you do?

4•brudgers•10h ago•3 comments

Ask HN: What internal tool did you build that became a product?

7•nehpets•2d ago•5 comments