[KongchangAI]
Product Reviews· 3 min read· 1,808 words

Claude Code vs Cursor Real-World Comparison: Which Wins on an Elevator Simulator Project?

Claude Code vs Cursor Real-World Comparison: Which Wins on an Elevator Simulator Project?

Real-world comparison of Claude Code vs Cursor through an elevator scheduling simulator project.

This article uses an elevator algorithm scheduling simulator to compare Claude Code and Cursor under identical tech stack and prompt conditions. Results show Claude Code excels in task planning, architecture understanding, code style consistency, and hallucination control, making it ideal for iterative development on existing projects. Cursor shines with its IDE multi-window experience and visual polish but tends to deviate from existing architecture with more hallucinations, better suited for rapid prototyping. Each tool has its strengths and should be chosen based on context.

When programmers ride elevators, a thought inevitably pops into their heads: "What if I designed this elevator scheduling algorithm?" This fun idea turned out to be the perfect subject for a head-to-head comparison of AI coding tools.

Elevator scheduling algorithms are classic teaching cases in operating systems courses, highly isomorphic with disk scheduling algorithms. Common scheduling strategies include: FCFS (First Come First Served), SSTF (Shortest Seek Time First), SCAN (also known as the elevator algorithm), and LOOK (improved SCAN). The SCAN algorithm makes the elevator sweep back and forth between the top and bottom floors like a scanner, responding to all requests along the way — it's the most commonly adopted basic strategy in real-world systems. Modern commercial elevator systems build upon this with advanced strategies like Destination Control Systems (DCS), traffic flow prediction, and group coordination, making this seemingly simple problem rich in algorithm design space — which is precisely what makes it compelling as a programming challenge.

This article uses an "Elevator Algorithm Scheduling Simulator" project to compare the real-world development experience of Claude Code and Cursor under identical conditions — from task comprehension and code generation to architecture control and final delivery quality, revealing the true differences between these two tools.

Experiment Setup: A Foundation for Fair Comparison

To ensure a fair comparison, the experiment employed strict variable control:

  • Project Template: Initialized a complete project with Prisma, Next.js, and tRPC, duplicated into two copies for each tool
  • Prompts: Used exactly the same system prompt
  • Preparation: Both tools pre-read the project structure and auto-generated basic rules

It's worth elaborating on the chosen tech stack. Prisma is a type-safe ORM (Object-Relational Mapping) tool that defines data models through declarative Schema files, automatically generating type-safe database query clients with support for PostgreSQL, MySQL, SQLite, and more. Next.js is a full-stack framework built on React, providing Server-Side Rendering (SSR), Static Site Generation (SSG), API routes, and other capabilities. tRPC is an end-to-end type-safe RPC framework that allows the frontend to directly call backend functions with full type inference, eliminating the need to manually write API schemas or generate code. Together, these three form what's known as the T3 Stack, whose core advantage lies in full-chain type safety from database to frontend — any data structure change gets caught at compile time. This tightly coupled tech stack places high demands on AI coding tools' ability to understand architecture.

The goal was clear: develop an elevator algorithm scheduling simulator. Users can configure elevator parameters, select scheduling algorithms, and then visually observe the algorithm's execution.

Task Decomposition: The First Divergence in Approach

Upon receiving the instructions, the two tools' initial reactions were immediately different.

Claude Code's first step was to break the task into a Todo List, demonstrating clear engineering thinking. As visible in the screenshot, its decomposition was quite reasonable, covering key stages like database design, API development, and frontend interface.

Claude Code's task decomposition

Cursor, on the other hand, was more "obedient," strictly following the prompt's requirements by first writing project documentation. This difference reflects the two tools' different orientations toward "autonomous planning capability" — Claude Code tends to plan before executing, while Cursor is more faithful to the literal meaning of user instructions.

Behind this difference are fundamentally different product forms. Claude Code is a command-line tool (CLI) from Anthropic that runs in a terminal environment, driving code generation and file operations through natural language dialogue. It works in Agent mode, capable of autonomously planning tasks, reading/writing files, and executing commands. Its advantages lie in being lightweight, scriptable, and naturally integrating with CI/CD pipelines, but it's limited by the terminal environment, lacking the intuitive feedback of a graphical interface. Cursor is a deeply customized AI-native IDE based on VS Code, embedding large language model capabilities into every aspect of the editor — code completion, inline editing, multi-file refactoring, terminal operations, and more. Its Cursor Rules mechanism allows developers to pass contextual constraints to the AI through project-level configuration files. The difference between them isn't just about interface form — it reflects a fundamental divergence between two paradigms: "AI as an independent Agent" versus "AI as an IDE enhancement layer."

Since it skipped the documentation step, Claude Code entered the coding phase earlier. However, Cursor caught up quickly after finishing documentation, and the coding speed gap between them wasn't significant.

Architecture Understanding: The Critical Differentiator

What truly widened the gap was the depth of understanding of the project architecture.

Cursor's "Detour": Despite having generated Cursor Rules, Cursor still created two new directories (frontend and backend) in the project, attempting to build an entirely new project structure. This completely deviated from the intent of developing on top of the existing project, requiring manual intervention to stop and correct it: "You should modify within the original tech stack."

Claude Code's "Alignment": In contrast, Claude Code correctly began working on the existing project structure without trying to start from scratch. This indicates a more thorough understanding of the existing codebase.

Claude Code starting database sync

