โšก Install Claude Code CLI

Session 3, Topic 4 | AI-Powered Development Tool

โฑ๏ธ 15 minutes

Your AI Coding Assistant

Claude Code is a command-line tool that lets you have AI-powered conversations about code, generate files, debug problems, and build entire projects - all from PowerShell!

๐ŸŽฏ Learning Objectives

  • Install Claude Code globally using npm
  • Configure Claude Code with your API key
  • Test the installation with a simple project
  • Learn basic Claude Code commands
  • Troubleshoot common installation issues

๐Ÿค” What is Claude Code?

Claude Code is an AI development assistant that runs in your terminal. It combines the power of Claude AI with your local file system.

What Can Claude Code Do?

How It Works:

  1. You type a request in natural language
  2. Claude Code analyzes your project
  3. It generates/modifies code automatically
  4. Files are created/updated on your computer
  5. You review and test the changes

๐Ÿ“ฆ Installation Process

Open PowerShell as Administrator

  • Press Windows + X
  • Press A
  • Click "Yes" for administrator permission

Install Claude Code Globally

Run this single command:

npm install -g @anthropic-ai/claude-code

What happens:

  • npm downloads Claude Code from the internet
  • Installs it globally (-g flag)
  • Makes claude command available everywhere
  • Takes 1-2 minutes

You'll see text scrolling by - this is normal! It shows:

npm WARN deprecated ... added 127 packages in 45s 24 packages are looking for funding

Verify Installation

Check that Claude Code is installed:

claude --version

Expected output:

claude-code version 1.0.0
โš ๏ธ If you see "command not found":
  • Close PowerShell completely
  • Re-open PowerShell as Administrator
  • Try the command again

Start Claude Code for the First Time

Launch Claude Code:

claude

You'll be prompted to enter your API key:

Welcome to Claude Code! Please enter your Anthropic API key:

Configure Your API Key

  1. Open the text file where you saved your API key
  2. Copy the entire key (starts with sk-ant-api03-...)
  3. Return to PowerShell
  4. Right-click to paste (or press Ctrl+V)
  5. Press Enter

๐ŸŽ‰ Success!

You should see: "API key configured successfully!"

Claude Code is now ready to use!

๐Ÿงช Test Your Installation

Create a Test Project

Let's build a simple HTML file to verify everything works:

  1. Make sure you're in your projects folder:
  2. cd Desktop mkdir ClaudeCodeProjects cd ClaudeCodeProjects
  3. Start Claude Code:
  4. claude
  5. Type this request:
  6. Create a simple HTML file called hello.html with a colorful background, centered text that says "Hello from Claude Code!", and a button that shows an alert when clicked.
  7. Watch as Claude Code generates the file!

Review the Generated File

Claude Code will show you the code it created. You can:

  • Review the changes
  • Accept by typing yes or y
  • Reject by typing no or n
  • Request modifications: "Make the background blue"

Test the Generated File

  1. Type exit to leave Claude Code
  2. Open File Explorer and navigate to ClaudeCodeProjects
  3. Double-click hello.html
  4. You should see your working webpage!

๐Ÿ’ฌ Basic Claude Code Commands

Navigation:

File Operations:

Project Operations:

๐Ÿ’ก Pro Tips for Claude Code

  • Be Specific: "Add a dark blue navigation bar at the top" vs "Make it look better"
  • Iterate: Start simple, then add features one by one
  • Review Code: Always check generated code before accepting
  • Use Natural Language: Talk to it like a colleague
  • Save Often: Back up your projects regularly
  • Context Matters: Claude Code can see all files in current folder

๐Ÿ”ง Troubleshooting

Problem: "command not found" after installation

Problem: API key not accepted

Problem: "Insufficient credits" error

Problem: Code generation fails

โœ… Topic Completion Checklist

๐Ÿš€ What's Next?

You now have a fully functional AI development environment! In the next topic, you'll use Claude Code to build a complete custom project that solves a real problem in your coordinator work.

Next Topic: Build Your Custom Project โ†’