Blog

How to Set Up Claude Code: 10-Step Guide

Set up Claude Code as a beginner in 10 steps: install, sign in, configure CLAUDE.md, set .claudeignore, choose a model, and run your first session.

Phos Team ·
AI Strategy

Claude Code is not a plugin or browser extension. It is an agentic coding tool that runs in your terminal, reads your codebase, writes files, and executes commands on your machine.

Getting the setup right the first time matters. This guide walks through every step in the order that actually works.

Key Takeaways

  • Node.js 18 or higher is required: Check your version before installing.
  • Launch from your project directory, never from ~/: Launching from home gives Claude access to SSH keys, browser profiles, and dotfiles.
  • Create .claudeignore before your first session: Not after.
  • Sign in with a paid Claude subscription for the best experience: Claude Pro or Max. API key setup works but is more complex.
  • Write a CLAUDE.md before prompting: Even a five-line file changes the quality of every session.
  • Use Sonnet for most tasks, Opus for hard problems: Switching mid-session costs one command.

Step 1: Check Your System Requirements

Claude Code runs on macOS, Windows (via WSL or Git Bash), and Linux. Before installing, confirm your Node.js version.

node --version

You need Node.js 18 or higher. If you are below that, update via nodejs.org or your package manager before continuing.

On Windows, you also need a Bash environment. If you do not have one, install Git for Windows from git-scm.com and use Git Bash for the steps below.


Step 2: Install Claude Code

Install globally via npm:

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

Confirm the install worked:

claude --version

If you see a version number, you are ready. If you see an error, check that your npm global bin directory is in your $PATH.


Step 3: Set Up Your Working Directory

Claude Code operates inside the directory you launch it from. It can read, write, and delete files within that directory. Always launch from your project root, never from your home directory.

Create a dedicated folder for your project if you do not have one already. Then navigate into it before running Claude Code.

cd /path/to/your/project

Running claude from ~/ gives the agent access to your dotfiles, SSH keys, and browser credentials. That is not a configuration you want.


Step 4: Set Up .claudeignore Before Your First Session

Before you start your first Claude Code session, create a .claudeignore file at your project root. This tells Claude Code which files and directories to never read.

Create the file:

touch .claudeignore

Add these entries as a minimum starting point:

.env
.env.*
.env.local
.env.production
*.pem
*.key
~/.ssh/
~/.aws/
~/.config/
config/secrets.*
secrets/

Add any other paths specific to your project that contain credentials, tokens, or private data. Commit this file to your repository so your whole team shares the same exclusions.


Step 5: Sign In

From inside your project directory, run:

claude

On first launch, Claude Code walks you through a sign-in flow. The current standard path is OAuth sign-in through your browser.

Two payment options:

OptionBest forNotes
Claude subscription (Pro or Max)Most developersSimpler setup, monthly cost, best UI in Claude Desktop
API key (Claude Console)Teams, CI/CD, enterprisePay-per-token, more configuration required

For individual developers getting started, a Claude Pro or Max subscription is the faster path. The Claude Desktop app’s Claude Code interface only works with subscription accounts.

After sign-in, Claude Code creates a ~/.claude/ directory where it stores your configuration and session history.


Step 6: Configure Your Initial Settings

On first launch you go through a short setup. A few settings are worth changing from the defaults.

Default model:

/model

Use this command inside a session to switch models. Two models cover most use cases:

ModelWhen to useCost
Claude Sonnet80% of tasks: writing code, fixing bugs, adding features, writing testsLower
Claude OpusHard problems: complex architecture, subtle bugs, multi-step reasoningHigher

Start with Sonnet. Switch to Opus when a task is genuinely difficult. The command is /model claude-sonnet-4-6 or /model claude-opus-5.

Telemetry:

Telemetry is off by default. Leave it off unless your team has a specific reason to share usage data.

Editor:

Claude Code shells out to your $EDITOR for multi-line input. Set this in your shell config if it is not already set:

export EDITOR=code  # VS Code
export EDITOR=nvim  # Neovim

Step 7: Write Your CLAUDE.md

A CLAUDE.md file is the difference between Claude Code knowing your project and Claude Code guessing about your project. Even five lines is significantly better than nothing.

Create CLAUDE.md at your project root:

touch CLAUDE.md

A minimal CLAUDE.md for a first-timer:

# Project context
This is a [describe your project in one sentence].

# Tech stack
[List your primary language, framework, and key dependencies]

# Conventions
- [Any naming conventions or patterns your project uses]
- [Your preferred error handling approach]
- [Testing requirements, e.g. "always write tests for new functions"]

# Do not
- Do not read or write files outside the /src directory
- Do not run network requests without explicit approval
- Do not delete files without confirming first

