Claude CodeClaude Code 2.1 · macOS, Linux, Windows
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
31 small wins to finish your pathNext lesson

Install it and ask it something

One command to install, one command to start, and one question to ask. The point of this lesson is the answer you get back and what had to happen for it to be right.

Install

On macOS, Linux or WSL:

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

On Windows PowerShell it is irm https://claude.ai/install.ps1 | iex, and Homebrew has it as brew install --cask claude-code. The installer script keeps itself updated in the background; the Homebrew cask does not, so that one needs brew upgrade now and then.

bash
claude --version
Captured from a real run
2.1.138 (Claude Code)

That number matters later. Claude Code ships changes weekly, and a lesson that mentions a flag will say which version it was checked against.

Start it in a project

Claude Code works in whatever directory you start it in. There is no project to create and nothing to index.

bash
cd link-shortener
claude

That opens the interactive session, which is where you will spend most of this course. The first time it will ask you to log in with your Claude account or an API key.

The first question

Rather than opening the interface, this lesson asks the same thing without it. The -p flag runs one prompt and prints the answer, which is the form that fits on a page. Everything it does is the same either way.

bash
claude -p "In one sentence, what does this project do?"
Captured from a real run
Shortens long URLs to compact codes and expands them back to original URLs.

Nothing was pasted in. No files were attached, no folder was uploaded, and no search index was built beforehand. It was given a question and a directory, and it went and read the project itself.

That single fact is what separates this from a chat window with your code copied into it, and the next lesson is about how it happens.

It can teach you the tool
Ask it about itself. claude -p "how do I set up hooks?" works, and so does asking inside a session. It has read its own documentation, which makes it a reasonable first place to look when this course has not covered something yet.
Try it yourself
  • Run the same question in one of your own repositories and see how much it gets right.
  • Ask claude -p "what would you change first in this project?" and keep the answer for later.

Little by little, you're building something great.