Lesson 6. Agent mode — AI works independently, you control
Agent mode is the highest level of vibe coding. You simply say 'what needs to be done', and the AI creates files, writes code, runs terminal commands, and finds and fixes errors. In this lesson, you will learn to tackle large tasks using Agent.
Topic breakdown
Agent mode (Cmd+I or Composer) is Cursor's most powerful mode. In standard Chat, the AI gives suggestions and you click Apply. In Agent mode, the AI acts independently: it opens files, creates new ones, makes changes, and even executes commands like 'npm install' in the terminal.
To launch Agent mode, press Cmd+I (Mac) or Ctrl+I (Windows) and describe your task. For example: 'Create a React project with a login page, dashboard, and settings. Add routing and a base layout for each page.' The AI will do this automatically.
Important: in Agent mode, the AI shows every step — which file it creates, what it modifies, what command it runs. At every step, you can click 'Accept' or 'Reject'. It is not completely autonomous — you remain in control.
Agent mode works best: when starting a new project, when you need to create multiple files, during code refactoring, and when fixing bugs. For simple one-line changes, Tab or Inline Edit is enough.
What you'll learn
- Launching and managing Agent mode
- Properly assigning large tasks to Agent (effective prompting)
- Controlling every step of Agent (Accept/Reject)
- Course-correcting when Agent makes a mistake
- Distinguishing tasks suitable and unsuitable for Agent
- Authorizing terminal commands and file creation
Deep dive
Technical workflow of Agent mode: when you describe a task, Cursor sends the full project context (file tree, contents of key files) and your request to the AI model. The model makes a plan (which files to create/edit, which commands to run) and executes it step-by-step. Between steps, the model sees the result of its previous actions.
Practical difference between Agent mode and Chat mode: in Chat you write 5 separate messages and click Apply 5 times. In Agent, you write 1 detailed task, and the AI executes all 5 steps itself. The result is the same, but Agent saves 5 times the effort. However, if Agent makes a mistake, it's harder to fix because it alters multiple files simultaneously.
Best practices for Agent mode: 1) Describe project structure before the task. 2) Specify the tech stack clearly. 3) Always test the result (open in browser, run in terminal). 4) If it fails 3+ times — split the task into pieces. 5) Write project rules in the .cursorrules file — Agent will obey them without question.
Agent mode is especially useful in vibe coding: you can build a startup MVP in an evening. For instance, a landing page + Telegram bot + admin panel — with Agent mode, this is 2-3 hours of work. Vibe coding democratizes development — making technology accessible to everyone.
Ready prompt template
Copy and adaptCreate a new Next.js project. Project should include: 1) App Router with 3 pages (home, about, contact), 2) Shared Header and Footer on every page, 3) A working form (name, email, message) on the Contact page, 4) Beautiful design with Tailwind CSS, 5) TypeScript. Install all necessary packages.
Why it works
Framework: 'Next.js' + 'App Router' + 'TypeScript' — clear tech stack
Structure: '3 pages' + 'Header/Footer' — project architecture is defined
Functionality: 'working form' — entails logic, not just UI
Style: 'Tailwind CSS' — design system indicated
Setup: 'Install all necessary packages' — Agent will run npm/yarn commands
Practice
- Open an empty folder in Cursor
- Press Cmd+I to open Agent mode (or select Agent in Chat)
- Type: 'Create a simple portfolio: home, projects, and contact pages. HTML + CSS + JavaScript'
- Watch as Agent creates the files — review each one
- When Agent asks to run terminal commands — click 'Run'
- Open the result in a browser and test its functionality
- If you don't like something, type: 'Change the Header color from blue to green'
Common mistakes
- Giving Agent too vague a task — not 'make a website', but exact structure and functionality
- Blindly clicking Accept — review every file, click Reject on mistakes
- Starting over completely when Agent fails — it's better to explain the error and continue
- Asking for too large a project at once — do it in stages: structure first, then pages, then styling
- Not checking terminal commands — Agent rarely, but sometimes, might suggest dangerous commands
Lesson FAQ
Does Agent mode work on the free plan?
Yes, but with limits. On the free plan, you have 50 premium requests — Agent uses 1-5 requests per task. This is enough for 2-3 small tasks a day.
Can Agent delete my files?
Agent shows every change and asks for permission. If you don't click Accept, nothing changes. As a precaution, using Git is recommended — you can always roll back.
How long does Agent take to complete a task?
Simple tasks (1-3 files) take about 30 seconds; complex ones (10+ files) take 2-5 minutes. It depends on your internet speed and model load.