Installation does not mean readiness

After installation, check the entire chain: the shell can find the CLI, Claude starts in the correct directory, authorization works, and commands run in the same environment where the project lives.

The most common causes of problems are PATH, different shells, WSL versus Windows-native, an IDE terminal with different settings, or launching outside the repository root.

The installation channel depends on the environment

Choose one official method and update Claude through the same channel afterward. The commands below are guidance; check the current syntax against the official documentation and `claude --help`.

macOS or Linux
brew install --cask claude-code
# or
npm install -g @anthropic-ai/claude-code
# or the official installer
curl -fsSL https://claude.ai/install.sh | bash
Windows-native
irm https://claude.ai/install.ps1 | iex
# or
npm install -g @anthropic-ai/claude-code
Project in WSL
curl -fsSL https://claude.ai/install.sh | bash

First launch and diagnostics

  1. Open a new terminal in the project environment.
  2. Go to the repository root.
  3. Check the CLI version.
  4. Launch an interactive Claude Code session.
  5. Run /doctor, then /status.
  6. Save a short log of the initial state.
cd ~/projects/commerce-os
claude --version
claude
/doctor
/status

Authorization and Gateway

The sign-in flow may depend on the type of account access. After authorization, check `/status` to understand which account and environment the session is using.

For a learning Gateway, configuration may be stored in the global `~/.claude/settings.json`, while local parameters are stored in `.claude/settings.local.json`. Project values may have higher priority.

Example structure without a real token
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://llm.javarush.com",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_COURSE_TOKEN",
    "ANTHROPIC_MODEL": "claude-course-fast[1m]",
    "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1"
  }
}

Updates and common failures

  • After an update, check claude --version, open a new session, and repeat /doctor.
  • If the command is not found, restart the terminal and check PATH and the installation channel.
  • If the CLI works in only one terminal, compare the shell and PATH in the regular terminal and the IDE terminal.
  • If Claude cannot see the project, check the current directory, Git root, and launch environment.
  • If SSH or a container does not work, check the installation on the server or inside the container itself.
First-launch log
Date:
Project:
Directory:
OS:
Shell:
Claude CLI version:
Authorization:
/doctor result:
/status result:
Notes:

Canonical lesson source · JavaRush

Open JavaRush material