AI / Tutorial

Claude Code: installing and getting started

Installing Claude Code on Windows, macOS or Linux, signing in, starting a first session on a project, understanding permission modes, writing a CLAUDE.md file, knowing the essential commands and securing your use (access rules, sandbox, secrets).

AI Tutorial Intermediate Published October 20, 2026 Translated November 20, 2026 20 min read Version française
Green text scrolling on a dark screen
Photo: Jake Walker on Unsplash

Before you start

  • A Claude Pro, Max, Team or Enterprise subscription, or a Claude Console account (the Free plan doesn't include Claude Code)
  • Windows 10 (1809) or later, macOS 13 or later, or a recent Linux distribution (Ubuntu 20.04+, Debian 10+)
  • 4 GB of RAM and an internet connection
  • Having already opened a terminal; Git installed, preferably

In plain words

Claude Code is Claude installed in your terminal, with permission to read your project, modify files and run commands. Instead of copying and pasting code between a conversation and your editor, you tell it "fix this bug", "add a test", "write the backup script", and it explores the project, makes the changes, runs the tests and shows you the result. It's a colleague working directly in your workshop: very effective, as long as you tell it clearly what it's allowed to touch.

Claude Code is as useful to developers as to administrators: PowerShell or Bash scripts, Ansible files, configurations, Dockerfiles, documentation for a Git repository. To get started with Claude in the app, see Getting started with Claude. Information checked on 20 October 2026 against the official documentation; commands change, and the documentation is the authority.

1. Where to use Claude Code

Interface For whom
Terminal (CLI) The reference interface, described on this page
VS Code and JetBrains Extensions that integrate Claude Code into the editor, with changes displayed
Desktop app Claude Code without a terminal, with a graphical interface
Web (claude.ai/code) Sessions in the cloud, on a GitHub repository, with nothing to install
GitHub Actions, GitLab CI/CD Automating code reviews or fixes in continuous integration

2. Installing

The native installer is the recommended method: it installs a standalone executable and updates it automatically. You don't need administrator rights.

macOS, Linux, WSL:

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

Windows, in PowerShell:

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

Windows, in Command Prompt (CMD):

curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

PowerShell or CMD?

The PowerShell prompt starts with PS C:\, the CMD prompt with just C:\. If you see The token '&&' is not a valid statement separator, you're in PowerShell; if you see 'irm' is not recognized, you're in CMD.

With a package manager

System Command Updates
Windows winget install Anthropic.ClaudeCode Manual: winget upgrade Anthropic.ClaudeCode
macOS brew install --cask claude-code Manual: brew upgrade claude-code
Debian, Ubuntu, Fedora, RHEL, Alpine Signed apt, dnf and apk repositories (see the setup documentation) With system updates
All, with Node.js 22+ npm install -g @anthropic-ai/claude-code npm install -g @anthropic-ai/claude-code@latest

Never sudo npm install -g

The documentation explicitly forbids it: installing a global npm package as root creates permission problems and a security risk. Use the native installer instead.

Windows: native or WSL?

Option For whom Note
Native Windows Windows projects and tools (PowerShell, .NET) Preferably install Git for Windows: Claude Code then uses Git Bash; otherwise, it uses PowerShell
WSL 2 Linux projects, Bash scripts, Docker Run the Linux installer inside WSL; it's also the only Windows option that supports the sandbox

Checking the installation

Open a new terminal, then:

claude --version
2.1.xxx (Claude Code)

For a full diagnosis (installation, settings, updates):

claude doctor

If claude isn't recognised, the installation folder isn't in the PATH yet: close and reopen the terminal, then see the troubleshooting page in the documentation.

3. Signing in and starting a first session

Go to the project folder, then start Claude Code:

cd ~/projects/admin-scripts
claude

On first use, a sign-in page opens in the browser: sign in with your Claude account. The credentials are then kept. To switch account: type /login in the session.

Start by having it explore the project before asking for changes:

what does this project do? what's the folder structure and which tools does it use?

Then a first simple task:

add to the backup.sh script a check that the destination disk is mounted
before starting the copy, and a clear error message otherwise

Claude Code finds the file, proposes the change, applies it according to the permission mode, and can run the script or the tests to check.

4. Permission modes: who decides?

This is the most important setting. It sets what Claude Code can do without asking you. You switch from one mode to another with Shift+Tab during the session, or at launch with --permission-mode.

Mode What runs without asking When to use it
Manual (default) Reads only Sensitive work, unfamiliar code, discovering the tool
acceptEdits Reads, file edits, common file commands (mkdir, cp, mv…) Iterating on code that you review
plan Reads only, then presents a plan to approve before any change Exploring and preparing a significant change
auto Almost everything, with safety checks made by a second model (classifier) Long tasks on a well-understood project
dontAsk Only explicitly allowed tools; the rest is refused Locked-down scripts and continuous integration
bypassPermissions Everything, with no checks at all Only in an isolated container or VM

The starting mode has changed

Since recent versions (2.1.283 and later), interactive sessions in the terminal and VS Code start in auto mode: Claude edits most files and runs most commands without asking you. For a first encounter or sensitive work, start with:

claude --permission-mode default

or switch to Manual mode with Shift+Tab at the start of the session.

5. The CLAUDE.md file: the project's memory

Each session starts from an empty context. The CLAUDE.md file holds the standing instructions that Claude Code reads at start-up: build and test commands, conventions, architecture, known pitfalls.

To generate a first version, run this in the session:

/init

Claude analyses the project and writes a CLAUDE.md, which you then complete with what it can't guess.

Location Scope Shared with
~/.claude/CLAUDE.md Your preferences, for all your projects You alone
./CLAUDE.md or ./.claude/CLAUDE.md The project The team, through Git
./CLAUDE.local.md Your personal settings for this project (add it to .gitignore) You alone
File managed by the organisation (for example /etc/claude-code/CLAUDE.md on Linux) The whole organisation All users

Example for a repository of administration scripts:

# Administration scripts

- Bash scripts for Debian 13, PowerShell 7 for Windows Server 2025.
- Test a Bash script: `shellcheck script.sh`, then run it on the test VM `test01`.
- Never run a script on a production server.
- Every script starts with a help block (`--help`) and logs to /var/log/admin/.
- Variables in upper case, functions in lower case with underscores.
- User in examples: spo.

A CLAUDE.md can import others with the @path/file.md syntax. Claude Code also keeps an automatic memory of your corrections and preferences, specific to each repository.

Short and precise

The shorter and more concrete the instructions, the better they're followed. CLAUDE.md is an instruction, not a barrier: to forbid an action no matter what, use permission rules (part 7).

6. The essential commands

In the terminal

Command Effect
claude Opens an interactive session in the current folder
claude "task" Opens a session with a first request
claude -p "question" Answers once, then returns control (useful in a script)
claude -c Resumes the last conversation in this folder
claude -r Chooses a past conversation to resume
claude update Installs the latest version immediately
claude doctor Diagnosis of the installation and settings

In a session

Command or key Effect
/help List of available commands; typing / also shows commands and skills
/init Generates or improves the CLAUDE.md
/clear Clears the conversation to start a new task
/compact Summarises the conversation to free up space in the context
/context Shows what's taking up the context (CLAUDE.md files loaded, etc.)
/model Changes model
/permissions Views and edits access rules
/config Settings, including the update channel (latest or stable)
/login Switches account
Shift+Tab Changes permission mode
Esc Interrupts Claude mid-action
/exit or Ctrl+D twice Quits

7. Securing your use

Permission rules

Rules add to the modes: allow (allow without asking), ask (always ask), deny (always refuse, even in bypassPermissions mode). They go in a settings file:

File Scope
~/.claude/settings.json You, for all projects
.claude/settings.json The project, shared through Git
.claude/settings.local.json You, for this project only

Example .claude/settings.json for an infrastructure repository:

{
  "permissions": {
    "allow": [
      "Bash(shellcheck *)",
      "Bash(git status)",
      "Bash(git diff *)"
    ],
    "ask": [
      "Bash(git push *)",
      "Bash(ssh *)"
    ],
    "deny": [
      "Read(./.env)",
      "Read(./secrets/**)",
      "Bash(rm -rf *)"
    ]
  }
}

Good habits

  • Work in Git: commit before a significant task. Every change can be reviewed with git diff and undone easily.
  • No secrets in the project: passwords and keys go in a vault or environment variables, and .env files are blocked from reading by a deny rule.
  • Never straight to production: have Claude Code work on a copy, a branch or a test VM, then deploy yourself.
  • Turn on the sandbox (/sandbox, on macOS, Linux and WSL 2): it limits what the commands it runs can reach on the disk and network.
  • bypassPermissions mode only in a disposable container or VM, with no access to your data or credentials.
  • Be wary of the content it reads: a file, a web page or a ticket can contain hidden instructions (prompt injection). Manual mode or ask rules keep a human in the loop for sensitive actions.
  • Review the code produced before running it on an important system, as you would a colleague's code.

8. Going further

Feature What it is
MCP Connecting Claude Code to external tools (database, ticketing, monitoring) with claude mcp add
Skills Reusable procedures that Claude applies when the task calls for them
Subagents Specialised assistants (code review, tests) that Claude Code launches for part of the work
Hooks Scripts triggered at certain moments (before a command, after an edit) to check or format automatically
Plugins Ready-to-install bundles of skills, commands, hooks and MCP servers
Non-interactive mode claude -p in a script or a scheduled task

Anthropic offers a free course, Claude Code 101, on Claude Academy.

Key points

  • One-command installation (curl … | bash or irm … | iex), automatic updates; check with claude --version and claude doctor.
  • Requires a Pro, Max, Team or Enterprise plan or a Console account.
  • Shift+Tab changes the permission mode; recent sessions start in auto: switch to Manual for sensitive work.
  • /init creates the CLAUDE.md: short, concrete project instructions.
  • deny rules for secrets and dangerous commands, Git to review and undo everything, never straight to production.

Read next