Duration: 40 minutes | Level: Beginner
Install Claude Code, authenticate, run your first prompt, and understand the basic interaction model.
npm install -g @anthropic-ai/claude-codeclaude --versionclaude auth loginYou can authenticate with:
- Anthropic API key — direct API access
- Claude Max/Pro subscription — consumer plan usage
- OAuth — enterprise SSO
cd your-project
claudeClaude Code launches in your terminal with an interactive prompt. It sees the working directory and can read/write files, run commands, and interact with git.
npm update -g @anthropic-ai/claude-codeClaude Code updates frequently. Check your version with claude --version and update regularly to get new features and bug fixes.
Claude Code is available in multiple environments:
| Environment | How to access |
|---|---|
| Terminal CLI | claude command in any terminal |
| Desktop App | Mac and Windows native app |
| Web App | claude.ai/code |
| VS Code | Extension from marketplace |
| JetBrains | Plugin from marketplace |
All environments share the same core engine. Key differences:
| Environment | Strengths | Limitations |
|---|---|---|
| Terminal CLI | Most full-featured, scriptable, supports all flags | Text-only interface |
| Desktop App | Native OS integration, easier onboarding | Fewer advanced flags |
| Web App | No install needed, accessible anywhere | Requires internet, no local file access without setup |
| VS Code | Inline in your editor, sees open files | Subset of CLI features |
| JetBrains | Inline in your IDE, project-aware | Subset of CLI features |
The CLI is the reference environment for this course. IDE extensions are useful for quick tasks without leaving your editor.
Claude Code is not a chatbot. It is an agent that:
- Reads your codebase
- Plans changes
- Edits files directly
- Runs commands (with your permission)
- Iterates until the task is done
You give it tasks, not questions. Instead of "How do I add a login page?", say "Add a login page with email/password using NextAuth."
Claude Code asks for permission before taking actions. You control how strict this is:
| Mode | Behavior |
|---|---|
| default | Asks for most file writes and all shell commands |
| auto | Allows reads, writes, and safe commands automatically |
| bypassPermissions | No prompts (use with caution) |
| plan | Requires plan approval before implementation |
Set at launch:
claude --permission-mode planOnce inside Claude Code, try these:
| Command | What it does |
|---|---|
/help |
Show available commands |
/status |
Show current session info |
/model |
Switch the model |
/clear |
Clear conversation context |
/compact |
Compress conversation to save context |
Ctrl+C |
Cancel current operation |
Escape |
Exit Claude Code |
- Open a terminal and navigate to any project directory
- Run
claude - Type:
What files are in this project? Give me a brief summary. - Observe how Claude reads the directory and responds
- In Claude Code, type:
Create a file called hello.txt with a greeting - Approve the file write when prompted
- Check that the file was created:
cat hello.txt - Delete the file:
rm hello.txt
- Exit Claude Code (Escape)
- Restart with:
claude --permission-mode plan - Ask Claude to make a change — notice it creates a plan first
- Approve or reject the plan
When you open Claude Code in a cloned repository, it may contain .claude/settings.json with pre-configured permissions, hooks, and MCP servers. Always review these before trusting a project:
cat .claude/settings.json # Check what permissions the project requests
cat .mcp.json # Check what MCP servers it configuresA malicious project could configure hooks or settings that execute arbitrary commands. Claude Code shows a trust prompt for new projects -- read it carefully.
- Never put API keys in
CLAUDE.mdorsettings.json(both may be committed to git) - Use
settings.local.json(gitignored) or system environment variables for secrets - Use the
envfield in MCP configs for connection strings, not hardcoded values
- Start with restrictive permissions and expand as needed
- Read permission prompts before approving, especially for shell commands
- Use
--permission-mode planwhen working with unfamiliar code
- Running Claude outside a project directory: Claude works best when launched from a project root with meaningful code. Running it from
~gives it no context. - Not reading the permission prompts: Always read what Claude wants to do before approving, especially shell commands.
- Treating it like ChatGPT: Give tasks and instructions, not open-ended questions.
- Claude Code is an agent that operates on your codebase, not a chatbot
- Always launch from your project directory
- Permission modes let you control how much autonomy Claude has
- The CLI is the most full-featured environment