Getting Started with Claude Code: Install to First PR
Install Claude Code, sign in, run your first session, set up CLAUDE.md, learn the essential slash commands and adopt the habits that get reliably good results.
By Claudekit Team Published 12 min read
Claude Code is Anthropic’s agentic coding tool. Unlike a chat window, it works inside your project: it reads files, runs commands, edits code and works through problems while you watch or redirect. This guide takes you from zero to a productive first session, with every command checked against the official docs as of October 2026.
Before you begin
You need:
- a terminal and a code project;
- one of: a Claude Pro, Max, Team or Enterprise subscription, a Claude Console account (API credits), or access through Amazon Bedrock, Google Cloud’s Agent Platform or Microsoft Foundry.
System requirements: macOS 13.0+, Windows 10 1809+ (or Server 2019+), Ubuntu 20.04+, Debian 10+ or Alpine 3.19+, with 4 GB+ RAM and an internet connection.
Not a terminal person? Claude Code also runs as a desktop app, in VS Code and JetBrains IDEs, and on the web at claude.ai/code. The concepts below apply everywhere.
Step 1: Install Claude Code
Native installer (recommended, auto-updates):
# macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash
# Windows PowerShell
irm https://claude.ai/install.ps1 | iex
Package managers (no auto-update):
brew install --cask claude-code # macOS (stable channel)
winget install Anthropic.ClaudeCode # Windows
npm (needs Node.js 22+):
npm install -g @anthropic-ai/claude-code
Don’t use sudo npm install -g. Open a new terminal and confirm:
claude --version
If the shell says claude isn’t found, the install directory isn’t on your PATH yet; our Claude Code install guide covers PATH fixes, Windows options, updates and uninstalling. On native Windows, installing Git for Windows lets Claude Code use its Bash tool; otherwise it uses PowerShell.
Step 2: Start your first session and sign in
cd /path/to/your/project
claude
On first run, Claude Code prompts you to log in through your browser. Credentials are stored, so you only do this once. Use /login later to switch accounts.
The prompt shows the version, current model and working directory. Type /help to see available commands.
Step 3: Ask about your codebase
Start read-only. Claude reads files as needed; you don’t have to paste them.
what does this project do?
where is the main entry point, and how does a request flow through the app?
explain the folder structure
This is also a good way to onboard onto an unfamiliar repo.
Step 4: Make your first change
add input validation to the user registration form
Claude finds the right files, proposes the edit and, depending on your permission mode, asks before applying it. Choose Yes to approve. For one feature taken all the way from question to pull request, follow our Claude Code tutorial.
Permission modes
Press Shift+Tab to cycle modes. The status bar shows the active one. From v2.1.283, interactive terminal and VS Code sessions start in Auto mode when nothing else sets a mode and auto mode is available; claude -p runs start in Manual.
| Mode | Config value | What Claude does without asking |
|---|---|---|
| Manual | default | Reads only; asks before edits, commands and network |
| Accept edits | acceptEdits | Edits files without asking |
| Plan | plan | Researches and proposes a plan; no edits |
| Auto | auto | Uses a safety classifier to approve or deny actions (where available) |
There is also bypassPermissions, which skips prompts entirely; reserve it for isolated environments. Fine-grained allow/ask/deny rules live in /permissions; the permission modes guide covers every mode, including auto mode.
Step 5: Use git conversationally
what files have I changed?
commit my changes with a descriptive message
create a new branch called feature/registration-validation
Step 6: Create a CLAUDE.md
CLAUDE.md is the file Claude reads at the start of every session in that project (our CLAUDE.md guide has templates for five stacks). Generate a starter:
/init
Claude analyses the codebase and writes build commands, test instructions and conventions it discovers. If a CLAUDE.md exists, /init suggests improvements instead of overwriting.
Then edit it down. A good CLAUDE.md:
- lists commands Claude can’t guess (
pnpm test:unit,make dev-db); - states conventions that differ from defaults (“use Bun, not npm”);
- notes architecture decisions and gotchas;
- stays under about 200 lines, the official target, because longer files reduce adherence.
# Project notes
## Commands
- Dev server: `pnpm dev`
- Unit tests: `pnpm test:unit` (run before every commit)
- Typecheck: `pnpm typecheck`
## Conventions
- TypeScript strict mode; no `any`
- API handlers live in `src/server/routes/`, one file per resource
- Use the `logger` helper, never `console.log`
## Gotchas
- The `legacy/` folder is frozen; don't edit it
Where the different memory files go:
| File | Scope |
|---|---|
./CLAUDE.md | Project, shared with the team via git |
./CLAUDE.local.md | Project, personal (add to .gitignore) |
~/.claude/CLAUDE.md | All your projects |
.claude/rules/*.md | Topic-specific rules, optionally scoped to file paths |
You can import other files with @path, for example See @README for an overview. Run /memory to edit these files and manage auto memory.
Step 7: Learn the essential commands
Shell commands
| Command | What it does |
|---|---|
claude | Start an interactive session |
claude "task" | Start with an initial prompt |
claude -p "query" | Run once non-interactively and exit (scripts, CI) |
claude -c | Continue the most recent conversation in this directory |
claude -r | Resume a previous conversation from a list |
Slash commands
| Command | What it does |
|---|---|
/help | Show available commands |
/init | Create or improve CLAUDE.md |
/clear | Start a new conversation with empty context |
/compact [instructions] | Summarise the conversation to free context |
/context | Visualise what’s using your context window |
/model | Switch model (and effort level, where supported) |
/plan [task] | Enter plan mode |
/rewind | Restore conversation and/or code to a checkpoint |
/resume | Pick up an earlier session |
/permissions | Manage allow, ask and deny rules |
/mcp | Manage MCP server connections and sign-in |
/hooks | View configured hooks |
/plugin | Browse and install plugins |
/usage | Session cost, plan limits and activity (/cost is an alias) |
/doctor | Diagnose setup issues and propose fixes |
/code-review | Review the current diff (alias /review) |
/btw [question] | Ask a side question without adding it to history |
Type / at any time to see everything available, including your own skills. For the full list, see our Claude Code slash commands cheatsheet.
Step 8: Work the way experienced users do
These habits come straight from Anthropic’s Claude Code best-practices guide; our Claude Code best practices page covers 20 of them in depth.
Give Claude a way to verify its work
The biggest single improvement. Instead of “implement email validation”, say: “write a validateEmail function; user@example.com is valid, user@.com is not; write tests and run them”. With a pass/fail signal, Claude iterates until the check passes rather than stopping when the work merely looks done.
Explore, plan, implement, commit
- Explore in plan mode (
Shift+Tabuntil “plan mode on”, orclaude --permission-mode plan): “read /src/auth and explain how sessions work”. - Plan: “I want to add Google OAuth. What files change? Create a plan.” Press
Ctrl+Gto edit the plan in your editor. - Implement: approve the plan and let Claude code and run tests.
- Commit: “commit with a descriptive message and open a PR”.
Skip the plan for changes you could describe in one sentence.
Be specific
“Fix the login bug where users see a blank screen after entering wrong credentials” beats “fix the bug”. Point at files, paste error messages, include screenshots for UI work.
Manage context
/clearbetween unrelated tasks./compact Focus on the API changesto summarise with a focus. The context management guide explains when to use each.- Delegate investigations to subagents: “use subagents to investigate how token refresh works”. See the subagents guide.
- If you’ve corrected Claude twice on the same issue,
/clearand restart with a better prompt.
Course-correct early
Press Esc to stop Claude mid-action (context is kept). Press Esc twice or run /rewind to roll back. Checkpoints only cover edits made through Claude’s file tools, not Bash side effects, so git is still your safety net.
Step 9: Extend Claude Code
Once the basics feel natural, build your Claude kit:
- Skills for procedures you repeat.
- Subagents for isolated, specialised work.
- Hooks for things that must happen every time.
- MCP servers to connect GitHub, docs, browsers and databases.
- Plugins to install or share bundles of the above.
Track spend with /usage (our Claude Code pricing guide explains plans and limits), and analyse usage over time with ccusage. Wondering how it stacks up against an AI editor? Read Claude Code vs Cursor. And sharpen your requests with our Claude prompting best practices.
Troubleshooting quick reference
claude: command not found: open a new terminal; check yourPATH.- Install fails with a 403 or HTML error: see the official install troubleshooting page for alternatives.
- Something feels off: run
/doctorin a session, orclaude doctorin your shell for read-only diagnostics. More answers in the Claude Code FAQ. - Claude ignores
CLAUDE.mdrules: shorten the file, remove contradictions, or convert must-follow rules into hooks.
Frequently asked questions
Do I need a paid plan to use Claude Code?
You need one of: a Claude Pro, Max, Team or Enterprise subscription, a Claude Console account with API credits, or access through Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry.
Does Claude Code need Node.js?
Not with the native installer, Homebrew or WinGet. Only the npm install method needs Node.js 22 or later, and even then the installed binary doesn't use Node at runtime.
Can I use Claude Code outside the terminal?
Yes. Claude Code is also available as a desktop app, VS Code and JetBrains extensions, on the web at claude.ai/code, in Slack, and in CI through GitHub Actions.
How do I undo something Claude did?
Press Esc twice or run /rewind to restore the conversation, the code or both to an earlier checkpoint. Checkpoints only track edits made through Claude's file tools, not Bash commands, so keep using git.