Tutorial
Cursor agent basics: tasks, rules and skills
Use Cursor's agent on a real task: scope it, plan first, use checkpoints, add project rules, AGENTS.md and skills, and review every change before you keep it.
Bookmark
Bookmarks are kept in your free account, so you can find this page again on any device.
Sign in to bookmarkOn this page
Cursor is a code editor built on VS Code with an AI agent in the side panel. The agent can search your codebase, edit several files, run terminal commands and check its own work. If you already use VS Code, the editor part needs no learning; this tutorial is about working well with the agent: giving it a scoped task, planning first, using checkpoints, and teaching it your project with rules, AGENTS.md and skills.
Cursor ships often and its interface moves around. Everything here was re-checked against the Cursor documentation and changelog on 25 November 2026. The concepts are stable; if a button has moved, the docs will have the current location.
1. Open the agent and look around
Open your project folder in Cursor and press Cmd+I (macOS) or Ctrl+I (Windows and Linux) to open the agent panel. Start with a question rather than a change:
How is this project organised, and how do I run the tests?
Watch what the agent does. It searches the codebase and reads files to answer; you will see each step in the panel. Check the answer against what you know. This is the cheapest way to calibrate how far to trust it on this codebase.
2. Plan before you change
For anything bigger than a one-line fix, ask for a plan first. Cursor has a Plan mode that researches the codebase and produces an implementation plan you can review and edit before any code is written. Press Shift+Tab in the chat input to rotate between modes, or use the mode picker.
The CSV export ignores the date filter on the reports page.
Plan a fix: find where the export query is built, make it respect the
same filters as the on-screen table, and add a test that would have caught this.
Read the plan. Is it changing the right files? Does it say how it will verify the fix? Edit it, or ask for changes in the chat, until it matches what you would do. Plans are saved as Markdown, by default in your home directory; “Save to workspace” puts one in the project so teammates can see it.
When the plan is right, switch to Agent mode and ask it to implement the plan.
3. Review changes and use checkpoints
As the agent edits, Cursor shows the changes as diffs in the editor. Review them file by file. You are looking for the same things you would look for in a colleague’s pull request: does it do what was asked, only that, and are the tests meaningful?
Cursor creates checkpoints automatically before significant changes. If a change goes wrong, click an earlier checkpoint in the chat timeline to preview the files at that point, then restore. Two things to know:
- Restoring a checkpoint reverts files, not the conversation.
- Checkpoints are local and separate from Git. Commit when you reach a state you want to keep.
The agent can run terminal commands, such as your tests. Read each command before you let it run, at least until you have configured which commands are safe to run automatically.
4. Teach it your project with rules
Rules are standing instructions the agent includes in its context. Cursor reads two kinds of project file:
AGENTS.md in the project root, and in subdirectories for more specific guidance. Cursor combines a nested file with its parents, and the more specific instructions win when they conflict (Cursor docs). Plain Markdown, no metadata, and the same file Codex, GitHub Copilot and, when there is no CLAUDE.md, Claude Code read. If your team uses several agents, put shared instructions here.
Project rules in .cursor/rules/, one .mdc file per rule. The frontmatter controls when a rule applies:
---
description: Conventions for React components in the web app
globs: src/components/**/*.tsx
alwaysApply: false
---
- Components are function components with named exports.
- Styling uses the Tailwind classes from our design tokens; no inline styles.
- Every new component gets a story in the same folder (`Name.stories.tsx`).
Cursor offers four behaviours, which you can choose from a dropdown when you create a rule:
| Type | When it applies |
|---|---|
| Always Apply | Every chat |
| Apply Intelligently | When the agent judges the description relevant |
| Apply to Specific Files | When a file matching globs is involved |
| Apply Manually | Only when you mention the rule |
A plain .md file in .cursor/rules/ is ignored; rules must be .mdc. Personal preferences that apply to every project, such as how you like explanations written, go in User Rules under Customize → Rules rather than in the repository. On Team and Enterprise plans, admins can also set Team Rules from the dashboard and make them enforced.
5. Add a skill for repeatable procedures
Rules are good for conventions. For multi-step procedures (“how we add a new API endpoint”, “how to cut a release”), use an Agent Skill: a folder with a SKILL.md file, and optionally scripts and reference files, that the agent loads only when the task needs it.
Cursor loads skills from .cursor/skills/ and .agents/skills/ in the project, the same folders under your home directory, and for compatibility also .claude/skills/ and .codex/skills/ (Cursor docs). The agent sees each skill’s name and description and decides when to use it. You can also invoke one by typing / in the agent chat and picking it; that applies the skill to one message. To keep a skill active for a whole session, use it as a Custom Mode with Option+Enter (macOS) or Alt+Enter (Windows).
Two optional frontmatter fields are worth knowing. disable-model-invocation: true means the skill only runs when you invoke it by name, which suits procedures with side effects such as releases. paths limits a skill to files matching glob patterns.
A minimal skill:
---
name: add-api-endpoint
description: Add a new REST endpoint to the API service, with validation, a handler, tests and an OpenAPI entry. Use when asked to create or expose a new API route.
---
# Add an API endpoint
1. Define the request and response schemas in `src/api/schemas/`.
2. Add the handler in `src/api/routes/`, using `withValidation()` from `src/api/middleware.ts`.
3. Register the route in `src/api/router.ts`.
4. Add tests next to the handler covering a valid request, a validation error and an auth failure.
5. Run `pnpm test api` and `pnpm openapi:check` and fix anything that fails.
Save it as .cursor/skills/add-api-endpoint/SKILL.md (or under .agents/skills/ to share it with other agents). Cursor also has a built-in /create-skill command that scaffolds one for you. Our skill guides cover writing good descriptions, and the Agent Skills directory has skills you can install.
6. Run several agents at once in the Agents Window
Once you trust the agent with scoped tasks, you can run more than one. The Agents Window, generally available since Cursor 3 on 2 April 2026, is Cursor’s agent-first interface: one place to start, watch and steer agents across projects, locally, in the cloud or over SSH (Cursor docs). Open it from the Command Palette (Cmd+Shift+P or Ctrl+Shift+P) with Open Agents Window.
Each agent can run in its own Git worktree, an isolated checkout, so two agents working on different tasks do not edit the same files. You can hand an agent from the cloud to your machine to iterate on it, then send it back. The rules from the earlier steps still apply: one scoped task per agent, a plan before the change, and a review before you merge. Parallel agents multiply review work as well as output, so start with two.
Cursor’s changelog also lists voice chat with agents (6 November 2026), which works in the Agents Window, the IDE, the web and Cursor for iOS. It is handy for describing a task while you look at the code; review the result the same way.
Pitfalls
Letting it run without a plan. For any change spanning several files, the plan is where you catch a wrong approach cheaply.
Rules that are really documentation. Long rules that restate the README cost context on every request. Keep rules short and specific; link to docs for background.
Everything set to Always Apply. Scope rules with globs or descriptions so the agent sees what is relevant.
Treating checkpoints as version control. They are an undo button. Commit with Git.
Accepting large diffs in one go. If the diff is too big to review properly, the task was too big. Ask the agent to split it.
Too many parallel agents too soon. Each one produces a diff you must review. If reviews pile up, run fewer.
Next steps
- Write instruction files that work across tools in CLAUDE.md and AGENTS.md.
- Learn what makes a good skill in What are Agent Skills?
- Compare with terminal agents: Claude Code and the Codex CLI.
- Sharpen your review habits with Reviewing AI-written code.
- Run parallel work safely with parallel refactors in Git worktrees.
- See how Cursor compares with terminal agents in Claude Code vs Codex vs Cursor, or with Copilot in GitHub Copilot vs Cursor vs Claude Code.
Covers
- Tools
Check your understanding
Cursor agent basics quiz
Plan mode, reviewing diffs, checkpoints, AGENTS.md and project rules, and skills in Cursor.
7 questions · pass mark 70%
Review
Related
- CLAUDE.md and AGENTS.md: instruction files for coding agents
CLAUDE.md vs AGENTS.md: what to put in each, where Claude Code, Codex, Cursor and Copilot look for them, and how to keep one source of truth without drift.
- Your first session with Claude Code
Install it, run it in a real repository, approve its first changes, commit a reviewed edit and learn the commands you will use daily.
- What are Agent Skills (Claude skills)?
Claude skills, or Agent Skills, are folders with a SKILL.md file that agents load on demand. What goes in one, how loading works and when a skill fits.
- Reviewing AI-written code: what to look for
The ways agent-written diffs fail, a practical review checklist, and how to set up the work so review stays manageable.