Claude Code is a coding agent 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.
What does Claude Code do?
Claude Code is not a chat window with a copy button. It runs as a process in your shell, so it can read every file in your repo, edit several files at once, run your tests, and commit the result. Because it is just a process, the same tool works over SSH on a remote server, inside a sandbox, and inside a CI/CD 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 WSL, run the one-line installer:
curl -fsSL https://claude.ai/install.sh | bashPrefer to install it as a package? Use npm instead:
npm install -g @anthropic-ai/claude-codeEither route gives you a claude command on your PATH. Check it worked:
claude --versionHow do I sign in to Claude Code?
Run claude once with no arguments and it walks you through authentication in
the browser:
claudeClaude 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
claudeA 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.
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:
- Claude Code Quickstart takes you from install to your first committed change in about ten minutes.
- Claude Code Workflows covers plan mode, memory, and using the agent to review its own work.
- How Claude Code memory works explains what the agent remembers across a session and how to steer it.