Skip to main content
المدونة

Zalt Blog

Deep Dives into Code & Architecture

AT SCALE

How to Vibe Code With Cursor: A Practical Walkthrough

By محمود الزلط
Insights
9m read
<

New to Cursor? Here is the exact vibe coding loop I use: install, add a rules file, open Agent mode, prompt clearly, run it, and feed errors back until it works. Plus when to reach for it over a raw Claude or ChatGPT chat.

/>
How to Vibe Code With Cursor: A Practical Walkthrough - Featured blog post image
Mahmoud Zalt

1:1 Mentor

Are you a software engineer moving into AI?

Let's have a call. I'll help you modernize your skills and learn the tools, systems, and architecture behind reliable AI products. One session or ongoing.

Hire AI Employees

Hire AI Employees that work 24/7. No code.

Alice, AI Personal Assistant
AI Assistant

Alice

AI Personal Assistant

Chat Now

How to Vibe Code With Cursor

To vibe code with Cursor, install Cursor from cursor.com, open your project folder, press Cmd+L (Ctrl+L on Windows/Linux) to open the chat, and switch the dropdown to Agent mode. Then describe what you want to build in plain English, let the agent write and edit the files, run the result, and when something breaks, paste the error back into the chat and ask it to fix it. Before you generate any code, add a rules file so the agent follows your stack and conventions. Vibe coding means you steer with intent and feedback while the AI handles most of the typing, but you still run, review, and revert when needed.

I am Mahmoud Zalt, an independent senior AI systems architect with 16+ years building production software since 2010. I am the founder of Sista AI, where I run a workforce of autonomous AI agents in production, so I spend my days at the exact boundary between human intent and machine execution that vibe coding lives on. Cursor is one of the tools I reach for daily, and this walkthrough is the workflow I would hand a friend who is new to it.

What vibe coding in Cursor actually means

Vibe coding is telling an AI what to build in everyday language and letting it handle the implementation. You describe a feature, the AI writes the code, you run it, and you iterate. You are not reading every line or hand-typing every function. You are guiding, testing, and correcting.

Cursor is a code editor built for exactly this. It is a fork of VS Code, so if you have ever used VS Code your extensions, themes, and shortcuts carry straight over. What makes it different is that the AI is wired into the editor itself. It can read your whole project, write to multiple files, create folders, run commands, and see the errors your code throws, all without you copying anything in and out of a chat window in a browser. That end-to-end loop is why Cursor beats pasting snippets into a separate ChatGPT or Claude tab: the tool that writes the code is the same tool that sees it fail.

Step 1: Install Cursor and open a project

Download Cursor from cursor.com. It runs on macOS, Windows, and Linux. On first launch it offers to import your VS Code settings and extensions, so say yes if you have them.

Then open a folder. If you are starting fresh, make an empty folder and open it. If you already have a project, open its root. Cursor works best when it can see the whole project, because context is what lets the agent make sensible changes.

Learn these three shortcuts and you know most of what you need:

  • Cmd+L / Ctrl+L opens the chat panel on the right. This is where you talk to the agent.
  • Cmd+K / Ctrl+K is inline edit. Select a block of code, press it, describe the change, and only that block gets rewritten.
  • Tab accepts the autocomplete suggestion. Cursor predicts your next edit as you type, which is faster than hand-typing boilerplate.

Step 2: Write a rules file before you generate anything

This is the step beginners skip, and it is the one that saves you the most pain. Before you let Cursor write a single line, tell it how you want it to work. Cursor reads project rules from a file so it applies them to every request automatically. In current Cursor that lives under a .cursor/rules folder, though the older single .cursorrules file at the project root still works.

Keep it short, 30 to 50 lines, and cover:

  • Your tech stack and the versions you want (for example, React with TypeScript, Tailwind, no other CSS framework).
  • Conventions: file structure, naming, how you like functions organized.
  • What to avoid: libraries you do not want, patterns you dislike.
  • How to communicate: for example, explain changes briefly, ask before large refactors.

This one file stops you from correcting the same mistakes over and over. Without it, you will fight the agent every session about which router or which state library it should use. A good starting point is a community rules file from cursor.directory adapted to your project. My free handbook has a full chapter on setting these up well: The Vibecoder's Handbook walks through the Set Up phase step by step.

Step 3: Understand the modes and pick Agent

Cursor's chat has a mode dropdown at the top. Picking the right one is half the skill. Here is the quick map.

ModeWhat it doesUse it when
AgentReads context, writes and edits multiple files, runs commands, fixes its own errors across a task.Building features, scaffolding, most vibe coding.
AskAnswers questions and explains code without changing anything.Learning an unfamiliar codebase or library before you build.
Inline edit (Cmd+K)Rewrites a selected block only.Focused changes like adding error handling to one function.
TabPredictive autocomplete as you type.Boilerplate and repetitive edits.

For vibe coding, Agent is your home base. Select it, then in the same area you can also pick the model. A strong general model like Claude Sonnet handles the large majority of tasks; reach for a heavier reasoning model only for complex, multi-file architecture or big refactors. Do not overthink the model choice at first: the default is fine, and switching costs you nothing.

Step 4: Prompt well so the agent gives you what you meant

Vague prompts produce vague results. The fix is not to write longer prompts, it is to specify four things: what you want, where in the codebase it goes, how it should work, and any constraints. Compare these two.

Weak: "add login."

Strong: "Add email and password login. Put the form in a new component at src/components/LoginForm.tsx, validate that the email is well formed and the password is at least 8 characters, show inline errors under each field, and on submit call the existing /api/auth/login endpoint. Do not add any new dependencies."

