PlainErrors: Streamlined Rails Error Pages for LLM Agents (www.panozzaj.com)

🤖 AI Summary
A new Ruby gem called PlainErrors was released as a Rack middleware for Rails that produces compact error pages tailored for LLM-driven agents. It was built to address a practical problem: when agents (the author used Claude Code with Playwright MCP) hit backend errors, verbose Rails development pages and the BetterErrors UI blow up token usage and waste the model’s context window. Measured with OpenAI’s tiktoken, PlainErrors reduced output dramatically in a real Rails app: 755 bytes / 217 tokens vs Rails default 8,854 bytes / 2,975 tokens (≈13.7× more) and BetterErrors 113,544 bytes / 25,055 tokens (≈115.5× more). Technically, PlainErrors is simple middleware that emits streamlined, machine-friendly error reports and supports lightweight configuration (headers or query params) so an agent can request the compact view. That means faster, cheaper, and more iterative debugging cycles for LLM agents interacting with local apps: fewer tokens used, more context preserved, and easier automated parsing. The author notes minimal handmade code — much of the development was guided and tested via the LLM — and invites feedback on usage, missing features, or integration quirks.
Loading comments...
loading comments...