The “do not” section is the most important part for a first session. Explicit restrictions prevent the most common first-timer mistakes.


Step 8: Your First Session

You are now ready. From your project directory:

claude

The safest first workflow for beginners:

Start by asking Claude to read and summarize your project before giving it any tasks.

Read the project files and give me a summary of what this codebase does, the main files, and the key dependencies.

This confirms Claude Code has the right context. It also surfaces any immediate issues with your setup (wrong directory, missing files, etc.).

After the summary looks correct, start with a small, reviewable task:

Look at [specific file]. Explain what [specific function] does and suggest one improvement.

Review the suggestion. If it looks correct, ask Claude to implement it. Review the diff before accepting.

The read-plan-edit-verify loop:

  1. Read: Ask Claude to read and explain before touching anything
  2. Plan: Ask Claude to describe what it will change before it changes it
  3. Edit: Let Claude make the change
  4. Verify: Review the diff and run your tests before moving on

This loop prevents the most common first-timer mistake: asking Claude to “improve the whole project” and losing track of what changed.


Step 9: Useful Slash Commands to Know from Day One

CommandWhat it does
/helpLists all available commands
/modelSwitch between Claude models
/clearClear conversation history and start fresh
/statusShow current session status and token usage
/reviewAsk Claude to review recent changes
EscapeInterrupt Claude mid-task

Step 10: What to Do Next

Once your first sessions are running smoothly, three things will make Claude Code significantly more productive:

  • Add hooks: PreToolUse hooks let you block dangerous commands before they execute. PostToolUse hooks let you auto-format files or run tests after edits. See the complete guide to writing Claude Code hooks for copy-paste examples.
  • Expand your CLAUDE.md: After a few sessions you will have a clear picture of what Claude gets wrong or misses. Add those patterns to your CLAUDE.md explicitly.
  • Explore MCP servers: Model Context Protocol servers connect Claude Code to GitHub, Linear, Notion, and your internal tools. Even one well-chosen MCP server changes the depth of what Claude Code can do in context.


Want Help Rolling Claude Code Out Across Your Team?

Individual setup is straightforward. Team-wide Claude Code rollout, with consistent CLAUDE.md conventions, shared hooks, and MCP server integrations, is a different challenge.

Phos AI Labs is an embedded AI consulting firm for small and mid-market businesses.

We identify the right problems, build the AI strategy, handle implementation, and train your team until AI is how the business actually runs.

  • Strategy before systems: We establish which workflows Claude Code should own before any configuration work begins.
  • AI Foundations that hold: We install the operating context, decision rules, and configuration standards your team runs on for years.
  • Real team training: We build fluency inside your actual workflows, not in staged demos disconnected from your operations.
  • Private AI Workspace: We design a company-wide AI environment built around your knowledge base and existing stack.
  • AI Implementation: We rebuild the workflows that matter most so AI compounds across your business.
  • Honest judgment, every time: We tell you when Claude Code is the right tool and when something else fits better.
  • We stay until it compounds: We are not done when the roadmap is delivered. We are done when the business runs differently.

400+ engagements. Clients include Zapier, Coca-Cola, Medtronic, Dataiku, and American Express.

For certified Claude Code development, LOW/CODE Agency is one of the first Anthropic partners worldwide with 10+ CCA-F certified developers on staff.

If you want your Claude Code setup and rollout to hold, talk to the team at Phos AI Labs.


Frequently Asked Questions

What do I need to run Claude Code?

Node.js 18 or higher, a paid Claude subscription or Console account with API credits, and a terminal. On Windows you also need a Bash environment such as Git Bash.

Should I use a Claude subscription or API key for Claude Code?

Claude subscription is simpler to set up and recommended for most individual developers. API keys via Claude Console give more control over costs and are better suited for teams and CI/CD pipelines.

What model should I use in Claude Code?

Start with Claude Sonnet for most tasks. Switch to Claude Opus for complex architecture decisions, hard bugs, or multi-step reasoning problems. Use /model inside a session to switch without restarting.

What is CLAUDE.md and why does it matter?

CLAUDE.md is a project-level configuration file giving Claude Code persistent context: conventions, tech stack, and explicit restrictions. Without it, Claude Code starts every session with no project-specific knowledge.

Is it safe to run Claude Code on my development machine?

Yes, with the right setup. Launch from your project directory, create .claudeignore before your first session, and review diffs before accepting changes. Default configuration is not hardened for security.

How do I stop Claude Code mid-task?

Press Escape to interrupt Claude mid-task. This stops execution and returns control to you without closing the session.

Related articles

The fastest way to know whether we're the right fit, is a conversation.

STEP 1/2 · ABOUT YOU