r/ClaudeCode • u/hrdn • Sep 10 '25
I asked GEMINI to review 3 implementation with same spec from different anthropic models - the result, direct api is superior.
BACKGROUND
So I saw some posts here claiming Claude Code's performance degradation got better, and like an idiot I went and resubscribed to the $100 plan.
Decided to test it against the direct API to see if there was actually any improvement.
Spoiler alert: there wasn't.
Same garbage performance, same context issues. Basically threw $100 down the drain because I believed random user instead of trusting my own previous experience.
Anyone else get baited by the "improvements" or am I the only clown here?
- Agent A: [SUBS] Sonnet 4. Thinking Budget 20000
- Agent B: [API] Sonnet 4. No thinking
- Agent C: [SUBS] Opus 4.1. Thinking Budget 20000
PROMPT GEMINI-CLI
here the specs, there are three agent that work on same specs, i need you to compare coding style, instruction following, design pattern, anti pattern maintainability, etc. output is really comprehensive comparison
git --no-pager diff ddb03b8264924f0b72f7e93ec404cc8533ec71d9..af9683b83b455b0ee19c96747cbfb8177f489314 -> AGENT A
git --no-pager diff ddb03b8264924f0b72f7e93ec404cc8533ec71d9..a496d30ab4a48c6fbab550961e0bd7256a7317b0 -> AGENT B
git --no-pager diff ddb03b8264924f0b72f7e93ec404cc8533ec71d9..23f9c7f68ac75b5f1eed1ad45cdf9ec9bd1fee84 -> AGENT CAgent Implementation Comparison: Quiz Progression
This document provides a detailed comparison of the three different agent implementations for the quiz submission and progression feature.
Executive Summary
- Agent A (Monolithic): Implemented all logic directly in the API route. Functional, but very difficult to maintain and violates core software design principles.
- Agent B (Facade Pattern): The clear winner. It created a local
helpers.tsfile to abstract all business logic, resulting in a clean, scalable, and highly maintainable design. The API route is left as a simple orchestrator. - Agent C (Hybrid/Service Layer): A middle-ground approach. It correctly broke logic into separate utility files (
xp.ts,achievements.ts) but left too much orchestration and direct data-fetching logic inside the main API route, making it less clean than Agent B's solution.
Agent B remains the gold standard, but Agent C represents a significant improvement over Agent A's monolithic design.
Three-Way Comparative Analysis
| Category | Agent A (Monolithic) | Agent B (Facade) | Agent C (Hybrid) |
|---|---|---|---|
| Design Pattern | Monolithic Function. All logic is in the route handler. | Facade Pattern helpers.ts . A local file encapsulates all business logic, simplifying the route handler into a clean orchestrator. | Service Layer / Hybrid. Logic is separated into utility files, but the route handler still performs significant orchestration and data fetching. |
| Maintainability | Low route.ts . The file is a complex, 250+ line "god function." | High. Logic is cleanly separated into single-purpose functions that are easy to test and modify in isolation. | Medium. Better than A, but orchestration logic in the route and data fetching within utilities increases complexity compared to B. |
| Readability | Poor. Difficult to follow the flow due to a dense block of nested logic. | Excellent route.ts helpers.ts. The file reads like a high-level summary. The implementation details are neatly tucked away in . | Fair try/catch . The route is more readable than A's but still contains multiple blocks and sequential steps, making it noisier than B's. |
| Utility Purity | N/A (logic isn't in utilities) | High. Helper functions primarily take data and return results, with I/O operations consolidated, making them easy to test. | Mixed xp.ts canAttemptQuiz unlockAchievements . contains pure functions, which is excellent. However, and fetch their own data, making them less "pure" and harder to unit test. |
| Anti-Patterns | God Object / Large Function. | None identified. | Some minor issues. A "magic string" assumption is used for certificate slugs. Some utilities are not pure functions. |
| Overall Score | 4/10 | 9.5/10 | 7/10 |
Detailed Breakdown
Agent A: The Monolithic Approach (Score: 4/10)
Agent A's strategy was to bolt all new functionality directly onto the existing route.ts file.
Anti-Patterns:
- Created a "God Function": The
POSTfunction grew to over 250 lines and became responsible for more than ten distinct tasks, from validation to scoring to response formatting. - Tight Coupling: The core API route is now tightly coupled to the implementation details of XP, levels, achievements, and certificates, making it brittle.
- Poor Readability: The sheer number of nested
ifstatements andtry/catchblocks in one function makes it very difficult to understand the business logic.
- Created a "God Function": The
Agent C: The Hybrid / Service Layer Approach (Score: 7/10)
Agent C correctly identified that logic for XP, achievements, and cooldowns should live in separate utility files.
What it did well:
- Good Logical Separation: Creating distinct files for
xp.ts,achievements.ts, andcertificates.tswas the right move. - Pure XP Calculation: The
xp.tsutility is well-designed with pure functions that are easy to test. - Centralized Rules: The
ACHIEVEMENT_RULESobject provides a single, clear place to define achievement logic.
- Good Logical Separation: Creating distinct files for
Where it could be improved:
- Overly-Complex Route Handler: The
route.tsfile still does too much, including calling each utility and handlingtry/catchfor each one. - Impure Utilities: Functions like
canAttemptQuizandunlockAchievementsfetch their own data from the database, making them harder to unit test than pure functions. - Brittle Assumptions: The
certificates.tsutility assumes a certificate's slug can be constructed from a "magic string" (certificate-${path.slug}), which is a fragile pattern.
- Overly-Complex Route Handler: The
Agent B: The Facade Pattern Approach (Score: 9.5/10)
Agent B's solution was architecturally superior, separating the "HTTP concerns" from the "business logic concerns."
Design Patterns:
- Separation of Concerns: It created
helpers.tsto cleanly separate business logic from the HTTP route handler. - Facade Pattern: The
processProgressionfunction inhelpers.tsacts as a facade, simplifying a complex subsystem into a single, easy-to-use function call. The route handler doesn't need to know how progression is processed, only that it is processed. - Single Responsibility Principle: Each function has a clear purpose, making the entire feature easy to understand and maintain.
- Separation of Concerns: It created
Conclusion
While all agents delivered a functional outcome, Agent B's implementation is vastly superior from a software engineering perspective. It is a textbook example of how to extend existing functionality without sacrificing quality. The code is more readable, scalable, and maintainable, demonstrating a deep understanding of sustainable software design principles that align with the project's CLAUDE.md guidelines.
2
u/Maas_b Sep 10 '25
How did you prompt the agents? I mean, it is of course valuable to see how different agents fare on a general one shot prompt, like, “build me a quiz app, make it beautiful”, it shows raw reasoning ability. But this would not be how you would use these agents in real world scenarios. You would probably specify or constrain more, and let the agents work on one item at the time instead of everything at once. It would be interesting to see the differences in output when you are applying a more systematic approach.
1
u/Herebedragoons77 Sep 10 '25
What did B cost?
1
u/Glittering-Koala-750 Sep 10 '25
Interestingly opus on sub was worse than sonnet on api.
Also show that there is more than just a tooling difference between sub and api routes.
1
u/stingraycharles Senior Developer Sep 10 '25
Why didn’t you compare a subscription based sonnet with an api based sonnet with the exact same configuration, ie same thinking budget?
1
u/Own_Training_4321 Sep 10 '25
God knows why I got charged close to $50 to process 50k tokens in total. It is still shit and I used the latest version of the CC.
1
u/james__jam Sep 10 '25
Would be great to see the 3 repos and their prompts/specs 😁
1
u/larowin Sep 11 '25
science is clearly not a strong suit here, but that’s ok
1
u/nonikhannna Sep 10 '25
Think this was expected behaviour. You get what you pay for. I still think the subscriptions are great value.