The bloat is mostly error handling for a fundamentally unpredictable system. A simple agent loop is 200 lines. But then you need graceful recovery when the model hallucinates a tool call, context window management, permission boundaries so it doesn't rm -rf your repo, state persistence across crashes, rate limiting, and cost tracking. Each one is simple individually. Together they're 500k lines.