Oliver Eidel · March 02, 2026

Patterns of Agentic Coding with Rails

A few more learnings while using Claude Codex and OpenAI Codex for building Rails applications. It's somewhat hard to find similar learnings by similar people doing similar stuff on the internet as Twitter and Reddit tend to be flooded with engagement bait which tends to drown out quiet builders like me. Maybe we need to revive the old-school phpBB-style forums, chuckle.. stay tuned on that one.

Anyway, end of rant and mysterious self-promotion, here are the goods:

"Take a look at this other project"

Building stuff takes time, even with agents. The most common reasons for this are:
  • Human-in-the-loop feedback / "taste": You try out stuff which your agents built and provide feedback.
  • Iterative debugging: Your agent gets stuck trying to build something and the agent only becomes un-stuck either after multiple tries or after you providing technical directions (common example in Rails: "Use Turbo" instead for weird custom-built Ajax logic).
Now the interesting thing here is that you can save time in the future if you've solved this once in any of your Rails projects. My prompt for this is:
Take a look at the project at ~/foo/bar/project and implement a similar Stripe payment feature here.
This is super useful because your agent will 1) save a ton of time as you don't have to re-invent the wheel and 2) not blindly copy it which even gives you some opportunities for improving upon the prior implementation.

Thinking further, it could be interesting to implement some sort of "component library" within an agent's memory or so, i.e. stuff which the agent has already built and can mostly copy and paste. Just like how you as a senior developer have various projects which you can copy-paste stuff from.

The Revival of System Tests

DHH famously declared system tests dead in his 2025 keynote, saying that controller tests are good enough. Importantly, they are less flaky (no headless Chrome) and run faster.

But agentic coding will lead to the revival of system tests, at least in my opinion.

I've experimented building Rails projects with and without system tests, and my #1 surprise is that system tests uncover a huge amount of bugs. Usual trivial stuff like that submitting a form doesn't redirect a user to the next page, or that toast / flash messages are not shown etc.

All of this provides an additional feedback loop for your agent and saves you time because you as a human no longer have to do the QA testing.

(It goes without saying that you should instruct your agent to create tests and run them in general, which includes creating fixtures, model and controller tests)

Copy-Pasting from AppSignal, Sentry etc.

It's interesting to just copy-paste AppSignal errors into the terminal with a prompt like "Investigate". Usually, it works.

"Reproduce first"

Whenever you encounter a bug on production, it might be very helpful to tell the agent to "reproduce this bug in a test locally first". This creates 1) a feedback loop on whether the bug has actually been fixed locally, 2) saves you time as it takes you out of the feedback loop and of course 3) reduces the probability of this occurring in the future.

Leave a comment. Or send me a message on LinkedIn.