Claude Code Installation & Setup Guide
What is Claude Code
Claude Code is Anthropic’s AI coding CLI tool. It lets you chat with Claude directly in your terminal — reading code, editing files, running commands. It’s the leading agentic coding product.
Installation Demo
Here’s the full installation process recorded (you can scrub the timeline and adjust speed):
Installation Steps
1. Install Claude Code
# Linux / WSL (Recommended)
curl -fsSL https://claude.ai/install.sh | bash
# macOS (Homebrew)
brew install --cask claude-code
# Or via npm (works but won't auto-update)
npm install -g @anthropic-ai/claude-code
The native installer auto-updates in the background to keep you on the latest version.
2. Configure Proxy Service (Optional)
If using a third-party API proxy, edit ~/.claude/settings.json:
{
"effortLevel": "high",
"env": {
"ANTHROPIC_AUTH_TOKEN": "sk-your-api-key-here",
"ANTHROPIC_BASE_URL": "https://fast.sbbbbbbbbb.xyz",
"ANTHROPIC_MODEL": "claude-opus-4-7",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-opus-4-7",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-opus-4-7",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-7",
"CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1"
}
}
💡 Replace
ANTHROPIC_AUTH_TOKENwith your own API key. Once configured, Claude Code routes through the proxy — no official subscription needed.
3. Authentication
# First run will guide you through login
claude
On first launch, it opens a browser for OAuth authentication. Once authorized, you’re all set.
4. Verify Installation
claude --version
claude "Hello, introduce yourself"
Basic Usage
Interactive Mode
# Start an interactive session
claude
# Launch in a project directory (auto-reads project context)
cd my-project
claude
One-shot Commands
# Ask a question
claude "Explain the architecture of this project"
# Have it modify code
claude "Add a debounce function to src/utils.ts"
# Run a task
claude "Run tests and fix any failures"
Configuration
Model Selection
The config file sets the default model to claude-opus-4-7 via environment variables. To switch temporarily:
# Use Opus 4-7 (config default)
claude --model claude-opus-4-7
# Use Opus 4-6
claude --model claude-opus-4-6
Project Configuration
Create .claude/settings.json in your project root:
{
"permissions": {
"allow": ["read", "write", "execute"],
"deny": ["rm -rf /"]
}
}
Common Scenarios
| Scenario | Command Example |
|---|---|
| Explain code | claude "Explain the logic in src/index.ts" |
| Build feature | claude "Implement a user registration API" |
| Fix bug | claude "Tests are failing, please fix" |
| Code review | claude "Review the latest git diff" |
| Refactor | claude "Split this file into modules" |
Tips
- Launch from the project root for best results (reads full project context)
- Supports multi-turn conversations — ask follow-up questions
- It can read/write files and run commands directly — mind the permissions
- Works great with
tmuxfor long-running sessions