Getting Started
brew install --cask claude-code2. Navigate:
cd your-project3. Start:
claude4. Login:
/login (first time only)5. Ask: "what does this project do?"
That's it! You're ready to code with AI.
| Platform | Command |
|---|---|
| macOS (Homebrew) | brew install --cask claude-code |
| npm (All platforms) | npm install -g @anthropic-ai/claude-code |
| VS Code Extension | Search "Claude" in VS Code Extensions |
claude
/login
After login, Claude has full context of your project and is ready to help!
Try these to get comfortable:
> show me the file structure
> what's in the README?
> add a hello world function to index.js
> run the tests
- Code understanding: "Explain how authentication works"
- Feature development: "Add a dark mode toggle"
- Bug fixing: "Fix the login timeout issue"
- Refactoring: "Convert these callbacks to async/await"
- Testing: "Write unit tests for the user service"
- Documentation: "Update the README with API docs"
Essential Commands
| Command | Description |
|---|---|
claude |
Start interactive mode |
claude "task" |
Run a one-time task |
claude -p "query" |
Quick query, then exit |
claude -c |
Continue most recent conversation |
claude -r |
Resume a previous conversation |
claude commit |
Create a Git commit |
| Command | Description |
|---|---|
/help |
Show available commands |
/clear |
Clear conversation history |
/login |
Switch accounts |
/resume |
Resume a previous session |
/rename |
Name your current session |
/stats |
See usage graphs and history |
/tasks |
View running background tasks |
/bug |
Report a bug to Anthropic |
exit or Ctrl+C |
Exit Claude Code |
? |
See keyboard shortcuts |
| Shortcut | Action |
|---|---|
Tab |
Command completion |
โ |
Command history |
Escape |
Interrupt Claude during any phase |
Double Escape |
Jump back in history and edit previous prompt |
Shift+Tab |
Toggle accept all mode |
? |
Show all shortcuts |
Skills - Specialized Commands
Skills are specialized slash commands that give Claude superpowers for specific tasks. Think of them as expert modes - when you need to commit code, review PRs, or convert documents, skills handle the entire workflow for you.
| Skill | Description |
|---|---|
/commit |
Create a smart Git commit with AI-generated message |
/review-pr [number] |
Comprehensive code review of a GitHub pull request |
/pdf [file] |
Convert and interact with PDF documents |
/remember |
Save important context for future sessions |
/commit
# Review a specific PR
/review-pr 123
# Work with PDFs
/pdf document.pdf
> summarize this document
> extract the key findings
Skills can be installed from npm packages or local directories:
claude install @namespace/skill-name
# Install from local directory
claude install ./path/to/skill
# List installed skills
claude list-skills
Common Workflows
> explain the folder structure
> what technologies does this project use?
> where is the main entry point?
> refactor the authentication module to use async/await
> add input validation to the user registration form
> paste error message here - help me fix it
> analyze why the login fails
> update the README with installation instructions
> add inline documentation to this function
> review my changes and suggest improvements
Extensions & Customization
Model Context Protocol (MCP) servers give Claude access to external tools, APIs, and data sources. They're like plugins that extend what Claude can do.
Popular MCP Servers:
- @modelcontextprotocol/server-filesystem - Enhanced file system access
- @modelcontextprotocol/server-github - Deep GitHub integration
- @modelcontextprotocol/server-postgres - Direct database queries
- @modelcontextprotocol/server-brave-search - Web search capabilities
- @modelcontextprotocol/server-slack - Slack workspace integration
# Location: ~/Library/Application Support/Claude/
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "your-token-here"
}
}
}
}
claude settings command or use VS Code's Claude extension settings panel.
Hooks are shell commands that run automatically in response to Claude events. Perfect for running tests, formatters, or custom validations.
Available Hooks:
- onSessionStart - Runs when starting a session
- onToolCall - Runs before/after tool execution
- onFileChange - Runs when files are modified
- onUserPromptSubmit - Runs when you send a message
{
"hooks": {
"onFileChange": {
"command": "npm run format",
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules/**"]
},
"onToolCall": {
"before": {
"Bash": "echo 'Running: $TOOL_ARGS'"
},
"after": {
"Edit": "prettier --write $FILE_PATH"
}
}
}
}
Claude Code integrates with popular editors:
- VS Code: Native extension with inline chat and file context
- Cursor: Built-in Claude integration
- JetBrains: Plugin available for IntelliJ IDEA, PyCharm, etc.
code . && claude
Git Operations
> commit my changes with a descriptive message
> create a new branch called feature/quickstart
> show me the last 5 commits
> help me resolve merge conflicts
> review the changes in this PR
> help me address the review comments
# Or use the skill
/review-pr 123
Pro Tips & Best Practices
Try: "fix the login bug where users see a blank screen after entering wrong credentials"
> 2. create an API endpoint to get and update user profiles
> 3. build a webpage that allows users to see and edit their information
> read the authentication module and explain how it works
CLAUDE.md file in your project root to provide context:
- Project overview and architecture
- Coding standards and conventions
- Dependencies and setup instructions
- Custom commands and workflows
- Important gotchas or common mistakes to avoid
# Claude will enter plan mode, explore your codebase,
# and present a detailed implementation plan for your approval
> now add validation
> add password strength indicator
> now add remember me functionality
Shift+Tab to toggle "accept all" mode when you trust Claude to make multiple changes without reviewing each one. Great for large refactors or formatting changes.
Advanced Features
Claude always asks for permission before modifying files:
- Individual approval: Review each change (default)
- Accept all mode: Auto-approve for current session (Shift+Tab to toggle)
- Sandbox mode: Test commands safely before execution
Claude can spawn specialized agents that work autonomously on specific tasks:
- Explore agent: Deep codebase exploration
- Plan agent: Create implementation strategies
- Task agents: Handle complex multi-step workflows
> create a plan for adding OAuth support
Run long-running commands in the background while continuing to work:
> start the development server in the background
# Check status anytime
/tasks
| Feature | Description |
|---|---|
| Resume sessions | Pick up exactly where you left off with /resume |
| Name sessions | Use /rename to label sessions for easy finding |
| Continue work | Use claude -c to continue most recent conversation |
| Context persistence | Full conversation history maintained across sessions |
Claude Code can use different Claude models for different tasks:
- Sonnet 4.5: Default - balanced speed and capability
- Opus 4.5: Maximum intelligence for complex tasks
- Haiku: Fast responses for simple operations
> use opus for this complex refactoring task
Claude can securely access environment variables and secrets:
DATABASE_URL=postgresql://...
API_KEY=sk-...
# Claude can read these for configuration
> set up the database connection using DATABASE_URL
> test the API using the credentials in .env
- In Claude Code: Type
/helpor ask "how do I..." - Documentation: https://code.claude.com/docs
- Community: Join the Discord at https://www.anthropic.com/discord
- Bug reports: Use
/bugcommand within Claude Code - GitHub: https://github.com/anthropics/claude-code