Claude Code is Anthropic's agentic coding tool that runs directly in your terminal.
Claude Code reads your entire project — every file, import, function, and dependency — before writing a single line. This means it understands your architecture, follows your patterns, and generates code that actually fits your codebase rather than generic solutions.
Give Claude Code a task in plain English: 'Add user authentication with JWT tokens' or 'Fix the performance issue in the database query layer.' It breaks the task into steps, writes the code, runs tests, fixes any failures, and presents a complete diff for your review.
Claude Code executes code in your environment, reads error messages, and iterates until tests pass. It can run your test suite, interpret failures, fix the root cause, and re-run tests — the full TDD cycle done autonomously.
Claude Code can read your git history, understand recent changes, create branches, write descriptive commit messages, and even prepare pull request descriptions. It treats your git history as context for understanding the codebase's evolution.
Beyond the terminal, Claude Code integrates directly into VS Code and JetBrains IDEs through official extensions. This brings the full agentic capabilities into your editor alongside GitHub Copilot's line-by-line suggestions.
Claude Code edits multiple files simultaneously to implement a feature correctly. Adding an API endpoint? It updates the route file, controller, model, tests, and documentation in a single coherent operation — no half-finished implementations.
Check your Node.js version first: node --version. You need version 18 or higher. If not installed, download from nodejs.org (LTS version recommended).
Install Claude Code globally:
npm install -g @anthropic-ai/claude-codeVerify installation:
claude --versionIf you get a permissions error on macOS/Linux, use:
sudo npm install -g @anthropic-ai/claude-code or configure npm to use a user-writable directory.Get your API key: go to console.anthropic.com → API Keys → Create key. Copy the key immediately — it is only shown once.
Set it as an environment variable:
# macOS / Linux (add to ~/.zshrc or ~/.bashrc) export ANTHROPIC_API_KEY='sk-ant-api03-...' # Windows PowerShell $env:ANTHROPIC_API_KEY = 'sk-ant-api03-...' # Verify it is set echo $ANTHROPIC_API_KEYNever hardcode your API key in source files. Never commit it to git. Use
.env files with dotenv for project-level keys and add .env to your .gitignore.Open your terminal and navigate to any existing project directory:
cd /path/to/your/project claudeClaude Code launches and automatically scans your project. You will see it read your files and build a structural understanding of your codebase.
Give Claude Code a real task from your backlog. Describe it with full context:
> Add input validation to the POST /api/users endpoint. It should:
> - Reject requests where email is missing or not a valid email format
> - Reject requests where name is shorter than 2 characters
> - Return a 422 status code with a structured error: {field, message}
> - Write 4 unit tests covering: valid input, missing email,
> invalid email format, and name too short
> Use Zod for validation, matching the existing pattern in the codebase.Claude Code reads the existing endpoint, understands the codebase patterns, writes the validation, and creates the tests. It shows you each file change before applying it.Claude Code shows a unified diff of every proposed change before applying it. You always stay in control.
Commands during a session:y or Enter — accept the proposed changen — reject and ask Claude to try a different approachd — show the full diff before decidings — skip this file, continue with others
After accepting changes, run your tests immediately:
npm test # or pytest # or go test ./...If tests fail, tell Claude Code: Tests are failing. Read the error output and fix the root cause without changing the test assertions. Claude reads the failure, traces it to the source, and proposes a fix.
The CLAUDE.md file (placed in your project root) gives Claude Code project-specific instructions it reads at the start of every session — no need to re-explain your stack each time.
# Project: [Name] ## Stack - Node.js 22 + TypeScript strict - Prisma ORM + PostgreSQL - Jest + Supertest for testing - Express 5 with async/await error handling ## File Structure - /src/controllers: route handlers (no business logic) - /src/services: business logic - /src/repositories: database queries (Prisma calls only here) - /tests/unit and /tests/integration ## Standards - All functions: JSDoc with @param @returns - Validation: Zod schemas only (never manual checks) - Errors: throw AppError (from /src/errors/AppError.ts) - Never console.log in production code — use the logger service ## Test Requirements - Every new function needs: happy path + 2 edge cases minimum - Integration tests must not touch production databaseClaude Code reads this file automatically every session.
Before deploying, run a final review pass from within Claude Code:
Review all the changes made today for production readiness. Check: 1) security vulnerabilities (exposed secrets, injection risks, missing auth), 2) missing error handling for edge cases, 3) N+1 query patterns, 4) console.log statements that should be removed, 5) environment variables that need to be documented. Output as a numbered checklist I can work through.
After resolving issues:
# Run full test suite npm test # Check for TypeScript errors npm run typecheck # Lint npm run lint # Stage and commit git add -A git commit -m 'feat(users): add input validation with Zod' git pushAsk Claude Code to write your commit message: Write a conventional commit message for these changes. Format: type(scope): description. Include a body explaining WHY not WHAT.