Make AI Work for You

At the back

Typing commands on Windows and Mac

For when you want, or need, to type a command.

What this page is forTwo places you can type commandsOpen a terminalRun a commandStay safeExample: install Claude Code from a terminal

01What this page is for

You can do the whole course without typing a single command. Claude Code works from the Claude desktop app, and the setup tool is a web page.

This page is for when you want to, or a guide tells you to. For example, to install Claude Code the other way, by typing a command.

02Two places you can type commands

  • A terminal. A window on your computer where you type commands and press Enter. On Windows it's called PowerShell or Terminal. On a Mac it's called Terminal.
  • Inside Claude Code. Commands that start with a slash, like /clear. These only work inside Claude Code, not in a terminal.

They're different places. A command for one won't work in the other.

03Open a terminal

  • On Windows: press the Windows key, type PowerShell, and press Enter.
  • On a Mac: press Command and Space together, type Terminal, and press Enter.

On Windows, use PowerShell, not Command Prompt. They look alike, but the commands on this page are for PowerShell. If you see the error "'irm' is not recognized", you're in Command Prompt. Close it and open PowerShell.

A window opens with a line of text ending in a symbol, like > on Windows or % on a Mac. That's where you type.

04Run a command

  1. Copy the command from a source you trust.
  2. Paste it into the terminal. On Windows, right-click in the window, or press Ctrl+V. On a Mac, press Command+V.
  3. Press Enter.
  4. Wait until the line ending in > or % comes back. That means it has finished.

If you see an error, copy the whole message and paste it into your AI tool with: "I ran this command and got this error. What does it mean, and what should I do?"

05Stay safe

  • Only run commands from a source you trust. That means the tool maker's own website, or this course.
  • If you don't know what a command does, ask first. Paste it into your AI tool and ask "What does this command do? Is it safe?" before you run it.
  • Never type a password into a command that a web page or a stranger gave you.
  • To stop a command, press Ctrl+C on Windows. On a Mac, press Control+C, not Command+C.

06Example: install Claude Code from a terminal

This is optional. The Claude desktop app is the easier way in, as in Module 1. You can download it from claude.com/download. Claude Code needs a paid Claude plan.

On Windows, paste this into PowerShell:

Copy this
irm https://claude.ai/install.ps1 | iex

On a Mac, paste this into Terminal:

Copy this
curl -fsSL https://claude.ai/install.sh | bash

To check it worked, close the window, open a new one, and type:

Copy this
claude --version

If you see a version number, it's installed.

To start Claude Code in your project folder, type cd, then a space. Then drag your project folder from File Explorer or Finder into the terminal window. Its path appears. Press Enter, then type claude and press Enter. If no path appears on Windows, check you didn't open the window as administrator. Dragging doesn't work in that kind of window.

07Commands inside Claude Code

Type these inside Claude Code, not in a terminal:

  • /clear starts fresh, without the old conversation.
  • /compact squeezes a long session into a short summary, to make room.
  • /rewind goes back to an earlier point. Pressing Esc twice does the same.

08Sources

Checked on 11 November 2026.

  • The install commands and the version check: Claude Code docs, "Advanced setup" (code.claude.com/docs/en/setup), read on 11 November 2026.
  • Claude Code needing a paid plan, and the desktop app: Claude Code docs, "Advanced setup" and "Desktop quickstart" (code.claude.com).
  • /clear and /compact: Claude Code docs, "How Claude Code works" and "Manage costs effectively". /rewind and pressing Esc twice: Claude Code docs, "Checkpointing" (code.claude.com).
  • The "'irm' is not recognized" error in Command Prompt, and what to do: Claude Code docs, "Advanced setup" and "Terminal guide for new users" (code.claude.com).
  • Opening PowerShell: Microsoft Learn, "Starting Windows PowerShell". Right-click to paste: Microsoft Learn, Windows Terminal "Interaction" settings. Opening Terminal, Control+C, and dragging a folder in: Apple's Terminal User Guide (support.apple.com). Dragging a folder into a Windows terminal, and it not working in an administrator window: Microsoft's own Windows Terminal issue tracker (github.com/microsoft/terminal, issue 15996). It isn't in Microsoft's help pages.