GPT-5 vs Claude 4 Coding Test: In-Depth Full-Stack Project Comparison Results

Real-world full-stack coding comparison between GPT-5 and Claude 4 Sonnet reveals Claude still leads.
A full-stack developer tested GPT-5 and Claude 4 Sonnet on a real NestJS + Prisma ORM project using both Cursor and Claude Code. Results show Claude leads in architecture generation, backend API quality, multi-file collaboration, and design reproduction. GPT-5 produces decent UI styling with explicit prompts but falls short on functional completeness and complex logic. Claude remains the dominant model for AI-assisted programming.
After GPT-5's release, various benchmark scores showed it surpassing Claude and nearly all other models across the board. But benchmarks are benchmarks — how does it actually perform in real-world programming? A full-stack developer spent two days conducting a multi-dimensional deep evaluation of GPT-5 and Claude 4 Sonnet during actual project development, and the conclusions might not be what you'd expect.
Testing Background & Methodology
This evaluation didn't use simple coding demos. Instead, it was based on a real full-stack greenfield project (NestJS + Prisma ORM), covering frontend interfaces, backend logic, and overall architecture. The testing tools chosen were Cursor and Claude Code — two of the most representative AI coding products available.
On the choice of tech stack: NestJS is a progressive Node.js backend framework written in TypeScript that draws inspiration from Angular's modular architecture philosophy. It comes with built-in enterprise-grade features like dependency injection, decorator patterns, and aspect-oriented programming, making it one of the most popular Node.js frameworks for full-stack development today. Prisma ORM is a next-generation database toolchain that provides a type-safe database access layer, automatically generating TypeScript type definitions from Schema files, greatly reducing the risk of type errors in database operations. This combination represents the mainstream technology choice for current full-stack JavaScript/TypeScript development and represents the most common real-world business scenarios that AI coding assistants are asked to handle, making it a highly representative foundation for evaluation.
The reason for choosing Claude 4 Sonnet rather than Claude 4.1 Opus as the comparison target is that most developers won't use Opus in real-world scenarios — it's too expensive. Claude 4 Sonnet is the most commonly used model in daily development, making comparisons with GPT-5 more practically relevant.

On the choice of testing platforms: Cursor is an AI coding IDE deeply rebuilt on VS Code, with its core competitive advantage being the deep integration of codebase-level context awareness with AI conversation. Cursor has extensive built-in system prompts that regulate model behavior, inject codebase index information, and tool-calling instructions. These prompts continuously consume the model's context window, significantly compressing the token space available for business logic in long conversation scenarios. Claude Code is Anthropic's official command-line AI coding tool that directly calls the Claude API, with relatively streamlined system prompts, lower context pollution, and better representation of the model's raw programming capabilities. The architectural differences between the two can cause noticeable performance variations for the same model on different platforms — this is the core reason cross-validation was chosen for this evaluation.
It's worth noting that the Claude model's context in Claude Code is relatively clean, while Cursor has extensive built-in prompts that can affect Claude's performance in certain scenarios. Therefore, the tester cross-validated across both platforms to ensure reliability of conclusions.
Claude's Dominance in AI Coding
Before GPT-5's release, Claude was the "uncrowned king" of coding among large language models. There's a widely shared consensus in the industry: Without Claude, all AI coding products are meaningless.
This isn't an exaggeration. When Claude recently refused to provide services to Windsurf, it directly caused a massive user exodus — a clear demonstration of Claude's central role in the AI coding ecosystem. Looking at revenue data, although OpenAI's $12 billion annual revenue far exceeds Anthropic's $5 billion, Anthropic actually surpasses OpenAI in API call revenue. Cursor and GitHub Copilot alone consume $1.4 billion in API calls — a figure that speaks volumes about Claude's popularity among developers.
This contrast reveals an important market structure: OpenAI's revenue largely comes from ChatGPT's consumer-tier subscriptions, while Anthropic's revenue is highly concentrated in enterprise and developer API calls. This "weak on consumer, strong on developer" dynamic also explains why OpenAI dedicated nearly half of the GPT-5 launch event to coding capabilities — this is the strategic high ground where they most need to reclaim market share.
OpenAI clearly recognized this as well — of the hour-plus GPT-5 launch event, approximately half the time was spent introducing coding-related content.
Multi-Dimensional Coding Test Comparison Results
Project Architecture Generation
The tester wrote the project description and tech stack into prompts, asking both models to generate the project's foundational framework and optimize the architecture.
Claude 4 Sonnet performed impressively: not only did it generate code using the specified tech stack, it proactively added features like light/dark mode, multi-language switching, complete with examples and documentation. Although there was one configuration error on first launch, it was fixed in a single iteration. After generation, it proactively asked about deployment plans and reminded about Prisma client considerations when running on edge environments.
GPT-5 also completed the task with decent architecture planning capabilities, but with insufficient completeness. It threw errors on startup due to missing content, requiring multiple rounds of fixes before running successfully, and offered no additional suggestions.
Page UI Generation Quality
Without style-constraining prompts, Claude generated pages with high functional completeness but suffered from heavy stylistic formatting — "without constraining theme colors, there's a high probability it'll pick two from orange, blue, and purple." GPT-5 generated pages without gradients, with more unified styling, but with overly simplistic functionality.
Interestingly, when given explicit style and design prompts, GPT-5's style generation was actually quite good — even better-looking than Claude's. However, the functional logic still fell far behind Claude. When given reference page designs for the model to learn from and reproduce, Claude's learning ability was clearly superior, generating pages that closely matched the reference.
Backend API Generation Quality

Claude 4 Sonnet's generated CRUD endpoints had virtually no issues. Minor problems with complex endpoints were typically resolved within two to three iterations, and it would automatically handle the frontend-to-backend integration. GPT-5's simple endpoints were acceptable, but anything slightly complex produced various issues requiring repeated fixes, and it wouldn't proactively handle page-to-API integration.
Multi-File Collaboration & Context Handling
For single-file tasks, GPT-5 and Claude 4 Sonnet were on par. But once business logic spanned multiple files, Claude consistently performed better. However, Claude has one notable weakness: when the context becomes too large or interactions within a single chat panel reach a certain volume, its capabilities drop off a cliff. This is especially pronounced in Cursor, since Cursor's built-in system prompts consume significant context space.
This phenomenon has technical roots: the context window refers to the maximum number of tokens a large language model can process in a single inference pass, directly determining how much code and conversation history the model can simultaneously "see." In real programming scenarios, a medium-sized project's codebase often contains dozens of files and tens of thousands of lines of code. Combined with conversation history and system prompts, it's extremely easy to hit the context limit. When context approaches saturation, the model begins to exhibit "forgetting" behavior — losing track of earlier code structures and requirements, leading to inconsistent or contradictory outputs.
Related articles
Product ReviewsThe Programmer's Desk Setup Guide: Building a Workspace That Feels Like Home
Discover how programmers build productive, comfortable workspaces. From multi-monitor setups to ergonomic design, explore the desk philosophy that drives focus and flow.
Product ReviewsQoder vs Cursor Real-World Comparison: Which $20/Month AI IDE Is Better?
Hands-on comparison of Qoder vs Cursor AI IDEs: Agent autonomy, human interaction count, and architecture decisions. Qoder needed only 2 interactions vs Cursor's 8.
Product ReviewsCursor Cloud Agent Demo: Eliminating Bottlenecks Across the Entire Software Development Lifecycle
Deep analysis of Cursor's Cloud Agent demo showing how cloud VMs, automated test artifacts, and a full-chain control plane systematically eliminate human bottlenecks across the software development lifecycle.