So Cursor offers different modes for running these
agents, these local agents at least, Agent,
Plan, and Ask, at the point of time where I'm recording
I'll get back to Ask mode. When writing code, you typically
work with Agent and/or Plan. Now, what's the
difference? If you have a simple, clearly specified task
like this one here arguably is, you can use Agent mode.
And if you use that mode and you hit that Enter button or send that
message, Cursor will go ahead and use AI to fulfill
this task and to write the appropriate code.
Now, if you're not sure if you did a good job specifying that
task, if you're maybe working on a more complex
sure that you didn't forget anything that might be important to the
AI, you can switch to Plan mode. You can also get there by
simply hitting Shift+Tab. In Plan mode, when you
send this command, Cursor will not go ahead and write
code immediately. Instead, it will first analyze your
task, possibly ask for some clarification if
needed, and then make a plan. It will then
execute step by step. So even though the task is simple here,
let's do that. I'll send this to Cursor using Plan
mode. And now you can see the output here
as it's thinking and generating tokens.
If you had multiple Cursor sessions, you could switch between them here with
help of this button. You see active sessions indicated here
by this blue dot. You can also rename and delete sessions here, by the
way, if you want to. And we could now definitely also open a
session if we had another task we already might wanna work on.
And you can also run multiple tasks at the same time.
You just might wanna be careful that they don't clash with each other,
though if you're using Git worktrees, for example, you could even work on the
same files in different work trees at the same time if you wanted to.
Now, here we only need one task, though, so I'll switch back to that.
In my case here, I didn't get any follow-up questions
because this is a simple task and I had pretty clear instructions.
For more complex tasks, you might definitely get some.
What I do get here, however, is a plan, which also opened up here in the
left. And you can also click View Plan to, well, view
it. This plan is a Markdown file created by
Cursor, which is not stored in the project by
It's loaded in memory, so to say. And this plan highlights what
Cursor wants to do in the next steps.
And it's easy to just click Build here and accept the plan, but my
clear recommendation is to rate that plan to make sure that
Cursor will do what you want it to do.
You can also tweak that plan if you want to.
So as we see here, it wants to start by importing necessary
able to read files. Then it wants to scan for Markdown files
inputs folder. It then wants to read it with
read_text and then print the filename and content_length for
verification since, for the moment, we don't have any follow-up steps yet for
first task, which was only to read those
files. Now, it automatically detected
that it should probably do that in main.py.
I haven't told it so, but it's the only file we have here,
and then we have some extra notes here. And again, we could edit this.
We could add more if we had some extra instructions.
But I'm happy with that plan, so I can click Build here
or also here, and that will then accept the
plan, and if I do that, automatically switch to Agent
mode. So now that plan, together with our
original instruction, is used to write that
code. By the way, when working in Agent mode,
entire chat history that's used as context.
So you can send follow-up messages, and those messages or
the AI, when handling those messages, will be aware of
this entire chat history. That's important to know.
So here it's done, and I'll close this plan.
And now you see which files were edited by Cursor.
You can decline or accept those changes, but most importantly, you
can click on those files to see those changes, which, of course, is important
because again, it's easy to just always accept
but then you're doing wipe coding, which might be fine.
But of course, the strength of being an engineer
developer is that you can rate that code and decide whether
you're happy with the code produced by Cursor or not.
So here I'm in main.py, and you can see in green I see all the
was added. In red, I see the code that was removed.
I can hover over the code to undo or accept it
on a block-by-block basis. And here I only got two
blocks. I got the imports, so I could click Keep here,
that because you can always accept everything in that file here by
clicking this button on the bottom.
If you had multiple files in which edits were made, which Agent mode
can do, you will also have buttons for switching
here. So here the import looks good to me, and
then we're reading those files and printing some information.
I can therefore click Keep all. But before I do that, I also wanna
show you that even before accepting this, you can test these
changes, which is very nice. So I'll open my terminal here, the
one integrated into Cursor, and I'll use this uv tool, which I
installed to run this main.py file.
And if I do that, you see it went
through that file and then gave me that
output, which proves that this code works.
So with that, I'll then click Keep all.
And that's in a nutshell how you can use Agent mode.
But of course, there's more to it.