However, Claude Code wasn't perfect either. When starting the database, it used PostgreSQL's default port 5432, which was already occupied by the local database. This showed it hadn't fully understood the project's SQLite configuration needs, still requiring human intervention to fix.

Development Process: Action-Oriented vs Multi-Faceted

During ongoing development, the two tools displayed distinctly different personalities.

Claude Code: The Concise Action-Taker

Claude Code's style is very direct — minimal chatter, it says what it needs to say and starts coding. It proactively handles code formatting checks, testing, and other responsibilities, demonstrating strong engineering self-awareness.

Claude Code's coding style

But it has one obvious weakness: as a terminal tool, it cannot maintain long-lived web service connections. After starting the development server, the connection automatically disconnects due to the short default timeout, requiring manual termination and restart.

Cursor: The Natural Advantage of IDE Ecosystem

As an IDE, Cursor has a natural advantage in multitasking. It can start the development server in one window while continuing to code in another, without interference. This experience is very practical in daily development.

Cursor also created an additional introduction page with quite polished styling. But this actually exposed a problem — it "hallucinated" features that weren't originally designed.

Cursor's introduction page

This "hallucination" phenomenon has a dedicated term in the AI field: Hallucination. In AI coding scenarios, hallucinations primarily manifest as: generating non-existent API calls, fabricating fake library functions, adding features the user didn't request, or making incorrect assumptions about project structure. This is essentially the same as hallucination in natural language generation — the model generates content that appears plausible based on probability distributions but is actually incorrect. In programming, hallucinations are particularly harmful because code either works or it doesn't — there's no "approximately correct" middle ground. Common strategies to reduce hallucinations include: providing more comprehensive context (such as project rule files), using Retrieval-Augmented Generation (RAG) techniques, and introducing code validation and test feedback loops at the tool level.

Final Delivery: Comparing Quality and Style

Both tools ultimately delivered a runnable elevator scheduling simulator, but the details differed significantly.

Claude Code's Deliverable:

  • Functionality largely met expectations
  • Styling highly consistent with the original project style (it didn't even change the background)
  • One requirement misunderstanding: added a login feature (the prompt explicitly stated no login), fixed after correction
  • Right-side configuration panel too long, without scroll handling

Cursor's Deliverable:

  • More visually appealing interface, with an additional introduction page
  • Test code could run (though initially scored zero)
  • More "hallucinations" — added unrequested features
  • Lower adherence to the original code style

Deep Analysis: The Core Logic Behind the Choice

Through this real-world comparison, we can summarize the core differences between the two AI coding tools:

DimensionClaude CodeCursor
Task PlanningAutonomously creates Todo ListsStrictly follows instructions
Architecture UnderstandingAligns with existing codebaseTends to rebuild from scratch
Code StyleHigh consistency with projectPrioritizes visual appeal
Hallucination LevelLowerHigher
Development ExperienceTerminal-based, limited long connectionsIDE multi-window, smooth experience
Trust LevelGradually builds, allows less reviewRequires review of every change

There's a noteworthy point here — the accumulation of trust. After repeatedly verifying that features developed by Claude Code had no issues, developers gradually reduced code review, adopting a "just check the results" approach. With Cursor, due to more frequent hallucinations, every change needed careful review.

This difference in trust significantly impacts development efficiency in long-term projects. If you can trust the tool's output, you can devote more energy to product design and architectural decisions; otherwise, frequent code reviews consume substantial time. This concept touches on a deeper question in AI-assisted programming: how should the granularity of human-machine collaboration supervision be dynamically adjusted? This parallels the tiered system in autonomous driving (L1-L5). In the early stages of AI programming, developers need to review generated code line by line (similar to L1 assisted driving); as the tool's reliability is verified, they can gradually transition to only reviewing key changes (L2-L3); ideally, developers only need to focus on final results and high-level decisions (L4). However, this trust is fragile — a single serious hallucination or architectural error can break established trust. Therefore, even in high-trust phases, maintaining human review at critical checkpoints remains a necessary safety net. This also explains why Claude Code's lower hallucination rate leads to higher long-term development efficiency: it allows developers to enter a high-trust collaboration mode more quickly.

Conclusion: Context Determines the Choice

For iterative development on existing projects, Claude Code is the better choice. It understands existing code more deeply, produces output more consistent with project style, hallucinations are fewer, and long-term use builds a stable trust relationship.

For rapid prototyping and new project scaffolding, Cursor's IDE experience and visual polish may be more appealing, but requires more effort for code review and course correction.

Ultimately, choosing tools isn't an either/or question. Understanding each tool's characteristics and limitations, and using the right tool in the right context — that's the proper approach to AI-assisted programming.

Key Takeaways

  • Claude Code autonomously decomposes tasks, understands existing project architecture more deeply, and produces code highly consistent with the original project style
  • Cursor as an IDE has natural advantages in multi-window and long connection development experience, but tends to deviate from existing project structure
  • Claude Code has fewer hallucinations, allowing gradual reduction of code review over time; Cursor has more hallucinations, requiring careful review of every change
  • Both tools exhibit requirement misunderstanding issues — human supervision and timely correction remain indispensable
  • For iterative development on existing projects, Claude Code is recommended; for rapid prototyping, Cursor is worth considering
#Claude Code#Cursor#AI coding tools comparison#elevator algorithm#AI programming#LLM hallucination#AI-assisted development
Share:

Related articles