← Back to blog

Patch the Prompt

Simon Kihlberg Wallström 4 min read

When AI gives you bad code, the instinct is to fix the code. I’ve stopped doing that.

The Old Way: Patch the Output

Here’s what working with AI used to look like for me:

  1. Write a prompt
  2. Get something 70% right
  3. Fix the bugs, tweak the logic, clean it up
  4. Ship it

It works. But it doesn’t scale. Every time I needed another endpoint, another CRUD operation, another validation layer, I’d go through the same dance. Generate, fix, generate, fix.

The output was decent. But I was starting from zero every time.

The Shift: Patch the Input

Now I do something different. Instead of fixing what comes out, I invest in what goes in.

When the AI gives me bad code, I don’t touch the code. I go back to the prompt. I add context. I refine the instructions. I point to better examples.

More work upfront? Yes. But it compounds.

The next time I need that same type of work done, the prompt is already good. And the time after that. The prompt becomes the asset, not the code.

What This Looks Like in Practice

You have to work with the tools. Claude, Cursor, Copilot. They all have ways to configure context for your project. Rules files, commands, memory, custom instructions. Most developers skip this or add a few lines and forget about it.

That’s the leverage you’re leaving on the table.

I felt the pain most on repetitive tasks. The stuff that’s different enough each time that copy-paste doesn’t work, but similar enough that doing it from scratch is wasteful.

Our best example is how we add integrations. We invested heavily upfront in architecture, finding the right abstractions and patterns. Then we built Claude Commands to drive the process, keeping one or two integrations as gold standards. When we need a new one, the agent studies the reference, understands the patterns, and follows the established structure.

Adding a full integration shifted from a few weeks to a few days.

My prompts have shifted from how to what. The how is already captured in the context. I just need to say what I want.

The Mindset Shift

This is similar to what happens when someone shifts from IC to management.

Your output is no longer the amount of keys you push on the keyboard. You have leverage now. To be good at your job, you have to use it.

Some developers struggle with this. It feels like cheating. It feels like you’re not “really” working. But the work is different now. If you keep measuring yourself by keystrokes, you’re optimizing the wrong thing.

Where It Breaks Down

I’m not going to pretend this is 100%. It’s not. Not yet.

Some refactors still need hands-on work. It’s rare that I write something from scratch, but I work with the agent step by step. Being the driver. Guiding it through the tricky parts, cleaning up examples so they scale to new use cases.

You still have to put in the work. But the work is different. And the ROI is higher.

Everything Compounds Now

Here’s the thing I didn’t expect: all the “good hygiene” stuff suddenly matters more.

Keeping the code clean. Paying down tech debt. Updating documentation. Good test coverage with fast local tests. Hard lint rules. These always mattered, but now they compound in a new way. Your AI agents read your codebase. If it’s a mess, they’ll produce a mess. If it’s clean, they’ll follow the patterns.

That refactor you’ve been putting off? It’s not just about maintainability anymore. It’s about making your agents more effective.

Why This Matters

Agents need good prompts to run autonomously. Garbage in, garbage out. At scale. If your context is solid, you can actually let them loose.

At OAIZ, this is basically the entire product. Codifying processes as context and prompts. Turning tribal knowledge into something agents can execute on.

The companies that figure this out will operate differently. Not just faster. Differently.

The Bottom Line

Stop patching output. Start patching input.

It’s more work upfront. It requires a mindset shift. But it’s the way to scale what AI can do for you.

The leverage is there. Use it.


Want to go deeper? My cofounder Emil wrote about how we structure context and agents in our coding setup.