Don't Trust AI Blindly in Your Codebase
AI is useful for boilerplate, but arguing with it about your system's logic is essential.
I use AI daily. Claude writes migrations, generates CRUD endpoints, refactors legacy PHP. It's fast. But I've learned the hard way: never let it make architectural decisions without pushback.
Last month, I integrated AI into a modernization project—migrating an old Odoo instance. Claude suggested a "clean" microservices split that looked good on paper. I questioned it. Turned out it would've created data consistency nightmares across four services. The AI followed a pattern, not the domain.
Here's what I do now:
Argue with it on specifics. When Claude proposes a solution, I push back. "Why this approach over caching?" "What happens if this service fails?" The AI adjusts and often catches its own mistakes when challenged. It's like code review with a teammate.
Trust it for scaffolding, not design. Need a Node.js middleware? Perfect. Need to decide between event sourcing and CQRS for your system? That's on you. I use AI to accelerate execution of decisions I've already made, not to make decisions for me.
Check its security assumptions. This matters more than people think. I built a Telegram bot with AI-generated code last year. The bot was processing user data—AI suggested storing tokens in plain variables. I caught it. AI doesn't inherently care about your security model.
Force it to explain. When AI gives you a solution, ask why. Not because it's sentient and owes you—but because explaining forces both you and the AI to validate the logic. Half the time, the explanation reveals the flaw.
The real risk isn't AI being wrong. It's developers trusting it too much. AI is genuinely useful for reducing boilerplate and speeding up predictable work. But your system's logic, security model, and architecture? Those require human judgment.
I'm not saying don't use it. I'm saying argue with it. Make it defend its choices. You'll ship faster and safer.
The best code I've written with AI assistance is where I questioned every suggestion.