Claude Code for beginners: install, first session, habits
Install Claude Code, run your first session and learn the habits that matter: specific prompts, plan before edit, CLAUDE.md, small commits, a clean context.
Claude Code is an AI coding agent that runs in your terminal, reads your project, edits files and runs commands, asking you first by default. You install it with one command, sign in with a Claude account, and start it inside a project folder. This guide covers the install, a first session, and the handful of habits that separate a good first week from a frustrating one.
#How do you install Claude Code?
You need a terminal, a project folder and a Claude account (a Pro or Max plan, a Team or Enterprise seat, or a Console account). The recommended install on macOS, Linux and WSL is the native installer:
curl -fsSL https://claude.ai/install.sh | bash
On macOS you can also use Homebrew (brew install --cask claude-code), and on Windows there is a PowerShell installer and WinGet. The native installer updates itself in the background; the Homebrew and WinGet installs do not, so upgrade them yourself from time to time.
Open a new terminal window afterwards and check it worked:
claude --version
If your shell says claude is not found, the install directory is not on your PATH yet. The official troubleshooting page covers the fix for each shell.
#How do you start your first session?
Go to a project and run claude:
cd ~/projects/my-app
claude
On first use it opens your browser to sign in. Later, /login inside a session switches accounts. Claude Code stores the credentials, so you sign in once.
Start with questions, not edits. It reads files as it needs them; you do not have to paste code in.
what does this project do?
where is the main entry point?
how is authentication handled?
This costs nothing in risk and shows you how it reasons about your code. If its answers are wrong, you have just learned what to put in your CLAUDE.md.
Then make one small change: "add a hello world function to the main file". Claude Code shows the proposed edit and asks before writing. Approve it, look at the diff, run your tests. That loop (ask, review, approve, verify) is the whole product.
#Which commands and shortcuts do you need first?
You can ignore most of the surface at the start. These are enough:
| You type | What it does |
|---|---|
claude | Start a session in the current folder |
claude "fix the build error" | Start with a first prompt |
claude -p "explain this function" | Answer once and exit (for scripts) |
claude -c | Continue the latest session in this folder |
claude -r | Pick an older session to resume |
/help | List commands |
/clear | Start a fresh conversation with empty context |
/resume | Reopen a previous conversation |
Shift+Tab | Cycle the permission mode of the session |
Typing / alone lists every command and skill available to you. More on that in the slash commands guide.
#Why does Claude Code ask before it acts?
By default it can read your files freely but asks before editing a file or running a command. That is the permission mode called default. Press Shift+Tab and the mode changes: accept edits without asking, plan mode (read only, proposes a plan), and so on. The status bar shows which one is on.
For your first week, stay in the default mode and read what you approve. Once you trust the pattern, move to accept-edits for the work you review at the end anyway. The full list is in permission modes explained.
#What habits matter in the first week?
Be specific. "Fix the bug" gives it room to guess. "Fix the login bug where users see a blank screen after entering wrong credentials" gives it a target and a way to know it is done.
Plan before anything non-trivial. For a change that touches several files, switch to plan mode first. Claude reads, proposes a plan, and changes nothing until you approve. It is much cheaper to correct a plan than a diff. See plan mode.
Give it a way to check itself. Tell it which command runs the tests or the linter ("run npm test and fix failures"). An agent that can verify its own work needs fewer rounds with you.
Write down what you keep repeating. The second time you correct the same mistake, put the rule in a CLAUDE.md file at the project root. Run /init and Claude drafts one from your codebase; then cut it down to what it would not guess by itself.
Commit small and often. Ask for a commit after each working step ("commit my changes with a descriptive message"). Small commits are your undo button, along with /rewind, which can roll back the conversation and the file edits to an earlier point.
Keep the context clean. A long session fills the context window and quality drops. Use /clear between unrelated tasks and /resume to come back to an old one. When a session gets long but you still need it, /compact summarizes it.
#What should you not do at the start?
- Do not turn on the mode that skips every permission check. It exists for isolated containers and VMs, and it removes the safety net while you are still learning what the tool does.
- Do not paste a ten-paragraph spec. Describe the goal, name the files that matter, say how to verify.
- Do not let one session do three unrelated things. Open a new one.
- Do not accept diffs you have not read. It is fast to approve and slow to find the bug later.
#Where does it get more powerful?
Once the basics feel natural, the extension points are where Claude Code starts to feel tailored:
- CLAUDE.md for standing instructions about your project.
- Skills for repeatable procedures it loads when relevant.
- Hooks, MCP servers and subagents for automation, external tools and delegated work.
- Headless mode (
claude -p) to run it from scripts and CI.
Add them one at a time, when a real annoyance asks for it.
#In Relais
Relais is a desktop app (Mac and Linux) that sits on top of Claude Code once you are comfortable in the terminal. It runs the Claude Code login already on your computer, with no API key, so usage counts toward your Claude plan like it does in a terminal. Its sessions are real Claude Code sessions stored in ~/.claude/projects, so claude --resume opens them too. It adds a chat UI with inline approvals and diffs, a project "group" that holds several folders, and one-click undo. See features and the FAQ.