- Node.js 18+
- Anthropic account (Claude Pro, Max, Teams, or API)
npm install -g @anthropic-ai/claude-codecode --install-extension anthropic.claude-codeOr search "Claude Code" in VS Code Extensions (Anthropic publisher).
VS Code Extension Features:
- Native sidebar panel (Spark icon β¨)
- Plan mode with editing
- Auto-accept edits mode
- File @-mentions and image support
- Multiple simultaneous sessions
- Real-time inline diffs
Requires VS Code 1.98.0+
claudeLogin on first use.
notepad $PROFILE
# Add:
function claude { & "C:\Users\$env:USERNAME\AppData\Roaming\npm\claude.cmd" --dangerously-skip-permissions $args }
# Save, restart terminalclaude --dangerously-skip-permissions| Command | Description |
|---|---|
/help |
Show all commands |
/config |
Open settings |
/permissions |
Manage permissions |
/context |
Check context usage |
/compact |
Compress conversation |
/clear |
Clear conversation |
/plugin |
Manage plugins |
/mcp |
Manage MCP servers |
/model |
Switch models |
/cost |
Show session cost |
/memory |
View/edit memory |
/ide |
Connect to IDE |
/rewind |
Go back to previous state |
Claude Code stores learned preferences in memory. Access with /memory.
# Add to memory during chat
# Use # at start of message to save to memory
# my preferred language is TypeScript# Switch models during session
/model
# Available models (Claude 4.5 Series):
# - claude-sonnet-4-5 (default) - Best coding model
# - claude-opus-4-5 - Most capable, complex reasoning
# - claude-haiku-4-5 - Fastest, cost-effectiveModel Comparison:
| Model | Best For | Speed |
|---|---|---|
| Sonnet 4.5 | Coding, agents, daily tasks | Fast |
| Opus 4.5 | Complex reasoning, research | Moderate |
| Haiku 4.5 | Quick tasks, cost-sensitive | Fastest |
All Claude 4.5 models support hybrid reasoning with two modes:
- Instant responses - Quick answers for simple tasks
- Extended thinking - Deep reasoning for complex problems
Add "ultrathink" anywhere in a skill to enable deep reasoning:
---
name: complex-analysis
description: Deep code analysis with ultrathink
---
Perform thorough analysis using extended thinking...| Flag | Description |
|---|---|
--version |
Check version |
--resume |
Resume last session |
-p "prompt" |
Run with prompt (headless) |
--output-format json |
JSON output |
--mcp-debug |
Debug MCP issues |
--dangerously-skip-permissions |
Bypass prompts |
Create CLAUDE.md in your project root:
# Project: MyApp
## Tech Stack
- Next.js 14, TypeScript, TailwindCSS
- PostgreSQL with Prisma
- Deployed on Vercel
## Coding Standards
- TypeScript strict mode
- ESLint + Prettier
- Tests required for all functions
## Commands
- `npm run dev` - Start dev server
- `npm run test` - Run tests
- `npm run lint` - Lint codeCreate .claude/commands/your-command.md:
---
description: Fix a GitHub issue
---
Analyze and fix GitHub issue: $ARGUMENTS
1. Use `gh issue view $ARGUMENTS` to get details
2. Search codebase for relevant files
3. Implement fix
4. Write tests
5. Commit changesUsage: /your-command 123
Create .claude/skills/my-skill/SKILL.md:
---
name: code-review
description: Review code for best practices
---
When reviewing code:
1. Check for security issues
2. Verify error handling
3. Ensure proper typing
4. Suggest improvementsSkills auto-activate when description matches the task.
Built-in agents for parallel/isolated work:
| Agent | Purpose | Context |
|---|---|---|
Explore |
Read-only codebase exploration | Isolated |
Plan |
Create implementation plans | Isolated |
general-purpose |
Full tool access | Forked |
---
name: research
description: Deep research
context: fork
agent: Explore
---
Research $ARGUMENTS thoroughly...Create in .claude/agents/my-agent.md:
---
name: security-auditor
description: Security-focused code analysis
tools: Read, Glob, Grep
context: fork
---
Audit code for security vulnerabilities:
1. SQL injection patterns
2. XSS vulnerabilities
3. Authentication flaws
4. Secrets exposure
Output as security report with severity ratings.See Agent Collections for 100+ ready-made agents.
# Add MCP server (HTTP transport - new syntax)
claude mcp add --transport http github https://api.githubcopilot.com/mcp/
# Add MCP server (NPX - new syntax)
claude mcp add playwright -- npx @playwright/mcp@latest
# List servers
claude mcp list
# Remove server
claude mcp remove github
# Debug MCP issues
claude --mcp-debugOfficial (HTTP Transport):
claude mcp add --transport http github https://api.githubcopilot.com/mcp/
claude mcp add --transport http notion https://mcp.notion.com/mcp
claude mcp add --transport http sentry https://mcp.sentry.dev/mcpNPX-Based:
claude mcp add playwright -- npx @playwright/mcp@latest
claude mcp add memory -- npx -y @modelcontextprotocol/server-memory
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem "/path"
claude mcp add db -- npx -y @bytebase/dbhub --dsn "postgresql://..."Registry: https://registry.modelcontextprotocol.io
# Install plugin
/plugin install https://github.com/user/plugin
# List plugins
/plugin list
# Remove plugin
/plugin remove plugin-nameHooks are configured in .claude/settings.json using the event-based system:
{
"hooks": {
"PostToolUse": [
{
"matcher": { "tool": "Write", "path": "*.ts" },
"command": "npx eslint --fix $TOOL_INPUT_PATH"
}
],
"PreToolUse": [
{
"matcher": { "tool": "Bash", "command": "git commit*" },
"command": "npm run lint && npm test"
}
]
}
}| Event | When Triggered |
|---|---|
UserPromptSubmit |
Before prompt sent |
PreToolUse |
Before tool runs |
PostToolUse |
After tool completes |
SessionStart |
Session begins |
Stop |
Claude stops |
See Claude Code Resources for more examples.
| Key | Action |
|---|---|
Ctrl+C |
Cancel current action |
Ctrl+B |
Send agent to background |
Esc |
Exit |
Tab |
Autocomplete |
β/β |
History navigation |
# Run single task
claude -p "fix all lint errors" --output-format json
# In CI pipeline
claude -p "run tests and report" --dangerously-skip-permissions- Start with CLAUDE.md - Give project context
- Use /compact - When context gets large
- Create slash commands - For repeated workflows
- Use subagents - For parallel/isolated tasks
- Check /context - Monitor token usage
- Use MCP - For external integrations
npm update -g @anthropic-ai/claude-codeclaude --version- Docs: https://docs.anthropic.com/claude-code
- Best Practices: https://anthropic.com/engineering/claude-code-best-practices
- Awesome List: https://github.com/hesreallyhim/awesome-claude-code
Claude Code settings are stored in:
# Global settings
~/.claude/settings.json
# Project settings
.claude/settings.json
Example settings.json:
{
"permissions": {
"allow": ["Read", "Write", "Bash(npm *)"],
"deny": ["Bash(rm -rf *)"]
},
"env": {
"NODE_ENV": "development"
}
}- Check internet connection
- Verify login:
claude --version - Clear cache:
rm -rf ~/.claude/cache - Restart terminal
- Ensure VS Code 1.98.0+
- Reload window:
Ctrl+Shift+Pβ "Reload Window" - Check for extension updates
# Grant permissions
/permissions
# Or use flag
claude --dangerously-skip-permissions# Debug mode
claude --mcp-debug
# Check server status
claude mcp list- Use
/compactto compress history - Check
/contextfor usage - Start fresh with
/clear