SOP-001: Installation & Setup
DOCUMENT CONTROL
| Field | Value |
|---|---|
| SOP ID | SOP-001 |
| Version | 1.0 |
| Status | Active |
Purpose
This procedure covers the complete installation and initial setup of Claude Code, Anthropic's official AI coding assistant.
Prerequisites
- Node.js 18+ installed
- npm or compatible package manager
- Terminal access
- Anthropic account (or OAuth provider)
Installation Flow
┌─────────────────────────────────────────────────────────────────────┐
│ INSTALLATION PROCEDURE │
└─────────────────────────────────────────────────────────────────────┘
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ INSTALL │────►│ AUTHENTICATE│────►│ CONFIGURE │
│ CLI │ │ │ │ │
└─────────────┘ └─────────────┘ └─────────────┘
│ │ │
▼ ▼ ▼
npm install -g Browser OAuth /config menu
@anthropic-ai/ or API key
claude-codeStep-by-Step Procedure
Step 1: Install Claude Code CLI
bash
npm install -g @anthropic-ai/claude-codemacOS/Linux Note
You may need to use sudo depending on your npm configuration:
bash
sudo npm install -g @anthropic-ai/claude-codeStep 2: Verify Installation
bash
claude --versionExpected output: Version number (e.g., 1.0.34)
Step 3: Navigate to Project Directory
bash
cd /path/to/your/projectStep 4: Start Claude Code
bash
claudeStep 5: Complete Authentication
On first run, you'll be prompted to authenticate:
┌─────────────────────────────────────────────────────────────────────┐
│ AUTHENTICATION OPTIONS │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ Option 1: OAuth (Recommended) │
│ ───────────────────────────── │
│ • Browser opens automatically │
│ • Sign in with Google, GitHub, or email │
│ • Free tier: $5 credit included │
│ │
│ Option 2: API Key │
│ ───────────────── │
│ • Set ANTHROPIC_API_KEY environment variable │
│ • Usage billed to your Anthropic account │
│ │
│ Option 3: Enterprise (Claude for Enterprise) │
│ ────────────────────────────────────────────── │
│ • Use your organization's Claude for Enterprise account │
│ • Requires prior enterprise setup │
│ │
└─────────────────────────────────────────────────────────────────────┘Step 6: Verify Connection
After authentication, you should see the Claude Code prompt:
╭─────────────────────────────────────────────╮
│ Claude Code │
│ /path/to/your/project │
╰─────────────────────────────────────────────╯
>Environment Variables
| Variable | Purpose | Required |
|---|---|---|
ANTHROPIC_API_KEY | API authentication | Only if not using OAuth |
CLAUDE_CODE_USE_BEDROCK | Use AWS Bedrock | Optional |
CLAUDE_CODE_USE_VERTEX | Use Google Vertex | Optional |
Verification Checklist
- [ ] Claude Code CLI installed successfully
- [ ]
claude --versionreturns version number - [ ] Authentication completed (OAuth or API key)
- [ ] Claude Code prompt appears in project directory
- [ ] First prompt/response works correctly
Troubleshooting
| Issue | Solution |
|---|---|
| "command not found" | Ensure npm global bin is in PATH |
| Authentication fails | Check internet connection, try again |
| Permission denied | Use sudo for installation (macOS/Linux) |
| Old Node.js version | Upgrade to Node.js 18+ |
Next Steps
- SOP-002: CLI Commands - Learn CLI commands
- SOP-004: Settings - Configure Claude Code