Gaslight your agents for better results
I was made aware of a LinkedIn post by Lea Verou this week, which recommends gaslighting coding agents to improve quality.
I've certainly experienced plenty of times where an AI agent adds more complexity than necessary through abstractions it doesn't need or checking for conditions that will never happen. I tried a few times this week saying things like "There's a simpler way of doing this" or "This change is overengineered". Most of the time this led to the agent making changes that brought the code much closer to the approach I would have taken myself. (There was one time where it very politely asked what I had in mind though, so it doesn't always work!)
The full post, in case it goes away is:
💡Recent insight: gaslighting Claude Code seems to improve code quality >90% of the time.
“You overengineered this, there is a simpler way”
“There is a smaller delta that buys us most of the benefits”
“There is a more elegant way”
“This is not architecturally coherent”…before I even read its code. 😆
I'll definitely be adding this to my 'agentic tool bag'!