Getting Started with Claude Code
Install Claude Code, configure your project, and run your first session.
1. Install Claude Code
Claude Code is a CLI tool that runs in your terminal. Install it with one command:
curl -fsSL https://claude.ai/install.sh | bash
Alternative methods:
brew install claude-code(macOS)npm install -g @anthropic-ai/claude-code(Node.js)
You will need a Claude.ai Max subscription or an Anthropic API key (via Claude Console) to authenticate.
2. First Run
Navigate to any project directory and type claude to start an interactive session:
cd my-project
claude
Claude will analyze your project structure and begin an interactive conversation. Try these first commands:
give me an overview of this codebase
what does @src/index.ts do?
3. Configure CLAUDE.md
Create a CLAUDE.md file in your project root to give Claude persistent context. You can auto-generate one:
/init
Or create it manually with the essentials:
# Project: MyApp
## Build & Test
- npm run dev # start dev server
- npm test # run tests
- npm run lint # lint check
## Architecture
- React 18 + TypeScript frontend
- Express API at /api/v1
- PostgreSQL via Prisma ORM
## Conventions
- Functional components with hooks
- Named exports, kebab-case files
- Tests colocated in __tests__/
Keep it concise. For every line, ask: if I remove this, will Claude make a mistake? If not, remove it. See the CLAUDE.md deep guide for advanced patterns.
4. Custom Slash Commands
Define reusable commands in .claude/commands/:
# .claude/commands/review.md
Review the current changes for:
- Potential bugs and edge cases
- Security vulnerabilities
- Performance issues
Suggest fixes inline.
Then invoke with /review in any session. Commands are auto-discovered.
5. Understand Permissions
Claude Code uses a three-level permission system for tool use:
- Allow — Tool runs automatically (e.g., reading files)
- Ask — Claude requests your approval before running (default for writes)
- Deny — Tool is blocked entirely
Use Shift + Tab to cycle between Normal, Auto-accept, and Plan Mode. See Plan Mode for read-only exploration.
Why does CLAUDE.md matter so much?
Context configuration is a core agent-development skill. Understanding how LLMs handle the context window explains why a concise, well-structured CLAUDE.md dramatically improves output quality.
Learn context window fundamentals in Agent BasicsNext Steps
- Keyboard Shortcuts — Master the CLI shortcuts
- CLAUDE.md Guide — Advanced context configuration
- Plan Mode — Safe read-only exploration