A few habits that pay off:

  • Reverse-prompt for discovery. If you are not sure of the requirements, tell the agent to ask you clarifying questions first. It surfaces things you would have forgotten.
  • Reference files and docs. Use the @ symbol to point the agent at specific files, or add documentation URLs so it works from the real API, not its memory.
  • Narrow the blast radius. Ask for changes to specific files rather than turning it loose on the whole project. Smaller, reviewable steps beat one giant generation.
  • Prefer working over elegant. Start with the simplest thing that runs, then improve. An elegant idea that fails costs more than a plain one that works.

Step 5: Run, review, and iterate on errors

Here is the actual loop, the thing that makes vibe coding feel like magic when it clicks.

  • Run it. Start your dev server or run the file. Cursor has an integrated terminal, and in Agent mode it can run commands for you.
  • Feed back errors. When something breaks, copy the error or the console output and paste it into the chat. Often the agent will ask for logs itself and diagnose the root cause. This error-driven loop is where Cursor shines, especially on UI and integration work.
  • Review, do not rubber-stamp. Read the diffs. Accept most of what the agent writes and adjust the rest. Skipping review is how security holes and quiet bugs pile up.
  • Revert instead of forcing fixes. When the agent digs a hole, do not keep prompting it deeper. Cursor keeps checkpoints, so click restore to roll back to the last working state and try a cleaner instruction. This one habit will save you hours.

The mental model: you are the pilot, the agent is the autopilot. It flies most of the route, and you take the controls at the moments that matter.

Cursor vs vibe coding with Claude or ChatGPT directly

People often ask how to vibe code with Claude or ChatGPT instead. You can, and for quick throwaway scripts a chat window is fine: describe the task, get the code, paste it into your editor, run it. The friction is that you are the messenger, ferrying code and errors back and forth by hand, and the model cannot see your project or your failures.

Cursor closes that loop. The same models (Claude and GPT among them) are available inside Cursor, but now they can read your whole repo, write across many files, run your code, and read the stack trace when it breaks. In practice a CSS or integration bug that a browser chat struggles with often gets fixed by Cursor in one pass, because Cursor can actually see what happened. Use a raw chat for one-off snippets and explanations. Use Cursor when you are building and iterating on a real project.

Honest caveats before you ship anything

Vibe coding is genuinely powerful, and it is also easy to get burned if you treat it as autonomous. Two things to keep in front of you.

Maintainability. If you cannot read the code, you cannot fix it when the agent gets stuck, and you will not understand your own backend when it matters. That is fine for a prototype and dangerous for something people depend on. The way out is to learn enough to read what the agent writes, which is exactly what a good handbook is for.

Security. Do not let the agent independently own authentication, authorization, payments, encryption, or production data migrations. Review anything that touches user data or money, and never deploy a vibe-coded app without a security pass. If you are building something real and want a second set of eyes on the architecture, that is the kind of thing my AI consulting practice exists for.

Frequently Asked Questions

Is Cursor free to use for vibe coding?

Cursor has a free tier that includes a limited number of AI requests and slower model access, which is enough to learn the workflow. Heavier use, faster models, and Agent mode at volume are on the paid Pro plan. Start free, and upgrade only once you are coding daily.

Do I need to know how to code to vibe code with Cursor?

No, you can start with zero coding knowledge and build working things. But you get much better results and far fewer dead ends if you can read code well enough to spot when the agent goes wrong. Treat vibe coding as a way to learn faster, not as a way to avoid learning entirely.

What is the difference between Agent mode and Ask mode in Cursor?

Agent mode changes your code: it writes and edits files, runs commands, and fixes errors across a task. Ask mode only answers questions and explains code without touching anything. Use Agent to build and Ask to understand.

How do I vibe code with Claude or ChatGPT instead of Cursor?

Open the chat, describe what you want in plain English, copy the generated code into your editor, run it, and paste any errors back for a fix. It works for small scripts, but the model cannot see your project or run your code, so for anything beyond a snippet a tool like Cursor that has your files and your errors is faster.

Why does Cursor keep breaking my working code?

Usually the prompt was too broad or the agent lacked context. Narrow each request to specific files, add a rules file so it respects your stack, and when it goes off the rails restore the last checkpoint instead of prompting it deeper. Small reviewed steps break far less than one giant generation.

Can I use vibe coding for a real production app?

Yes, but with discipline. Review every diff, keep humans in control of security-sensitive code like auth and payments, add tests, and make sure at least one person understands the codebase. Vibe coding accelerates the build; it does not remove the need for engineering judgment.

Start building, then level up

The whole loop fits in one breath: install Cursor, add a rules file, open Agent mode, describe what you want, run it, and feed errors back until it works. You can be building something real within an hour of reading this. The skill is not in memorizing shortcuts, it is in prompting clearly, reviewing honestly, and knowing when to revert.

If you want the full path from your first prompt to a shipped, maintainable app, I wrote it all down. The Plan, Set Up, and Build phases are free, and they go deep on the rules files, prompting patterns, and review habits I only touched on here. Read the free handbook ->

Thanks for reading! I hope this was useful. If you have questions or thoughts, feel free to reach out.

Content Creation Process: This article was generated via a semi-automated workflow using AI tools. I prepared the strategic framework, including specific prompts and data sources. From there, the automation system conducted the research, analysis, and writing. The content passed through automated verification steps before being finalized and published without manual intervention.

Mahmoud Zalt

About the Author

I’m Zalt, a technologist with 16+ years of experience, passionate about designing and building AI systems that move us closer to a world where machines handle everything and humans reclaim wonder.

Let's connect if you're working on interesting AI projects, looking for technical advice or want to discuss anything.

Support this content

Share this article