From install to your first commit, here's exactly how to get Claude Code running on a real project — the commands, the login options, and the small habits that make it genuinely useful from day one.
How to Set Up Claude Code for Your First Project
Claude Code is Anthropic's terminal-native coding agent — it lives in your command line, reads your project files automatically, and can plan, write, test, and commit code through plain-language requests rather than a chat window bolted onto an editor. Getting it running on a real project takes a few minutes. This walkthrough covers the exact steps, plus a few habits worth building in from your very first session.
Before You Start
You'll need three things:
A terminal or command prompt open (if you've never used one, it's worth spending ten minutes with a basic terminal guide first)
An actual code project to point it at — even a small personal repo works fine for learning
One of the following accounts: a Claude subscription (Pro, Max, Team, or Enterprise), a Claude Console account with pre-paid API credits, or access through a supported cloud provider like Amazon Bedrock, Google Cloud, or Microsoft Foundry
This guide walks through the terminal CLI specifically, which is the most common starting point. Claude Code is also available on the web, as a desktop app, inside VS Code and JetBrains IDEs, in Slack, and in CI/CD through GitHub Actions and GitLab — worth knowing about once you're comfortable with the basics.
Step 1: Install Claude Code
Pick the install method that matches your platform. The native installer is the recommended default and updates itself automatically in the background.
Native install (macOS, Linux, WSL):
curl -fsSL https://claude.ai/install.sh | bashNative install (Windows PowerShell):
irm https://claude.ai/install.ps1 | iexNative install (Windows CMD):
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmdA couple of Windows-specific notes worth knowing before you run this:
If you get an error about
&¬ being a valid statement separator, you're actually in PowerShell — use the PowerShell command above insteadIf
irmisn't recognized, you're in CMD — use the CMD command insteadOn native Windows, installing Git for Windows is recommended so Claude Code can use its Bash tool; without it, Claude Code falls back to PowerShell as its shell tool. If you're running through WSL, you don't need Git for Windows at all
Prefer a package manager instead? Both of these work too:
Homebrew (macOS/Linux):
brew install --cask claude-codeWinGet (Windows):
winget install Anthropic.ClaudeCodeOne thing to know about package-manager installs: unlike the native installer, Homebrew and WinGet installs don't auto-update. You'll need to run brew upgrade claude-code or winget upgrade Anthropic.ClaudeCode periodically yourself to stay current.
Step 2: Log In
Claude Code requires an account. Start it up for the first time:
claudeThis prompts you to authenticate in your browser. You have a few login options:
A Claude Pro, Max, Team, or Enterprise subscription — the recommended path for most individual developers, since it covers both the Claude web app and Claude Code under one plan
A Claude Console account, which uses pre-paid API credits instead of a subscription. On your first login this way, Anthropic automatically creates a "Claude Code" workspace in the Console for centralized cost tracking
Enterprise cloud provider access through Amazon Bedrock, Google Cloud, or Microsoft Foundry, if your organization is set up that way
Once you're logged in, your credentials are stored locally, so you won't need to repeat this step. If you ever need to switch accounts, type /login inside a running session.
Step 3: Start Your First Session
Navigate into your project directory and start Claude Code there:
cd /path/to/your/project
claudeYou'll see a prompt showing the current version, active model, and working directory. From here, type /help at any time to see available commands, or /resume to pick up a previous conversation.
Step 4: Ask Claude Code About Your Own Project First
Before asking for any changes, it's worth spending your first few prompts just letting Claude Code explore and explain what it's looking at. This costs you nothing and gives you a feel for how it reads a codebase:
what does this project do?what technologies does this project use?where is the main entry point?explain the folder structureClaude Code reads your project files automatically as it needs them — you don't have to manually paste in code or point it at specific files first.
Step 5: Make Your First Actual Code Change
Once you've got a feel for how it talks about your project, try a small, low-risk edit:
add a hello world function to the main fileHere's what happens next: Claude Code locates the right file, shows you the proposed change, and asks for your approval before touching anything. You can approve edits one at a time, or switch to an "accept all" mode for the rest of the session if you're comfortable moving faster. Either way, Claude Code always asks permission before modifying files by default — it doesn't silently rewrite your code in the background.
Step 6: Try Git Through Plain Language
This is one of the more genuinely useful day-to-day features — Git operations become conversational instead of a sequence of memorized commands:
what files have I changed?commit my changes with a descriptive messagecreate a new branch called feature/quickstartshow me the last 5 commitshelp me resolve merge conflictsStep 7: Try a Real Bug Fix or Feature Request
This is where Claude Code moves past "assistant" and starts feeling like a working collaborator. Describe what you actually want, in plain language:
add input validation to the user registration formor point it at a real problem:
there's a bug where users can submit empty forms - fix itIn either case, Claude Code will locate the relevant code, understand the surrounding context, implement a solution, and run your existing tests if any are set up — rather than making an isolated, out-of-context edit.
A Few Other Everyday Workflows Worth Trying
Text-style list of common requests:
Refactor code → "refactor the authentication module to use async/await instead of callbacks"
Write tests → "write unit tests for the calculator functions"
Update documentation → "update the README with installation instructions"
Code review → "review my changes and suggest improvements"
Essential Commands to Remember
Text-style command reference:
Shell commands (run from your regular terminal, before or between sessions):
claude→ starts interactive modeclaude "task"→ runs a one-time task, e.g.claude "fix the build error"claude -p "query"→ runs a single one-off query, then exits, e.g.claude -p "explain this function"claude -c→ continues your most recent conversation in the current directoryclaude -r→ resumes a previous conversation
Session commands (used inside an active Claude Code session):
/clear→ clears conversation history/help→ shows available commands/exit(or Ctrl+D) → exits Claude Code
Habits Worth Building From Day One
A few small practices genuinely improve how useful Claude Code is on your very first project:
Be specific in your requests. "Fix the bug" gives Claude Code far less to work with than "fix the login bug where users see a blank screen after entering the wrong password twice"
Break complex asks into steps rather than one giant request — numbering out "1. create a database table, 2. build an API endpoint, 3. build a page to view and edit it" tends to produce cleaner results than asking for all three at once
Let Claude Code explore before you ask it to change anything, especially on an unfamiliar codebase — a request like "analyze the database schema" first gives both of you better footing for the actual task
Learn the shortcuts early: type
/to see all available commands and skills, use Tab for command completion, press the up arrow for command history, and Shift+Tab to cycle between permission modes
What to Explore Next
Once the basics feel comfortable, a few things are worth digging into as you go from "first project" to daily use:
CLAUDE.md — a project memory file Claude Code reads automatically each session, useful for encoding your build commands, testing setup, and coding conventions once instead of repeating them
Skills, hooks, and subagents — ways to extend and automate Claude Code's behavior for more advanced, repeatable workflows
MCP servers — for connecting Claude Code directly to external tools and data sources relevant to your project
The Bottom Line
Getting Claude Code running on your first project is genuinely a few-minutes job: install, log in, cd into your project, and start asking questions before you ask for changes. The install command and login step are the only parts you'll do once — everything after that is just talking to it like a capable, careful colleague who reads your code before touching it and always asks before making a change. Start small, let it explore your codebase first, and build up to real feature work and bug fixes once you've got a feel for how it responds.