Claude Code CLI Setup
What is Claude Code CLI?
Section titled “What is Claude Code CLI?”Claude Code CLI is a terminal-based AI coding assistant from Anthropic. You type natural language prompts directly in your terminal and Claude reads, writes, and modifies files on your machine. It is the recommended tool for following the CoEngineers guides.
Before You Start
Section titled “Before You Start”All the steps below happen inside a terminal. If you have never used a terminal before, follow the Using the Terminal guide first, then come back here.
Step 1: Install Node.js
Section titled “Step 1: Install Node.js”Claude Code CLI requires Node.js 18 or later. You may already have it installed. Open your terminal and run:
node --versionIf you see a version number like v18.x.x or higher, skip ahead to Step 2. If you see “command not found” or a version below 18, follow the instructions below.
Install Node.js
Visit nodejs.org and download the LTS installer for macOS. Run the .pkg file and follow the prompts.
Alternatively, if you have Homebrew installed:
brew install nodeVisit nodejs.org and download the LTS installer for Windows. Run the .msi file and follow the prompts. Make sure “Add to PATH” is ticked during installation.
After installing, verify by running:
node --versionYou should see a version number like v20.x.x or higher.
Step 2: Install Claude Code CLI
Section titled “Step 2: Install Claude Code CLI”Open your terminal and run:
npm install -g @anthropic-ai/claude-codeVerify the installation:
claude --versionStep 3: Authenticate
Section titled “Step 3: Authenticate”Run Claude Code for the first time:
claudeThis will open your browser and prompt you to sign in with your Anthropic account. Follow the on-screen instructions to complete authentication. Once authenticated, the CLI will confirm you are signed in and you will see the Claude Code prompt in your terminal.
Step 4: Basic Usage
Section titled “Step 4: Basic Usage”Navigate to your project folder and start Claude Code:
cd ~/my-projectclaudeYou are now in an interactive session. Try your first prompt:
Here's what I found in this directory: 1. meeting-notes.docx: A Word document containing meeting notes 2. budget.xlsx: A spreadsheet with budget figures 3. photos/: A folder containing image files The directory has 2 files and 1 folder.
LLM outputs are non-deterministic and may vary from this example.
Claude will read your files and respond directly in the terminal.
Useful Commands
Section titled “Useful Commands”| Command | Description |
|---|---|
claude | Start an interactive session in the current directory |
claude "your prompt" | Run a single prompt without entering interactive mode |
claude --help | Show all available options |
/help | Show help within an interactive session |
Ctrl+C | Cancel the current response |
Ctrl+D or /exit | Exit the interactive session |
Next Steps
Section titled “Next Steps”Return to the Prerequisites page and continue with the guides. When you see an LLM Prompt Box, copy the prompt and paste it into your Claude Code CLI session.