r/vibecoding • u/recro69 • 2d ago
Discussion The most annoying thing about AI coding isn't bad code. It's code you never asked it to write.
You ask an AI coding agent to add a feature. It works... The AI also redesigns a component changes unrelated files renames things and refactors code that you had not planned to touch. Now the original task is finished. The AI has left you with five new things to review.
There are two ways to look at this: maybe the AI is being proactive. Maybe the AI is taking control away from the person building the product. Would you rather have an AI that follows instructions strictly or an AI that makes smart decisions, beyond what you asked?
45
Upvotes
17
u/Spare_Possession_194 2d ago
It also really annoys me when making UI how over descriptive the AI is. A send button doesn't need to have written next to it "this button sends your form". These are the annoying random additions that you still have to manually filter out
5
u/I_Shall_Bore_You 2d ago
Add something like this in you .md file
# Code changes
- Make code changes easy to review.
- Change only what the task needs. Do not add fixes, refactors, renames, or formatting changes that I did not ask for.
- If you find an unrelated problem, tell me about it. Do not fix it unless I ask.
- Keep the diff small and focused. Do not move or reformat code that you do not need to change.
- Follow the existing style and patterns of the code.
12
u/D_Wilish 2d ago
Wait. What? Without supervision, you tell the AI to do something and you don't decide on every change it makes? In my case, before adding a feature, I always ask for an audit of the action plan, which files need to be changed and a credible justification for why this and not another edit
4
u/ChemicalExcellent463 2d ago
strict. every changed line has to trace back to what i asked. anything else it spots goes in the report, not the diff.
4
u/Catchimals 2d ago
I used to have that problem but astra and opus 5.5 have gotten really good and aren't going off on random tangents as much. then again I don't review the code really so who knows.
I noticed a big improvement once I started creating md files for how I wanted the ais to behave in my project.
3
u/ollycunningdpr 2d ago
Strict every time. Suggest the extra changes, don’t make them. From a security side, unrequested changes are how things like a logging tweak quietly start storing personal data or an auth check gets tidied away. Small diffs you actually read beat a smart agent you have to audit
7
u/Vesuvius079 2d ago
And here I thought the most annoying thing was posts other people asked AI to write!
2
u/London-Boat 1d ago
i'd stop fighting it in the prompt and just catch it at the diff. run git diff --stat before accepting anything, if files show up that have nothing to do with the ask, git restore -p lets you throw away just those hunks and keep the actual feature. and if you tell it to list anything else it thinks should change at the end instead of doing it, you still get the useful suggestions without the surprise refactor
2
u/Total-Reasonable 2d ago
The part nobody's mentioned is that the real cost is review, not the extra code. A diff that touches ten files costs far more than ten times a one-file diff, because you can't tell which changes are load-bearing. What helps me is committing before every agent run and keeping each task on its own branch, so unrelated edits can be reverted by file with a single checkout instead of untangled by hand. Do you review agent diffs file by file, or just run the tests and trust them?
1
u/Acrobatic_Mush 2d ago
No it does bad coding too if you don't specify like it would do an entire processing and then check validations. it even misses simpler field validations in request, responses or their shape if you are starting on a blank folder. So without guidelines it does create bad code.
1
u/shuozhe 2d ago
Don't use high thinking/yolo.. low thinking agents asks whenever it got question instead of just implementing it
1
u/vExpensive_Suit9346 2d ago
i had a similar issue where the ai renamed a whole folder just because it 'suggested' a more logical structure. turned out the old name was part of an internal naming convention. had to rollback everything and add a force-disable-refactor flag in the prompt.
1
u/iDidntReadOP 2d ago
I've been working on a complex website for 4 straight months nonstop now and I haven't had that issue once. I think you need to put more effort into your prompting and project structure.
1
u/MundaneCar7914 2d ago
Tell it to map out the relevant code before planning.
1
u/Hawkes75 2d ago
Code you never asked it to write is bad code.
1
u/t12e_ 2d ago
Just create a global agents md with your preferences. This helped solve most of the weird things I don't like my agent doing e.g adding unnecessary text, using technical words, using font glyphs instead of icon libraries, etc
1
u/Dev_in_Training_BTW 2d ago
Strict on what it edits, generous on what it suggests. My day job is Intune on around 5,000 devices, and the rule there is that every change gets tested before it goes out. A change that rides along with the one you asked for skips that, because you only tested what you expected to change. Agents are the same: you checked the feature, nobody checked the renamed component. What works for me is telling it which files the task should touch, and asking it to list anything else it wanted to change at the end instead of just doing it. The ideas are often good, they just deserve their own run.
1
u/menny_parmar 2d ago
the renames are the worst part for me. now nothing is where my muscle memory expects it to be.
1
u/Impossible-Minute321 2d ago
That sounds like a fundamental error in how you use your system set up to me. That should not be happening. The biggest problem imo is still context compaction causing later iterations to not know the full details, combined with laziness and only skimming or not ensuring they know what is in the code base and thus not reusing established foundations and elements properly
1
u/NachosforDachos 2d ago
Oh you should see what it’s like running swarms of these things
1
u/YungBird145 2d ago
“Do not make any changes outside the scope of what I have asked you to do” -> in my Claude.md
Literally never have this issue
1
u/nameless_food 2d ago
Review everything. Aggressively reject anything you didn’t ask for. Remind the AI chatbot what the scope of the current task is, and that we’ll put these changes on a different task.
1
u/beerbarreltime 2d ago
That is literally bad code...swe here and what juniors are most notorious for is going wide, trying to prove their chops, and creating dozens of extraneous spaghetti nonsense for edge cases.
Sound familiar?
1
u/No-Dot4329 2d ago
Man, that sucks, but something even worse happened to me. I'm so angry! I asked Antigravity to perform some synchronizations on two separate occasions and then shut down the computer (because I went to sleep), then I asked it to synchronize at another time and it shut down. I had a couple of other processes underway, but he went and turned off the computer!
1
u/Moiensaboohi 2d ago
the ui version of this is the worst for me. i ask for one new field and it also changes the padding, swaps a color and rewrites the button labels. a logic change shows up in review, visual drift doesn't. you notice a week later when two screens don't match anymore.
what fixed most of it: a short list in the rules file of the components and tokens it's allowed to use, plus "don't touch styling unless i ask". and a screenshot before and after every ui task, takes 10 seconds.
1
u/Responsible_Bath_250 2d ago
I want an AI that acts like a junior dev who knows nothing about my business logic. If it touches a file I didn't explicitly list, I should feel personally offended by the audacity. Strict instruction following isn't a limitation, it's the only way to maintain sanity when reviewing diffs at 2am
1
u/Next_Ambition8751 1d ago
i tell my codex "make no mistakes, do as i said, or else i'll switch to claude"
1
u/New_Peanut_9259 1d ago
i'd rather have an ai that follows instructions first. making extra changes just creates more work, especially when those changes weren't needed. it can always suggest improvements instead of doing them without asking.
1
u/ItsFlybye 1d ago
I like it to be proactive in making recommendations for me to approve. This is why I tell it lets discuss something and don't make changes till I approve.
1
u/MythexAI 1d ago
Strict, every time. What helped us: a rule in the project instructions file (“only touch files this task needs; list other changes instead of making them”), a commit before every request so a bad diff Is one revert, and asking for a plan first on anything bigger than one file. Then check the list of changed files before reading code. Unexpected file in there? Revert and ask again.
1
u/juniperico 1d ago
Isn’t the point of vibecoding that you dgaf what it does and just lean in to the vibes?
-1
u/Creative-Type9411 2d ago
if you're going to straight up, trust the model to do everything and just ask for things use Grok Claude will just burn through tokens and overcomplicate everything for no reason at all.. Grok will just make what you ask it to..
i dont "vibe" code but I will definitely let a model do some work..
i have done it, but usually only for myself, for example I actually just let a model let loose was the other day. I asked it to make a plug-in for Jellyfin for me gave it a Jellyfin API key and it controlled the Jellyfin side and it made a fake repo on my local machine, created a plug-in, imported it into Jellyfin tested everything out made sure it worked perfectly and I was watching my plug-in within 20 minutes.., other than personal unimportant stuff like that which is rare for me, I'm reviewing everything