Vibe coding with Claude Code course ยท Module 1: Claude Code and Cursor
Installing Claude Code and the first request
In this lesson12
Ahoy! The ship is already in port: Cursor works. Only the crew is missing. In this lesson you will sign Claude Code on board, give your first order and check in Cursor what really landed in the hold.
The problem: an order without control is a gamble
An agent that writes files on its own is powerful, but on the first voyage you want to see its every move before you approve it. That is why we go slowly today: first the installation, then a mode in which Claude asks for permission before every change, and only at the end the first request and learning to undo.
Step 1: the port, that is the project folder
Claude Code works in the folder where you start it: it sees the files of that folder and its subfolders, and reaches files outside it only with your permission. So that folder sets the limits of its work.
Create an empty folder pirate_ship on your computer, for example in Documents, with an ordinary file manager. Then in Cursor choose File, Open Folder and point to that folder. The Explorer on the left will show an empty project. Open the terminal with the shortcut from the previous lesson: Control+` on a Mac, Ctrl+` on Windows and Linux.
Step 2: installing Claude Code
The recommended method is the native installer, which updates Claude Code on its own in the background. On macOS, Linux and in WSL (Linux running inside Windows) type in Cursor's terminal:
curl -fsSL https://claude.ai/install.sh | bashThis command downloads the official installation script from claude.ai and runs it right away. Install programs this way only from the address of a maker you trust: in lesson 0_3 you will see why similar commands from unknown addresses are a red flag. The installer shows no progress, so wait until it finishes.
On Windows first check which shell you are in: PowerShell shows the letters PS before the path at the start of the line, while CMD shows just the path. In PowerShell type:
irm https://claude.ai/install.ps1 | iexHere irm downloads the script and iex runs it. In CMD use this command instead: curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd. On Windows Git for Windows is also recommended: it gives Claude the Bash tool, and without it Claude Code uses PowerShell. In WSL you don't need Git for Windows.
When the installer finishes, open a new terminal, for example with the shortcut Control+Shift+` on a Mac or Ctrl+Shift+` on Windows and Linux, and check the installation:
claude --versionA working installation prints a version number followed by (Claude Code). If the terminal says it doesn't know the claude command (command not found or is not recognized), the install directory has not reached the PATH yet, which is the list of places where the terminal looks for programs. Close the terminal and open a new one. If that doesn't help, the installer prints a ready-made fix at the end of its work in the Setup notes section.
Step 3: the first session and logging in
In Cursor's terminal, in the pirate_ship folder, type claude and press Enter. On the first run Claude Code will ask you to log in: a browser opens where you sign in with a Claude account on a paid plan or with a Claude Console account. The login data is saved, so later sessions start without this step. Claude Code may also ask whether you trust this folder: it is your empty port, so confirm.
Above the request field you will see the version, the model name and the working directory. Check the directory: the path must end with pirate_ship. If you see another folder, leave the session with the /exit command and open the right folder in Cursor. The /help command prints the list of available commands.
Step 4: Manual mode for the first voyage
The permission mode decides what Claude can do without asking. A session in the terminal starts in auto mode: Claude writes files and runs commands on its own, while a separate model in the background judges its actions and blocks the risky ones. That is convenient, but on the first voyage you want to see every move of the crew.
Press Shift+Tab. From auto mode the first press switches the session to Manual, which the mode indicator will show. Further presses cycle through acceptEdits (files saved without asking) and plan (planning only), so if you skip past it, keep pressing until you see Manual again. In this mode Claude asks you before every file change and before commands that change something.
The choice applies to the current session: a new session will start in auto mode again, so check the indicator at the start of each one. Captain's tip: stay on Manual for the first few locations, and switch to auto once reading changes becomes second nature.
Step 5: a question first, then an order
Start with a question that changes nothing: type in the session "What is in this folder?". Claude will look through the folder and answer that it is empty. A question only reads, while a request changes files, so Claude will ask for permission only at the request.
Now the order from the previous lesson. It has a goal, a place and constraints, so Claude doesn't have to guess anything:
Request for Claude Code:
Create a file pirate.html in this folder: a page with the heading "Ahoj Piraci!"
in red and one welcome paragraph. Put the styles in a <style> tag
in the same file. Do not create any other files.In Manual mode Claude will stop before saving the file, show what it intends to do and ask for permission. Read the proposal, use the arrows to select Yes and press Enter. Skip for now the options that allow more than this one time, for example until the end of the session. When the file is created, it appears in the Explorer.
What Claude wrote
Click pirate.html in the Explorer to open it in the editor. Your file may differ in details, for example the text of the paragraph, but the structure will be similar. Read from the top. The first part is the document skeleton:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Ahoj Piraci!</title><!DOCTYPE html> tells the browser that this is an HTML document. lang="en" marks the page as English, <head> holds information for the browser, and <meta charset="UTF-8"> makes special characters display correctly. <title> is the text on the browser tab, not on the page itself.
Next, still in <head>, comes a <style> tag with a CSS rule. CSS is the language that describes how a page looks. A rule consists of a selector, which is what it applies to, and a property in curly braces:
<style>
h1 {
color: red;
}
</style>
</head>The h1 selector picks first-level headings, and color: red gives their text a red colour. The rule does not change the paragraph or the page background: it applies only to h1 headings. The closing </head> ends the part meant for the browser.
The last part is <body>, the content you actually see on the page, with the heading and paragraph from your request:
<body>
<h1>Ahoj Piraci!</h1>
<p>Welcome aboard! Our adventure starts here.</p>
</body>
</html><h1> is a heading with exactly the text you asked for, and <p> is a paragraph. The closing </body> and </html> end the document. To see the page, double-click pirate.html in an ordinary file manager: it opens in the browser.
Captain's review
Before you sail on, check four things in Cursor:
- The file is in
pirate_ship, not in another folder. - One file was created, just as you asked. A typical agent mistake is doing more than ordered: an extra
style.css, a README or sections you didn't ask for. You will notice it in the Explorer and in the file content. - The heading has exactly the text "Ahoj Piraci!".
- The colour sits in the CSS rule in
<style>, and the page in the browser has a red heading.
If something doesn't match, don't patch it by hand: tell Claude what to fix, or undo the change, as in a moment.
A second request and a change in the file
Ask for a small change to see what fixing an existing file looks like:
Request for Claude Code:
In pirate.html change the colour of the h1 heading to navy.
Leave the rest of the file unchanged.Before it saves the change, Claude will again show what it intends to do and ask for permission. Agree and look at the file in Cursor. In the heading rule one value changed:
h1 {
color: navy;
}Instead of red there is now navy, and the rest of the file is the same as before. This is how you read every fix: you look for what changed and check that nothing else was touched.
Esc and /rewind: the brake and the anchor
Two tools give you full control over the crew:
- Esc interrupts Claude in the middle of work. What it has already done stays, and Claude waits for your guidance. Esc pressed at a permission request works like the answer No.
- /rewind (or Esc twice with an empty request field) opens the undo menu. Before each of your requests Claude Code remembers the state of the files it changes, so you can go back to the moment before any request.
In the menu you choose the request to return to, and then one of the options: Restore code and conversation (code and conversation), Restore conversation (conversation only), Restore code (code only) or Never mind (do nothing). There are also options for summarising the conversation, but you don't need them today.
Exercise: type /rewind, choose the request with the colour change and the Restore code option. Open pirate.html in Cursor: the heading is red again and the conversation remained. A caveat for the future: /rewind undoes changes made with Claude's file editing tools, but it will not undo the effects of every terminal command. That is why in lesson 0_3 you will learn to read commands before you agree to them.
The Claude Code extension for Cursor (optional)
Claude Code has an official extension for VS Code that also installs in Cursor: on the page code.claude.com/docs/en/vs-code there is an Install for Cursor link. The extension adds a graphical conversation panel to the editor with its own copy of Claude Code, but it does not install the claude command in the terminal: for that you need the installation from step 2. The documentation says that in the VS Code terminal a running claude connects to the extension by itself; it does not say that about Cursor's terminal. Captain's tip: the course works in the terminal because it looks the same in every editor, and you can add the extension later.
Next step
When you finish, leave the session with the /exit command or press Ctrl+D twice. Next time, in the same folder, you will return to the conversation with the command:
claude -cThe -c option (from continue) resumes the latest conversation in the current folder, so Claude remembers what you agreed. Plain claude starts a conversation from scratch, but the project files of course stay. Let the next request be small again, for example: "Add a button under the paragraph with the text Join the crew. Do not change the heading." In lesson 0_3 you will learn to read the commands that Claude runs in the terminal.
Remember: you give the order, Claude Code writes, and Cursor shows what really landed in the hold.
Code for this lesson: index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Ahoj Piraci!</title>
<style>
h1 {
color: red;
}
</style>
</head>
<body>
<!-- This is what pirate.html might look like after the first request from the lesson. -->
<!-- Your file from Claude Code may differ in details, for example the paragraph text. -->
<h1>Ahoj Piraci!</h1>
<p>Welcome aboard! Our adventure starts here.</p>
</body>
</html>Spotted a mistake in this lesson?
Check yourself
Answer the questions from this lesson. Pick an answer to see right away whether it is correct.
1. What does the claude --version command show?
2. Which shortcut switches the session's permission mode, for example from auto to Manual?
3. Claude Code changed a file and you don't like the result. How do you go back to the state before the request?
4. When is it worth switching a session from auto to Manual mode?
5. Which request to fix pirate.html is the best?
6. Where does Claude Code create and change files?
7. Claude started doing something other than you wanted. Which key interrupts its work?
Hands-on tasks in the game
- Code editor
Use Cursor to create a simple HTML file
- Vertical ordering
Arrange the steps of the first Claude Code session in the right order:
- Horizontal ordering
Assemble the command that installs Claude Code on macOS, Linux and WSL:
- Vertical ordering
Arrange the steps of one change in Manual mode:
Tasks after this lesson
- QuestionQuiz: Checking the installation
- Coding taskPractice: Create the pirate.html file
- Put in orderSorting: The first Claude Code session
- QuestionQuiz: Changing the permission mode
- QuestionQuiz: Undoing a change
- Put in orderConnecting: Installing Claude Code
- QuestionQuiz: When to use Manual mode
- QuestionQuiz: A correction request
- QuestionQuiz: Where Claude Code works
- Put in orderSorting: A change in Manual mode
- QuestionQuiz: Interrupting Claude's work