Claude Code transforms how you write software by providing an intelligent AI pair programmer right in your terminal. This guide gets you from zero to productive in 2 hours, covering everything from initial setup through building your first feature with AI assistance.
Before starting, ensure you have:
Node.js 18+ installed (download )
Git configured on your system
A code editor (VS Code, Cursor, or JetBrains IDE recommended)
An active project to work with
By the end of this guide, you’ll be able to:
Install and configure Claude Code for optimal performance
Navigate the PRD → Plan → Todo workflow methodology
Use deep reasoning modes for complex architectural decisions
Integrate MCP servers for extended capabilities
Build, test, and deploy features with AI assistance
Collaborate effectively using Claude’s Git integration
Install Claude Code globally
The recommended installation method uses npm:
npm install -g @anthropic-ai/claude-code
For macOS and Linux users, avoid using sudo
as it can lead to permission issues. If you encounter errors, see the troubleshooting section.
Windows users have two options:
WSL (recommended) : Install within WSL 1 or WSL 2
Native with Git Bash : Requires Git for Windows installed
For native Windows:
$env:CLAUDE_CODE_GIT_BASH_PATH = " C:\Program Files\Git\bin\bash.exe "
Verify installation
Navigate to your project directory and start Claude Code:
You should see the Claude Code welcome message and interactive prompt.
Choose your authentication method
Claude Code offers three authentication options:
For API usage and billing
Connect through the Anthropic Console
Complete the OAuth process
Requires active billing at console.anthropic.com
This is ideal for developers who want direct API access and usage-based billing.
Unified subscription (recommended for individuals)
Subscribe to Claude’s Pro or Max plan
Get Claude Code + web interface in one subscription
Better value for individual developers
Log in with your Claude.ai account
For teams using cloud providers
Configure for Amazon Bedrock or Google Vertex AI
Use existing cloud infrastructure
Ideal for corporate environments
See the enterprise deployment guide for detailed setup.
Test your setup
Run a simple command to verify everything works:
> create a hello.js file that prints " Hello from Claude Code! "
Claude should create the file and show you the changes.
Now let’s configure Claude Code for optimal productivity.
Claude Code’s permission system balances safety with efficiency. Choose your preferred mode:
Claude asks permission for each file modification and command. This is the safest option for beginners.
# No special configuration needed
For experienced users who want uninterrupted workflow:
claude --dangerously-skip-permissions
This mode bypasses all permission prompts. Claude can edit files and run commands without asking. Use this only in trusted environments or containers.
A middle ground - automatically accepts file edits but still prompts for commands:
claude --permission-mode acceptEdits
Claude Code uses intelligent model selection by default:
Claude Opus 4 : For complex reasoning and architecture (until 50% usage)
Claude Sonnet 4 : For implementation and simpler tasks (cost-efficient)
You can override the default:
# Or configure in settings
Install the Claude Code extension
The extension auto-installs when you run claude
from the integrated terminal.
Features:
Quick launch with Cmd+Esc
(Mac) or Ctrl+Esc
(Windows/Linux)
Diff viewing in IDE
File reference shortcuts
Diagnostic sharing
Install the Claude Code plugin from the marketplace:
Open Settings → Plugins
Search for “Claude Code”
Install and restart your IDE
For remote development, install on the remote host.
Configure terminal for optimal experience
Run this command to set up proper key bindings:
This enables:
Shift+Enter
for multiline input
Proper escape sequences
Better clipboard handling
Claude Code uses CLAUDE.md
files to maintain project context across sessions. This is crucial for consistent, high-quality assistance.
Generate initial CLAUDE.md
Claude analyzes your project and creates a tailored CLAUDE.md
file containing:
Project structure overview
Common commands
Detected frameworks and tools
Coding standards
Customize for your needs
Edit the generated CLAUDE.md
to include:
This is a Next.js e-commerce application using TypeScript and Tailwind CSS.
- `npm run dev` - Start development server
- `npm run build` - Build for production
- `npm test` - Run test suite
- `npm run lint` - Check code quality
- Use functional components with hooks
- Implement proper TypeScript types (no `any` )
- Follow Airbnb ESLint rules
- Write tests for all new features
- Components in /components with .tsx extension
- Use server components by default
- Client components only when needed
Use the # shortcut for quick updates
As you work, quickly add memories:
> # Always use Prisma for database queries, never raw SQL
Claude prompts you to select which memory file to update.
This is the heart of effective Claude Code usage - a systematic approach to building features.
Why start with a PRD? Clear requirements lead to better implementations. Claude excels when given specific context and goals.
Create a feature PRD
> Create a PRD for a user authentication system with email/password
> login, registration, password reset, and session management
Claude generates a comprehensive PRD including:
User stories
Technical requirements
API endpoints
Database schema
Security considerations
Refine the requirements
Review and adjust the PRD:
> Add OAuth support for Google and GitHub to the auth PRD
> Include rate limiting requirements for security
Store in project memory
> Save this PRD to docs/features/authentication.md
> # This project uses JWT tokens with 24-hour expiry
Claude’s thinking modes unlock powerful architectural planning:
For typical features:
> Create a detailed implementation plan for the authentication system
For complex architectural decisions:
> Think hard about the best approach for implementing secure
> session management that scales to 1M users
This triggers ~5,000 tokens of reasoning.
For critical system design:
> Ultrathink about migrating our monolithic auth to microservices
> while maintaining backward compatibility
This can use up to 128,000 tokens for extensive analysis.
Example planning session:
> Based on our authentication PRD, think deeply about the
> implementation approach. Consider:
> - Security best practices
Claude will:
Analyze the requirements
Consider multiple approaches
Evaluate trade-offs
Recommend a specific implementation plan
Identify potential challenges
Transform plans into actionable tasks:
Generate structured todos
> Convert the authentication plan into a detailed todo list
> with subtasks and dependencies
Claude creates:
## Authentication Implementation Tasks
- [ ] Create users table with email, password_hash, created_at
- [ ] Add indexes for email (unique) and created_at
- [ ] Create sessions table with user_id, token, expires_at
- [ ] Write migration scripts
- [ ] POST /api/auth/register
- [ ] Password hashing with bcrypt
- [ ] Email uniqueness check
- [ ] POST /api/auth/login
- [ ] Validate credentials
- [ ] Set secure HTTP-only cookie
Execute tasks systematically
> Let ' s start with task 1 - create the database schema
Claude:
Creates the schema files
Writes migrations
Shows you the changes
Waits for approval
Track progress
> Mark database setup as complete and move to API endpoints
Continue through the todo list, with Claude maintaining context and checking off completed items.
MCP (Model Context Protocol) servers extend Claude’s capabilities with external tools.
Enhanced file operations
"args" : [ " -y " , " @modelcontextprotocol/server-filesystem " , " . " ]
Enables advanced file searching and bulk operations.
Repository integration
"args" : [ " -y " , " @modelcontextprotocol/server-github " ],
"GITHUB_TOKEN" : " ${GITHUB_TOKEN} "
Access issues, PRs, and repository data.
Library documentation
"args" : [ " -y " , " @context7/mcp-server " ]
Get up-to-date documentation for any library.
Create MCP configuration
Add to .claude/mcp.json
in your project:
"args" : [ " -y " , " @modelcontextprotocol/server-filesystem " , " . " ]
"args" : [ " -y " , " @modelcontextprotocol/server-github " ],
"GITHUB_TOKEN" : " ${GITHUB_TOKEN} "
Verify MCP connections
This shows:
Connected servers
Available tools
Authentication status
Authenticate if needed
Some servers require OAuth:
# Select "Authenticate" for servers requiring it
Let’s build a real feature using Claude Code:
Start with requirements
> We need a user profile page that shows:
> - User information ( name, email, avatar )
> Plan the implementation but don ' t write code yet
Create the feature branch
> Create a new git branch called feature/user-profile
Implement the UI
> Create a UserProfile component using our design system
> Follow the mockup in designs/user-profile.png
Claude:
Analyzes the design
Creates component structure
Implements with your framework
Uses proper styling
Add data fetching
> Implement the API route to fetch user profile data
> Include proper error handling and loading states
Write tests
> Write comprehensive tests for the UserProfile component
> Include unit tests and integration tests
Fix any issues
> Run the tests and fix any failures
Claude iterates until all tests pass.
Commit and push
> Commit all changes with a descriptive message and push
Claude excels at debugging:
> TypeError: Cannot read property ' name ' of undefined at UserProfile.tsx:34
Claude will:
Analyze the error context
Identify the root cause
Implement a fix
Add defensive code to prevent recurrence
Update tests if needed
Claude Code provides sophisticated Git integration:
> What files have I changed ?
# Claude runs git status and summarizes
> Commit these changes with a descriptive message
# Claude analyzes changes and writes commit message
> The auth changes should be a separate commit
# Claude creates multiple logical commits
> Create a pull request for this feature
# - Pushes current branch
# - Creates PR with comprehensive description
# - Adds reviewers if configured
> Help me resolve these merge conflicts
# - Shows conflicts clearly
# - Preserves intended functionality
# - Runs tests after resolution
If you have gh
CLI installed:
> What are the open issues labeled ' bug ' ?
> Implement a fix for issue #234
> Create a PR that fixes #234
Create reusable commands in .claude/commands/
:
Example: .claude/commands/test-component.md
Please create comprehensive tests for: $ARGUMENTS
- Use React Testing Library
- Test all props variations
- Include accessibility tests
- Mock external dependencies
Usage:
> /test-component UserProfile
Configure in .claude/settings.json
:
"command" : " prettier --write \" $CLAUDE_FILE_PATHS \" "
This automatically formats files after Claude edits them.
Work on multiple features simultaneously:
git worktree add ../feature-auth auth-feature
git worktree add ../feature-profile profile-feature
Each Claude instance works independently without conflicts.
> Fix the authentication bug where users can ' t log in with
> special characters in passwords
> Improve the UserList component performance by implementing
> virtual scrolling for lists over 100 items
> Add unit tests for the calculateTax function covering all
> tax brackets and edge cases
Clear between unrelated tasks
Use focused queries
# Instead of: "analyze the entire codebase"
> Analyze the authentication module in src/auth/
Reference specific files
> Explain how @src/utils/validation.ts works
Never include secrets in CLAUDE.md or prompts
Use environment variables for sensitive data
Review commits before pushing
Be cautious with database operations
Validate AI-generated security code
Task Command Start new feature > Create a plan for [feature description]
Fix a bug > [paste error] Fix this error
Write tests > Write tests for @src/components/Button.tsx
Refactor code > Refactor the auth module to use hooks
Update docs > Update the README with the new API changes
Code review > Review my changes and suggest improvements
Git operations > Create a PR for this feature
If you see npm permission errors:
This moves Claude Code to ~/.claude/local/
Debug MCP problems:
Check server logs and configuration.
For files over 10k lines, focus on specific sections:
> Analyze the authentication logic in @large-file.js#L1000-L1500
Now that you’ve mastered the basics:
Explore advanced techniques in the tips & tricks section
Set up team workflows with shared CLAUDE.md and commands
Build custom MCP servers for your specific tools
Join the community to share experiences and learn from others
Remember: Claude Code is your AI pair programmer. The more context and clarity you provide, the better it can assist you. Start with simple tasks and gradually tackle more complex challenges as you build confidence.
Pro tip : Keep iterating on your CLAUDE.md file. The better you document your project’s patterns and preferences, the more consistent and helpful Claude becomes.