Getting started with Claude Code
A good first Claude Code session is not just installation. It includes choosing the right surface, opening a real repository, giving project context, and verifying the result with the same commands a developer would use.
- Last verified
- Applies to
- Claude Code 2.1.x. CLI spellings were checked on local version 2.1.198; current official docs may describe newer 2.1.x behavior.
- Verification method
- Official documentation, CLI reference, and changelog reviewed on 2026-07-19. CLI entry points were checked locally; prompts, model output, and project tests are repository-dependent and are not claimed as pre-run.
- Official sources
- QuickstartCLI referenceChangelog
Reproducible practice
Complete one bounded change with an evidence trail
Use a small repository task to learn exploration, planning, editing, verification, and review without granting broad automation first.
Prerequisites
- A trusted repository with a clean or understood git status.
- A working Claude Code login and known project test command.
- A task with one observable outcome, such as one failing test or one validation rule.
Steps
Record the baseline
Preserve existing changes and identify the project commands before opening a session.
Step 1 git status --short git diff --checkStart with read-only planning
Ask for relevant files, the smallest change, risks, and the exact verification command.
Step 2 claude --permission-mode planApprove a narrow implementation
Review the plan, switch out of plan mode only when the file scope and acceptance check are correct, then request the bounded change.
Verify outside the narrative
Run the repository test and inspect the actual diff rather than accepting a success summary.
Step 4 git diff --check git diff --stat # Run the project-specific targeted test here
Expected result
The requested behavior changes, unrelated files remain untouched, and the named project check passes or yields a concrete first failure.
Validation
- Compare the final diff with the original acceptance condition.
- Run at least one targeted test or build command owned by the repository.
- Check git status so generated or unexpected files are visible.
Failure handling
Plan is generic
Ask Claude to cite exact files and existing test commands before allowing edits.
Test fails elsewhere
Separate baseline failures from regressions by reproducing the same command against the pre-change state when safe.
Cleanup or rollback
- Reject or manually revert only the task-specific hunks after reviewing them; do not erase unrelated working-tree changes.
- Keep the failing command and first actionable error when handing the task back for another attempt.
Boundaries and when not to use it
- Do not use a production repository as a first exercise when tests, ownership, or rollback are unclear.
- Plan mode reduces write risk but does not replace repository backups, review, or permission policy.
Choose the surface
Claude Code is available across terminal, IDE, desktop, browser, and related development workflows. The terminal is direct and scriptable; IDE integrations help with local code editing; desktop and browser surfaces help when you want visual review, parallel sessions, or remote work.
Terminal and CLI
Best for scripting, pipes, SSH, and repository-wide automation.
Read guideIDE integration
Best for selected-code edits, inline diffs, and editor navigation.
Read guideDesktop and web
Best for parallel sessions, GUI review, and cross-device handoff.
Read guideChrome
Best for live browser reproduction, console debugging, and UI QA.
Read guideStart in a real project
Open the repository before starting the session. Ask Claude Code to inspect the package manager, framework, test runner, build command, and key directories. This avoids generic advice and lets it ground later edits in the actual codebase.
Create durable project context
Use repository instructions for facts that should persist: architecture boundaries, coding conventions, test commands, deployment notes, and review rules. Durable context is more reliable than restating the same setup in every prompt.
Keep context factual
Write rules that can be checked in code: command names, package paths, naming rules, and known constraints.
Read guideAvoid vague preferences
Replace broad requests such as 'write clean code' with concrete standards for this repository.
Read guideVerify the first task
Pick a small task with an observable result, such as fixing a failing test, explaining a module, adding one validation rule, or updating a narrow component. Ask Claude Code to run the project command that proves the result.
Follow a workflow
Use explore → plan → verify → review for the first change.
Read guideReview the diff
Run /diff or /code-review before treating work as done.
Read guideSession continuity
Continue the same thread with -c when iterating on the first task.
Read guideInstall and authenticate
Install the CLI with the native installer, Homebrew, or WinGet, then sign in before repository work. If setup looks correct but sessions fail, use doctor-style checks instead of guessing at project config.
curl -fsSL https://claude.ai/install.sh | bash
claude auth login
claude auth status --textcd my-project
claude "Explain the build, test, and deploy commands for this repo."Full install guide
See the setup page for platform requirements, Homebrew, WinGet, updates, and uninstall steps.
Read guideAuthentication options
Compare Claude.ai login, Console, cloud providers, and CI tokens before team rollout.
Read guideGenerate memory early
After opening the repo, run /init and refine CLAUDE.md before broad edits.
Read guideBefore you continue
Confirm the surface
Decide whether the first session should run in the terminal, IDE, desktop app, or browser based on the task.
Read guideRecord project facts
Save commands, architecture notes, and constraints in project memory before asking for broad edits.
Read guidePick a verifiable task
Start with a small change that can be checked with one build, test, lint, or manual path.
Read guideRun /init early
Generate a starter CLAUDE.md, then refine it with /memory before large edits begin.
Read guide