Getting Started with Claude Code

May 2, 2026

Claude Code is Anthropic's official terminal CLI for Claude. It runs in your shell, edits files in place, executes commands, and integrates with your existing dev tooling. Unlike copy-paste-from-a-chat workflows, Claude Code can iterate on a real codebase: read your files, run your tests, and commit when something works.

This guide is the shortest path from zero to a productive workflow.

Install

Install via npm:

npm install -g @anthropic-ai/claude-code

Then authenticate:

claude

The first run prompts you to log in. Once authenticated, your session persists.

The mental model that matters

Treat Claude Code as a junior engineer with infinite patience and your full repo access. That framing changes how you prompt:

  • Don't dictate every step. Describe the goal and the constraints.
  • Reference real files. Paste paths, function names, line numbers — anything that anchors the model in your codebase.
  • Push back. If the first attempt is wrong, say what's wrong specifically. Don't restart from scratch.

A real workflow

Here's the loop most experienced users settle into:

Step 1: Plan before code

Before touching files, ask Claude to outline the change. "Read these three files and tell me where the auth check lives" beats "fix the auth bug" by a wide margin.

Step 2: Make small, reviewable diffs

Ask for one slice at a time. A 50-line diff you actually read is worth more than a 500-line diff you skim.

Step 3: Run the thing

After every change, run the test suite or the dev server. Claude Code can do this for you — and it will see the output, which is the whole point.

When to reach for an Agent

Claude Code's main loop is one model holding the full conversation. For independent searches ("find every place we call getUser") or for protecting your context window from a 2000-line file dump, spawn a subagent. The Explore agent in particular is great for read-only investigation.

Common pitfalls

  • Vague prompts. "Make this better" produces nothing useful. "Reduce the bundle size of src/app/page.tsx, target under 150kb gzipped" produces a real diff.
  • Skipping the verification step. A green test suite is the only thing that confirms a fix works. Trust the suite, not the model's confidence.
  • Letting the context bloat. Long sessions accumulate noise. Start fresh sessions for unrelated tasks.

Next steps

The official docs cover slash commands, hooks, and MCP integrations in detail — those are where the real productivity gains compound. Bookmark them and come back as you grow into the tool.