Installation
Claude Code installs globally via npm:
npm install -g @anthropic-ai/claude-code
Check the version:
claude --version
Authentication
Run authentication once — the token is stored in the system keychain:
claude auth
A browser opens with an OAuth login to your Anthropic account (or API-key login for Console). After that you do not need ANTHROPIC_API_KEY set for interactive work.
First session
Go to the project root and just run:
cd my-project
claude
An interactive REPL opens right in the terminal. This is not an editor plugin — it is an agent with access to the filesystem, shell, and git within the working directory. Describe a task in plain language:
Read src/server.ts and add error handling to the /api/users route
Claude finds the file itself, reads related modules, proposes changes as a diff, and asks for confirmation before writing.
Permission modes
Claude Code does not perform dangerous actions silently. There are three behaviors:
- default — asks for confirmation on file writes and shell commands. The safe default.
- auto-approve (acceptEdits) — auto-accepts file edits but still asks for potentially dangerous shell commands.
- manual / plan — the agent only proposes a plan and changes nothing until you explicitly allow it.
Choose the mode at launch:
claude --permission-mode auto-approve
You can also switch the mode inside a session via the permission UI (Shift+Tab toggles the edit-acceptance mode).
How it differs from Cursor and Copilot
- Copilot — autocompletion in the editor. Suggests the next line, doesn't see the whole project, doesn't run commands.
- Cursor — an editor with chat and edits; the human drives every step in the IDE.
- Claude Code — an autonomous agent in the terminal: it reads dozens of files, runs tests, makes git commits, and drives a multi-step task to a result. You set the goal, not dictate the steps.
This changes how you work: you describe what you need, not how to type it. That's why the rest of the course is about how to phrase tasks and keep the agent under control.