Getting started with Cursor AI
Prior to 2025, I was quite sceptical of the whole AI trend, outside of occasionally using ChatGPT. This changed at the end of 2024 when my work started an internal pilot for trying out Cursor - a coding IDE. Now I use it on a daily basis, and like it so much that I got my own subscription for personal use on my days off.
The following guide is for the latest version of Cursor 0.46. If you are seeing the
Chat
andComposer
features in your Cursor IDE, I recommend updating to the latest version. The UI has now updated to call themAsk
andAgent
modes.
Why use Cursor?
AI-aided programming has its strengths, but it also still has a lot of weaknesses. It’s not so magical that it does all my coding for me. But I think it does make me overall more productive. And I think being able to effectively use AI is going to continue to become a more and more important skill for developers to have.
Since Cursor is an IDE that looks identical to VS Code, for existing VS Code users it’s really easy to dip your toes in. You can install and use Cursor without actually using the AI, if you wanted to, and your coding experience would be exactly the same. And once you’re ready to try out the AI it’s right there for you, so the barrier to entry is really low.
Cursor’s autocomplete feature
If you’re not comfortable diving straight into the deep end of AI, the first place Cursor will show its value is with its autocomplete feature. As you begin typing, Cursor will show suggestions for what you should type next. All you have to do is hit the tab key to use it.

Cursor is quite good at predicting your next move when it comes to doing repetitive stuff. Maybe if you had a bunch of arrays with strings in them that were missing double-quotes - you could add double-quotes to one string, and Cursor would know to update the rest for you. It’s those sort of little repetitive things that add up and can be a real time-saver.
It’s also able to jump you around the code, say for example you changed the name of a function somewhere - it’s intelligent enough to prompt you to hit the tab key, and it will jump you up to the usages of it.
Ask Cursor a question with Ask mode (formerly Chat)
In older versions this was known as Cursor Chat.
Once you’re ready to dip your toes in, you’ll want to try out Cursor’s Ask mode. If you’re not sure where to start, I recommend treating it like you would a Google search.
To open Cursor’s AI sidebar (called “Chat”), you can type Cmd + L and it will bring up a new sidebar in your IDE. If you already had the sidebar open, you can choose Ask from the mode dropdown.

From here, you can ask it a question:
💬 How do I centre a div?
Chat will output a full response pretty quickly, and it’s quite convenient compared to a Google search, as you don’t even have to leave your IDE.

The caveat here is that AIs tend have a tendency to “hallucinate” or be confidently incorrect. For a CSS question like centering a div, I’m sure that exact question has been asked on Stack Overflow before and so it’s quite good at answering it. But the more niche the question, the more you need to take it with a grain of salt. If you are not sure of its answer, you can ask it to “please provide sources” and it may re-evaluate and realise it lied to you in its previous response.
Choosing a model
The next thing you might notice about the chat sidebar is that you have the option to choose a model from the dropdown. By default, claude-3.7-sonnet is selected:

If you are unsure of a model to use, I would recommend using claude-3.5-sonnet. Claude is considered to be the best for coding. However their latest 3.7 model was very recently released at the end of February, and actually, it seems kind of worse.
You can choose which models show up in the dropdown if you go to
Cursor > Settings > Cursor Settings > Models
. Cursor keeps defaulting to 3.7 for me, so I’ve unchecked 3.7 for the moment in my settings.
How to give Cursor context files
So you can use Ask mode like you would a Google search, but where it shines is asking it questions about your actual code. Instead of asking it how to centre a div you could ask it “how do I centre this div?” If you are using the Ask mode, it doesn’t have access to any of your files, so you will explicitly have to give them as context. There’s a couple of different ways you can do this.
Give code snippets by highlighting code and using Cmd + L
If you first highlight code before pressing Cmd + L
, that code snippet, and the entire file it is in, will be given to Cursor as context when you ask your question. This is the easiest option, and usually how I jump into using Cursor.
Drag and drop to add files or folders to context
You can add a file or even an entire folder to the context, by drag-and-dropping from your file explorer bar in the left to the chat in the right.
Try auto-context mode (beta)
Cursor apparently has a new auto-context feature in beta that will intelligently try and add context files for you (I can’t seem to see it in my settings though ).
Search for files using @
Finally, you can also use the @
symbol in chat, and search for files you want to add as context.
I find the search to be a little finicky, especially in my company’s large codebase, since we have so many levels of nested folders and index.tsx
files, so I don’t use this one that often. If I already had the file path copy-pasted, I might do @
and then paste the file directly after that to find it.
Let the AI Agent take control (formerly Composer)
In older versions this was known as Cursor Composer.
Once you’ve had some time to get used to the Ask feature, you’ll also want to check out Cursor’s Agent mode, which is another one of the options in the modes dropdown. The Agent feature is more powerful as it can make code changes itself across multiple files. It can also iterate on its changes. For example, if it notices a linter error after making its changes, it will go ahead and try and fix that for you, and so on, until it’s done with the solution.
The main downside with Agent is that it is slower - once you fire off a command, you just let it go and do its thing and it will make its way to a solution over a couple of minutes (depending on how complex the problem is). It also sometimes gets stuck in a loop where it tries a fix, realises it didn’t fix it, and then keeps trying again and again.
You can also bring up Agent mode via Cmd + I, and similarly if you have any text highlighted, that will be sent off as well.
Cursor’s Ask vs Agent modes
In what scenario should you be using each mode? I recommend giving both a go to see the difference for yourself. But to briefly compare the two:
- After asking a question, Ask will only give one answer and then stop. The Agent mode can keep going (essentially replying to itself) until it comes to a conclusion.
- After Ask gives you an answer, you will have to manually apply the code snippet it outputs. The Agent will go ahead and make the changes for you (and can do for multiple files).
- Ask mode only has access to context files that you specifically provide it. Agent has access to your codebase by default.
- Ask mode cannot ask you to run terminal commands, while Agent can ask you to run a command, and then iterate based off the results (e.g. you can get it to check unit test output). You can even put it in YOLO mode and then it will run commands for you.
- Ask is generally quick to give you its answer. Agent can be a lot slower.
As a rule of thumb, if you’re treating the AI like a Google search bar, you’ll only need to use Ask. Or if you just want changes made in one file quickly, Ask should do the job. If you want to implement a change that stretches across multiple files, or you to give a lot of files as context, it may be more helpful to use Agent.
I’ve been experimenting a bit with getting Composer to write some unit tests, then prompt me to run them for it, and then go in and fix any that fail. It’s not quite 100% successful yet, but that’s the sort of use case I think it would make more sense to use Composer for.
Ask vs Chat vs Agent vs Composer
Up until recently, Cursor used to look like this:

There were two separate tabs, one called “Chat” and one called “Composer”.
Now it’s all merged into one sidebar, and you can choose between Ask, Agent and Edit modes:

Confusingly, the entire sidebar is called “Chat”. But otherwise, you can think of it as:
- The new “Ask” mode is what used to be called “Chat”
- The new “Agent” mode is what used to be called “Composer”
What is Edit mode?
Edit mode is the third mode you’ll notice in the dropdown. It’s quite new so I haven’t had the chance to use it yet. From what I can see, it’s sort of like using the Ask mode to ask a question about your code, but with the added benefit of it being able to apply changes as well.
Give Cursor instructions with Project Rules
If you find yourself repeatedly correcting the AI - maybe there’s a specific syntax or code structure you want it to follow - you can add specific things to its Project Rules. This is a new feature that I haven’t any time to explore yet, but my one suggestion is to use the AI to generate the rules as you need it. e.g. after I get it to fix up a mistake, I will ask it:
💬 Can you suggest what I should add to my project rules so that you don’t make this same mistake in the future?
This saves you a little brainpower so you don’t have to generate the instructions yourself! Once you’ve gotten a handle on Chat and Composer, I think you should start to invest your time in this feature. One of the things about AI is that although it can generate technically correct answers, sometimes the style of code it writes can be very different to how you would usually write it. To save you inevitably having to fix it up yourself afterwards, you can just add something new to its rules to save you time going forward.
Originally Cursor only had a single rules file called .cursorrules
, where you could dump everything in one file. They are looking to deprecate this feature at some point, so I wouldn’t recommend using it anymore but you may see it referenced around on the web.
My company’s codebase has a lot of little style quirks that I want the AI to follow, so I was quite heavily using this file. However I found that the longer the file got, the AI would end up ignoring chunks of it anyway - I guess there’s a limit to how much it can hold in its brain - so I’m optimistic that the Project Rules feature may be more useful in that regard.
Use cases and practical examples
After 2 months of using Cursor in both a work and hobby programming context, here are some of the use cases that I find it does best at.
Ask it to do something based on a reference file or tutorial page
Cursor is only as strong as the explanation and commands you can give it - it can’t really read your mind (yet). So giving it a reference makes it easier for it to understand what you want from it. If you come across a solution to your problem on Stack Overflow, you can directly link that in your Cursor Chat, and ask it to implement a solution based off of that.
Or maybe if you come across a React tutorial for implementing a specific component, Cursor is pretty good at following those instructions and adding it to your codebase.
I’ve recently been converting our old WebDriver integration tests into Playwright at work - and there’s a couple of quirks with the way we are setting our Playwright tests up. After I got Cursor to convert the first file and fixed up any mistakes it made, I pointed it back to that first file as a reference when I got it to convert the other files, and I found it got better at doing it.
Ask it beginner-level questions for a domain you’re not familiar with
As a frontend engineer, I might on a rare occasion help out in my team’s Java or Kotlin codebase, and I really have no idea what I’m doing there. People often say that Cursor or AI can be treated like a junior-level programmer - and so in that sense, Cursor can be good at doing junior-level things for areas that you have completely no expertise in.
e.g here are the sorts of questions I have asked it for backend things:
- This unit test is failing, but I can’t figure out why, can you help me fix it?
- The build is erroring saying there’s something wrong on line 192 but I can’t figure out which file it’s referring to, can you tell me where? (and I copy-paste the build error)
Treating it like Google and asking for CSS help
As a frontender I would say I’m most likely to use Google to ask for “how to do X in CSS”. Cursor can have mixed results on this. Sometimes I might ask it to fix one problem, and then it ends up introducing another, and there’s a bit of a back and forth before I find it fully fixes all the problems. Sometimes after all the CSS changes, it works but the code looks a bit shit. In that case, I will ask it one final question like:
💬 Can you double-check this CSS and make sure this is the best possible approach?
But I have found it quite helpful in finding and fixing a CSS bug that after much staring, I wasn’t able to figure out on my own. So I would say its overall net-useful.
Asking it to write a script for repetitive changes
Let’s say you had a JSON with 100 objects in it, and you wanted to change the structure of it. I wouldn’t recommend asking Cursor to just straight-up fix it for you: it can be quite prone to screw something up along the way, especially the larger the file is.
However, it can write you a script that you can just execute yourself, and then get perfect results. I don’t use JSON files so much at work, but I store a lot of blog posts and data about mountains on my blog, and I find it comes in handy there when I want to make a repetitive change across all of my files.
Asking for alt text on images
When adding images to hiking posts on my blog, I always try to add alt text to them. Cursor is great for generating alt text for all of the images. When I used to be on the free tier of Cursor, which uses a “dumber” AI, I don’t think it can actually see the images, and just tries to make up alt text based off of the file names and the text surrounding the image. This came with mixed results. On the paid tier of Cursor though, I think it can actually see the images, so it does turn out a lot better. Although I will give it a pass through and update the stuff that needs editing.
When I don’t use Cursor (at work)
Ultimately, AI-aided programming gains its knowledge from all the code out there on the internet. So it does pretty well when I want to add a React component to blog, but I find it less effective when dealing with my company’s codebase. We have a lot of niche utils and very specific but implicitly understood code style rules that I’m very used to from years of working here, but that the AI really has no idea about.
Generally speaking, I’m not finding Cursor is quite good enough to fully implement a feature that I’m working on at work. With the hassle of the back and forth of trying to explain the feature, which util functions it should be using, needing to use feature flags and telling it where all the files live, it’s still faster to implement it myself.
Using Cursor to generate unit tests
The one place where I’m experimenting with Cursor at work at the moment is using it is for unit tests. I feel like this fits the use case for AI - it’s a repetitive task that can easily be pointed to with reference files. I generally try and ask it:
💬 Looking at my changes in file Y, can you add/update the unit tests in file X? Please reference file Z for an example of how to write unit tests.
I will say, it’s not perfect and sometimes has mixed results, but I think it may be a little bit faster than attempting to write it all out manually myself. Like I mentioned earlier in the post with .cursorrules
, I have been continuously adding to my Cursor rules file with all the specific “this is how you should write a unit test” type of rules over time.
I was also experimenting with asking it to implement the tests, and then running the test, and then updating the test based on the test run results. For the moment I will say that this is a bit of a work in progress! I will have to come back and update this section (or write a new post) once I land on a solid approach that works.
Other tips for Cursor
Get it to confirm before coding
Before diving in, I’ve found it helpful to get the AI to play back your requirements to make sure nothing is misunderstood. Simply tell it:
💬 Before writing the script, can you first play back to me what you are planning on doing, and I will confirm if you are on the right track or not.
This prevents the AI from immediately generating code that might miss some of your requirements.