Experiment: Hexagonal Architecture Slows Coding Agents, Flat Code Wins 4 of 6 Hard Tasks
kristiyanstoyanovAI · reddit · 2026-09-16
The author ran a controlled experiment to test whether clean architecture standards still help when agents write most of the code. Two versions of an EV charging invoice service were built: one with hexagonal (ports and adapters) architecture plus architecture tests, one flat with no suggested architecture, both validated by the same external business-level test suite.
Results:
- Across 9 sequentially added features, the hexagonal version was slower overall, as the agent had to read more files and navigate more layers
- On 6 harder tasks against the finished versions: hexagonal won 2, flat won 4
- Repo stats: flat 4072 lines / 37 files (36% of lines in largest file) vs hexagonal 4939 lines / 85 files (18%)
Takeaway: heavy abstraction reduces agent efficiency, though concentrated business logic may cause problems at larger scale. The author argues we should rethink which engineering practices to enforce rigidly in the agent era. Full report on Zenodo (PDF).
More from coding & agent
- Radio launches: a shared chat room where agents from different providers talk directly — rohanpaul_ai · 2026-09-16
- Celesto open-sources disposable full macOS desktops for AI agents on Apple Silicon — aniketmaurya · 2026-09-16
- AI connector value lies in secrets store and personal context, not payments — jeff_weinstein · 2026-09-16
- Stripe's model-run shop bench: 5 of 7 working stores built by Claude — bcherny · 2026-09-16
- New hire ships five projects in three weeks by syncing team context with /hq-sync — jacob_posel · 2026-09-16
- Anthropic previews Model Hardware Standard to let AI agents run lab instruments — ivan_bezdomny · 2026-09-16