Room 42, home

Set Up Claude Code the Right Way

Install Claude Code, sign in, point it at a real project, and lay the groundwork that makes every later session go smoothly.

Codingbeginner5 min readUpdated 20 Jun 2026

In short

  1. 01Claude Code is a terminal agent that reads your whole project, writes code, and runs commands, asking before it changes anything.
  2. 02Get going in three steps: install it, sign in, then point it at one real project you already work on.
  3. 03Lay a little groundwork (a project rules file and a quick tour) so every later session starts with the right context.
  4. 04Fifteen minutes of setup now saves you re-explaining your project on every run.
Contents · 8 sections
  1. 1What does Claude Code do?
  2. 2How do I install Claude Code?
  3. 3How do I sign in to Claude Code?
  4. 4Point it at a real project
  5. 5What is a CLAUDE.md rules file?
  6. 6A quick mental model
  7. 7How do I compare two approaches?
  8. 8Where to go next

Claude Code is a coding agenta program that reads and changes your code on its own, taking multiple steps to finish a task you describe in plain English that lives in your terminal. You type a task in plain English, it reads your whole project, writes code, runs commands, and asks before it changes anything. This is the first guide in the path: it gets the tool installed and sets up the few things that make every later session better.

Install, verify, then let init read the repo and write your first rules file. Illustrative session.

What does Claude Code do?

Claude Code is not a chat window with a copy button. It runs as a process in your shellthe text-based window where you type commands to control your computer, so it can read every file in your repoa folder tracked by version control, usually git, that holds all the files for a project, edit several files at once, run your tests, and commit the result. Because it is just a process, the same tool works over SSHSecure Shell, a protocol for connecting to remote computers over a network on a remote server, inside a sandboxan isolated environment that runs code without affecting the rest of your system, and inside a CI/CDContinuous Integration and Continuous Deployment: automated pipelines that build, test, and deploy your code pipeline.

That power is why a little setup pays off. An agent with full repo access does its best work when it knows your conventions and your boundaries, and that is exactly what the steps below put in place.

How do I install Claude Code?

On macOS, Linux, or WSLWindows Subsystem for Linux, a feature that lets you run a full Linux environment inside Windows, run the one-line installer:

curl -fsSL https://claude.ai/install.sh | bash

Prefer to install it as a package? Use npmNode Package Manager, the standard package manager for JavaScript and Node.js instead:

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

Either route gives you a claude command on your PATHthe list of folders your shell searches to find a command you type. Check it worked:

claude --version

How do I sign in to Claude Code?

Run claude once with no arguments and it walks you through authentication in the browser:

claude

Claude Code uses your Anthropic subscription (Pro, Max, Team, or Enterprise) or a Console account with API credits. Pick whichever you have. Once you are signed in there is nothing else to configure, and you stay signed in across sessions.

Point it at a real project

Always start Claude Code from the root of the project you want it to work on, because the folder you launch from is the folder it can see.Common gotchaLaunching from your home folder or a deep sub-directory is a common slip: from ~ the agent wanders across unrelated repos, and from a sub-folder it cannot read the parent files it needs.Always cd to the project root first and confirm you are there before you start.

cd ~/code/my-project
claude

A few habits make the first session safe:

  • Start on a clean branch. Commit or stash your current work first, so it is easy to see exactly what the agent changed and to undo it if needed.
  • Read every diff before you accept it. Claude Code asks before it writes; treat that prompt as a code review, not a rubber stamp.
  • Begin small. Ask for one focused change (fix a bug, add a test) before you hand it a larger task. You learn how it behaves on something low-risk.

For a full walk from this first launch to a committed change, follow the Claude Code Quickstart.

What is a CLAUDE.md rules file?

The single highest-impact setup step is a rules file in your project root. Claude Code reads a file named CLAUDE.md and treats it as standing instructions for that project: your conventions, the files that are off-limits, and how you want it to behave. It is the difference between an agent that guesses your style and one that already knows it.

Keep the first version short. A handful of true, specific lines beats a long wish list:

# Project rules
 
- This is a Python web API. Use type hints on every function.
- Tests live next to source as `*_test.py`. Add tests for new behaviour.
- Never edit anything under `vendor/`; it is generated.
- Run the linter before you say a task is done.

You can grow this file as you notice the agent making the same mistake twice.Common gotchaThe tempting mistake is stuffing CLAUDE.md with a long aspirational wish list ("write clean code", "always be careful"). Vague rules get ignored because the agent cannot act on them, and the noise buries the few lines that matter.Write only specific, checkable facts about THIS repo (the test command, the off-limits folder), and add a line only after you watch the agent get it wrong. The dedicated rules and memory files guide covers load order, scope, and what belongs in a rules file versus a one-off prompt.

A quick mental model

Here is the whole loop in one picture: you describe a task, Claude Code reads the repo and your rules, proposes changes, you review, and it commits.

The review step is yours and it never goes away. The agent moves fast; you stay the one who decides what lands.

How do I compare two approaches?

When you are torn between two ways to do something, do not argue with yourself, run both and read the diffs. Open a second session in the same project, give each one a different instruction, then compare what they produce.

Try this prompt
Refactor the token parser in src/auth/token.ts to be fully synchronous. Do not change the public function signatures.
Try this prompt
Refactor the token parser in src/auth/token.ts to use async streaming. Do not change the public function signatures.

Two real diffs tell you more in a minute than ten minutes of guessing. Keep the one you prefer and discard the other. To run those sessions without them overwriting each other, see isolate parallel agents with git worktrees.

Where to go next

You now have Claude Code installed, signed in, pointed at a project, and reading a rules file. From here:

Try this prompt
I just installed Claude Code on a Python web API project. Read the codebase, then suggest five short, specific lines I should put in my CLAUDE.md rules file based on the conventions you see.