A lot of devs fire up Claude Code for the first time, drop in a vague prompt, and bail five minutes later thinking it's nothing special. The trick is treating it less like a search box and more like a capable pair programmer: it actually inspects your codebase on the fly, and things really click once you know the core commands and how permissions work. Here is a practical walk-through to get you from install to shipping actual code, with a few deep-dive references when you want to take things further.

  • Install (macOS/Linux/WSL): curl -fsSL https://claude.ai/install.sh | bash

  • Install (Windows PowerShell): irm https://claude.ai/install.ps1 | iex

  • Check version: claude --version

  • Jump in: cd your-project then claude

  • Set team/project rules: CLAUDE.md in your project root

  • Cycle permission modes: Shift+Tab

Installing Claude Code

For macOS, Linux, and WSL, grabbing the native installer via curl -fsSL https://claude.ai/install.sh | bash is your cleanest bet. If you're on Windows, open up PowerShell and run irm https://claude.ai/install.ps1 | iex (if it complains that 'irm' is not recognized, you accidentally opened classic CMD instead of PowerShell). The nice perk with native installs is that background updates happen on their own - no manual upgrade commands to juggle.

If package managers are more your style, you can grab it with Homebrew (brew install --cask claude-code), WinGet (winget install Anthropic.ClaudeCode), or your distro's apt, dnf, or apk. Just keep in mind that package manager builds won't self-update, so remember to run brew upgrade claude-code or winget upgrade Anthropic.ClaudeCode every so often.

Either way, verify everything went smoothly by running claude --version. You should see a version string ending with (Claude Code).

One quick tip for Windows users: install Git for Windows upfront so the tool can lean on its built-in Bash environment. If you skip this, it drops back to PowerShell, which works fine overall but occasionally handles shell quirks and piping slightly differently.

Logging In and Starting Your First Session

Head into your project's directory and type claude. On your first run, it pops open a browser window to authenticate with your Claude Pro, Max, Team, Enterprise, or Console account. If you already export an ANTHROPIC_API_KEY in your shell profile, it bypasses the browser flow entirely and just asks for a quick confirmation to use that key.

Your credentials get stored locally after that initial handshake, meaning you won't have to log in every single time you spin up a prompt on that machine. If you ever need to hop between accounts or refresh your token, just punch in /login right inside your active session.

Once you land in the interactive prompt, you'll see your active model and working directory pinned right above the prompt. If you want a quick cheat sheet of what's possible, type /help, or fire up /resume whenever you want to pick up right where an earlier discussion left off.

Your First Project: Exploring, Editing, and Committing

A great first move is simply asking Claude to get its bearings. No complicated prompt templates or rigid formats are required; just ask what you'd ask an onboarding dev:

Plaintext

code3 lines
what does this project do?
where is the main entry point?
explain the folder structure

It scans your project tree and opens the relevant files behind the scenes, so you don't have to spoon-feed it context. Once you're both on the same page, hand it a tight, well-scoped assignment.

Something like "Add input validation to the user registration form" gives it concrete guardrails to pull the right components and produce a solid patch. By contrast, saying "Make the forms cleaner" is just going to lead to guesswork.

You can also offload Git chores without dropping out to your shell. Try throwing commands at it like "what files have I changed?", "commit my changes with a descriptive message", or "create a new branch called feature/login-fix". For tracking down bugs, paste the raw stack trace or describe the broken behavior - say, "users can submit empty forms" - and let it trace the logic through your functions.

Whether Claude runs edits automatically or pauses for your go-ahead comes down to your permission mode. For Pro, Max, and Team tiers, terminal sessions default to Auto mode, where a background model screens actions and flags anything risky or out of scope, letting routine edits fly through without friction.

Other setups start in Manual mode, prompting you to confirm every disk edit and command. Hit Shift+Tab to flip between them on the fly, and check out Claude Code's permission modes for a rundown on each level and when to tighten things down before hitting production.

CLAUDE.md and Auto Memory

Save yourself the hassle of re-explaining your linting preferences, project conventions, and quirks every morning. Drop a CLAUDE.md in your project root, and the CLI parses it right at startup.

Running /init will whip up an initial baseline draft based on your repo structure. Keep it lean: a handful of clear notes on architecture boundaries and non-obvious project rules will do way more good than a wall of generic programming advice.

On top of that, Claude Code handles its own auto memory, quietly stashing context and decisions it learns along the way without you having to micromanage notes. If you're juggling a massive repo and need to track long-running architectural discussions, check out persistent local memory for AI coding agents to see how a dedicated SQLite layer can take persistent agent memory even further.

Extending the Workflow: Commands, Hooks, MCP, and Skills

Once you've got the rhythm of prompting, reviewing diffs, and committing, there are four key ways to mold the environment to your specific workflow.

Slash commands are your quick shortcuts for built-in tools (/clear, /compact, /model) alongside custom team scripts. Typing / brings up the full menu for your current repo, including custom skills. For a closer look at the must-know built-ins and how to craft your own shortcuts, take a look at Claude Code slash commands explained.

Hooks act as guardrails and automation triggers so you don't have to keep nagging the assistant about conventions. A PreToolUse hook can stop unintended pushes to your main branch dead in their tracks, while a PostToolUse hook can auto-run your linter right after an edit and pass broken syntax back to Claude to fix immediately. Our guide on Claude Code hooks walks through the configuration and shows you how to sidestep exit-code gotchas that allow commands to slip through unvetted.

MCP (Model Context Protocol) servers bridge the gap between your local environment and external systems, letting Claude query staging databases, browse bug trackers, or interact with a headless browser. Hooking one up is as straightforward as running claude mcp add or dropping the specs into .mcp.json. If you run into issues, Claude Code MCP servers setup covers the correct scopes and the misconfigurations that can cause a server to fail without warning.

Skills and subagents shine when dealing with complex, repetitive workflows like running staging deployments or multi-file PR reviews. Subagents run their own isolated sandboxes while a main coordinator aggregates the findings, keeping the primary context window lean. Have a look at Custom skills and subagents in Claude Code to learn how to hook these up.

For the full rundown of built-ins - including how to revert actions cleanly and inspect diffs before they land - check out Claude Code commands.

Running Claude Code Beyond the Terminal

While it started in the CLI, the exact same engine is available across a VS Code extension, a dedicated desktop app, JetBrains environments, and in your browser over at claude.ai/code. They all pull from the same .mcp.json configs and CLAUDE.md guidelines, which makes long-running jobs painless: start a build or heavy refactor on the web, walk away, or follow its progress on your phone while away from your desk.

Pairing this with Claude Dispatch allows you to kick off jobs remotely from your phone and smoothly jump right back into that active session on your workstation. It's the same core workflow; you're just picking whichever screen fits your day.

Picking Claude Code Over Other Coding Agents

There is no shortage of solid AI coding assistants out there, and what works best comes down to how you like to work and what you want to spend. CLI tools that have native access to your shell and git state move fast, while alternatives might focus on sleek in-editor inline diffs or specialized per-token pricing tiers. If you are comparing your options, the most cost-effective AI coding agents breaks down Claude Code alongside tools like Cursor and Windsurf with real project spending data.

No matter which tool lands in your stack, the best recipe is always the same: keep your requests scoped, actually read through the generated diffs, and turn repetitive instructions into hooks or skills the moment you find yourself typing them twice.