How to Use Claude Code: The Beginner's First Session (Install, First Prompt, and the Safety Rules)

CodexFuse Team · 2026-10-27T23:54:13.597Z · 18 min read

Claude Code is Anthropic's terminal-based AI coding agent. This beginner's guide covers the install, your first session, permission modes, Plan Mode, CLAUDE.md, and cost control — with the safety rules first.

Learning how to use Claude Code takes about ten minutes, and most of that time is the install. Claude Code is Anthropic's terminal-based AI coding agent: you describe what you want in plain English, and it reads your project, edits the files, runs commands such as tests and builds, and fixes the errors it meets along the way. This guide walks through the whole first session — the install, the first prompt, the permission modes, Plan Mode, the CLAUDE.md memory file, and the cost controls — with the safety rules first, because an agent that can edit your code deserves a careful first hour.

It is not an autocomplete tool. Autocomplete finishes the line you are typing; Claude Code takes the whole job — plan it, change several files, run the tests, and report back. That is why developers call it an agent rather than an assistant. According to the Pragmatic Engineer's 2026 survey, reported by DEV Community, Claude Code is now the most-used AI coding tool, overtaking GitHub Copilot and Cursor in eight months, and 46 percent of developers named it the tool they love most. The same survey is the reason so many beginners are opening a terminal for the first time: the tool everyone recommends is the one that looks the most intimidating.

If the vocabulary is new, the idea is simple. Claude Code is agentic AI for code: software that plans and acts toward a goal instead of waiting for the next keystroke. You stay in charge by giving it small, specific jobs, reading its plan before it acts, and reviewing every change it makes. The rest of this guide is that workflow, step by step.

How do you use Claude Code?

You use Claude Code by installing it once, opening it inside a project folder, and typing what you want in plain English. It reads the project, proposes a plan, and — with your permission — edits the files and runs the commands to get it done. The full first session looks like this:

  1. Install it with the native installer for your system (one command, below).
  2. Move into a real project folder with cd — never start it from your home folder, where it has no project to read.
  3. Run claude and sign in with a paid Claude plan or a Console API key.
  4. Ask it to read first: "What does this project do? Give me a summary."
  5. Give it one small, specific job, and read the plan it proposes before you approve it.
  6. Check the diff it produces, run the tests, and type /cost to see what the session spent.

That is the whole loop. Everything after this section is detail: the install commands, the permission modes that decide how much it may do unsupervised, the memory file that makes it smarter over time, and the cost controls that keep a long session cheap.

What do you need before you install Claude Code?

Two things: a paid Anthropic account and a machine that meets the minimum requirements. The free Claude.ai plan does not include Claude Code, so decide on the account before you install. Pro costs $20 a month ($17 a month billed annually); Max costs $100 a month for five times Pro's usage or $200 for twenty times. The API path is the alternative: a Console account that bills per token instead of a flat subscription. The full price breakdown is in the cost section below.

RequirementMinimum
macOS13.0 or later
Windows10 (1809+) or Windows Server 2019+
LinuxUbuntu 20.04+, Debian 10+, or Alpine Linux 3.19+
RAM4 GB or more
AccountPro, Max, Team, Enterprise, or a Console API account

The native installer needs no Node.js at all, which is the main reason Anthropic recommends it over npm. If you already manage Node with a version manager, the npm path still works, but the October 2026 install guides put it at Node.js 22 or later. Git is not strictly required, but without it Claude Code cannot see your commit history, and it loses part of the project context — install Git first if your machine does not have it.

How do you install Claude Code?

Run the installer for your operating system. The command is the same one Anthropic publishes in its official setup documentation, and every install guide checked for this article on October 28, 2026 lists the same three commands.

SystemCommand
macOS, Linux, or WSLcurl -fsSL https://claude.ai/install.sh | bash
Windows PowerShellirm https://claude.ai/install.ps1 | iex
Windows CMDcurl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

The installer shows no progress while it downloads, which catches people out — wait for it to finish, then open a new terminal window and check the install with claude --version. A working install prints a version number, such as 2.1.211 (Claude Code). For a fuller health check, run claude doctor, which diagnoses installation issues.

If you would rather install through a package manager you already use, Homebrew (brew install --cask claude-code) and WinGet (winget install Anthropic.ClaudeCode) both work — but they do not update themselves, so you will need to upgrade them by hand. The npm route is npm install -g @anthropic-ai/claude-code. Whichever path you take, the result is the same claude command.

How do you start your first Claude Code session?

Open a terminal, move into a project folder, and run claude. Starting in the right folder matters: Claude Code scopes its project memory and settings to the directory you launch it from, so starting from your home folder means it never picks up the right context.

cd ~/my-project
claude

The first run opens a browser window to sign in. After that you are in the interactive session, and the prompt is waiting. Do not ask it to write code yet. The first-prompt ladder below is the habit every good guide agrees on: read first, then describe, then change. If you have never written code at all, this workflow is what people mean by vibe coding — describing the software you want and letting the agent build it while you supervise.

StepPrompt to tryWhy it is safe
1. Read"What does this project do? Give me a summary."No files change; you see how it reads code
2. Explore"Where is the login handled, and what files are involved?"Read-only, and it teaches you the codebase
3. Small change"Add a comment at the top of the README explaining how to run this project."One file, easy to review
4. Real job"Add a test for the login function, then run the test suite."It edits and runs commands; you check the result

Be specific about the result you want, not the steps to get there, and tell it what not to do — "keep it simple" and "don't delete anything" are worth more than a long specification. If the task touches more than one file, switch into Plan Mode first (covered below) so you can read the plan before any edit happens. And start every new task with a clean slate: type /clear when you switch jobs, because stale context wastes tokens on every later message, according to Anthropic's cost documentation.

What are Claude Code's permission modes?

Permission modes decide how much Claude Code may do without asking you first. There are five, and you cycle through them with Shift+Tab. From auto mode, the first press switches to default, and the cycle then runs default, acceptEdits, plan, and back to auto. The status bar always shows the active mode, so you are never guessing. These are the modes as documented in Anthropic's official permission-modes guide.

ModeWhat it doesBest for
default (Manual)Asks before most edits, commands, and network callsYour first week — nothing happens without your say-so
acceptEditsFile edits and common filesystem commands go through without a promptRoutine edits in a project you trust
planReads and explores, proposes a plan, changes nothingMulti-file jobs and unfamiliar codebases
autoRuns everything, with background safety checksExperienced users; the default starting mode for interactive sessions since version 2.1.283
bypassPermissionsSkips all checksOnly in isolated containers and virtual machines — never on your real machine

Beginners should stay in default mode for the first week. It is slower, because you approve each step, but every approval is a chance to learn what the agent is doing — and to catch a mistake before it lands. The one mode you must not switch on as a beginner is bypassPermissions, reached with --dangerously-skip-permissions. The official docs say to use it only in isolated containers and virtual machines. On your own machine, with your real files and credentials, it removes the only safety net you have.

What is Plan Mode, and when should you use it?

Plan Mode is the read-only permission mode: Claude Code reads your project, asks clarifying questions, and shows you a plan — but it does not edit anything until you approve it. Use it for every job that touches more than one file, and for any codebase you do not know well.

You enter it by pressing Shift+Tab until the status bar says plan mode on, or by typing /plan before a request. In a Windows setup guide published on DEV Community, the author describes asking for an online order form in Plan Mode: Claude asked clarifying questions with suggested answers first, then showed the plan and waited for approval — with three choices: approve and switch to auto, approve with manual edits, or keep planning. That pause is the whole point. A plan you have read is a plan you can fix; a plan you never saw is a surprise in your codebase.

Plan Mode is also the cheapest way to learn a new codebase. Asking "explain how authentication works here" in Plan Mode costs you a read-only exploration and returns a map of the files involved — no edits, no risk, and a much better prompt for the real change that follows.

What is CLAUDE.md, and what should you put in it?

CLAUDE.md is a plain Markdown file in your project that Claude Code reads first at the start of every session — like onboarding a new teammate. It is where the project memory lives: the commands to build and test, the style rules, the things that must never be done. Run /init in a project and Claude Code writes the first version for you from the codebase itself.

Keep it short. Every extra instruction competes for attention, so the memory documentation advises keeping the file under 200 lines. A good CLAUDE.md has three things: how to build and test the project, the conventions the code follows, and the hard rules (for example, "never commit directly to main" or "run the formatter before every commit"). Put secrets in it never — no API keys, no passwords, no tokens. If a rule applies to every project you work on, put it in your global memory file instead of repeating it in each project.

You can add to it during a session too: type /memory to edit the file, or start a line with # to add a quick note to memory. When Claude Code does something well once, write the rule down so it does it well every time.

How much does Claude Code cost?

There is no standalone Claude Code subscription. You pay through a Claude plan or through the API, and the two paths behave very differently. On a plan, your cost is a fixed monthly number with usage limits; on the API, you pay per token with no ceiling. Prices below were checked against Anthropic's pricing page and the Claude Code cost documentation on October 28, 2026.

Way to payPriceClaude Code included?
Free$0No
Pro$20/month, or $17/month billed annuallyYes
Max 5x$100/monthYes
Max 20x$200/monthYes
Team Premium$125 per seat/month ($100 annually)Yes
Enterprise$20 per seat/month billed annually, plus usage at API ratesYes
Console (API)Per token: Sonnet 5.5 $2 input / $10 output per million tokens; Opus 5.5 $4 / $20; Haiku 5.5 $0.10 / $0.50Yes

Team seats run $25 a month for the Standard tier and $125 for Premium. On a subscription, usage resets on a rolling five-hour session window, and paid plans also have a weekly limit. The allowance is shared across claude.ai on the web, desktop, and mobile and Claude Code, so a long chat in the browser eats the same allowance as a coding session. Switching models with /model does not restore access once you have hit the limit, and usage credits — prepaid, billed at standard API rates — let you keep working past it.

On the API, the bill is tokens, and caching does most of the work. Anthropic's own cost page puts the average API cost at about $13 per developer per active day, and $150–$250 per developer per month, with costs below $30 per active day for 90 percent of users, according to the DEV Community pricing guide that read Anthropic's cost page on October 19, 2026. Here is what that looks like on one ordinary session — an original worked example, not a quote:

Part of the sessionTokensCost
Fresh input (your prompts and new files)50,000$0.10
Cache reads (the project context, re-read at one tenth of input price)450,000$0.09
Output (code and explanations)50,000$0.50
Total550,000$0.69

The lesson is the cache line: once your project is in context, re-reading it costs a tenth of fresh input. That is why /compact matters — it compresses a long conversation into a summary so the next turn re-reads less — and why /clear matters when you switch tasks. The commands that keep a session cheap are /cost (show what the session has spent so far, including the cache-hit ratio), /compact (compress the conversation), /usage (show your plan limits), and /model (switch to Haiku for cheap jobs, Opus only for the hard ones). In automation, cap a runaway with --max-budget-usd 5.00.

What are the safety rules for your first week?

Claude Code can edit files, run shell commands, and install packages. That is the whole point — and the whole risk. Five rules keep the first week safe, and they are the same rules the Cursor and Windsurf guides on this site use, because the risk is the same in every AI editor.

  • Commit with Git before the AI edits anything. A clean commit is the undo button for the whole session. /rewind can restore files too, but only changes made with Claude's own file-editing tool.
  • Read the plan before you approve it. Plan Mode exists for this; use it for anything bigger than one file.
  • Review every diff. Press Esc once to stop Claude mid-task if something looks wrong, and read what changed before you run the tests.
  • Never paste secrets. No API keys, passwords, or tokens in a prompt or in CLAUDE.md — a prompt is data that leaves your machine.
  • Never use --dangerously-skip-permissions outside a throwaway container. It is the warned-against option, not a shortcut for beginners.

One more habit: type /clear between tasks and /compact when a session gets long. A fresh conversation is cheaper and more accurate than a stale one carrying three old jobs.

What if you don't want to use the terminal?

You do not have to. Claude Code also runs on the web, in your editor, and in a desktop app, and all of them read the same project files and settings. Claude Code on the web launched on October 20, 2025: sign in at claude.com/code with a Pro or Max account, connect your GitHub repositories, and describe the task — it runs in a cloud sandbox, and you can run several tasks in parallel across repositories. The /teleport command (version 2.1.0) moves a session between the web and your local terminal with its context intact. Anthropic also ships native extensions for VS Code (including Cursor and Windsurf) and JetBrains IDEs, which put a Claude Code panel in the editor sidebar. If you already live in an editor, that panel is the gentlest first session of all: same agent, same permissions, no terminal window.

How does Claude Code compare with Cursor and Windsurf?

The three tools answer the same question — how much of the coding job do you hand to an AI — in three different places. Claude Code lives in the terminal and works with any editor. Cursor and Windsurf are AI-native editors: the agent is built into the window where you already write code.

ToolWhere it livesThe agent
Claude CodeTerminal (plus web, IDE, and desktop)Plans, edits files, and runs commands
CursorIts own editorAgent chat and autocomplete in the editor
WindsurfIts own editor (a fork of Visual Studio Code)Cascade agent with a rules file

If you want the comparison in detail, our guide on how to use Cursor AI walks through its workflow, and our guide on how to use Windsurf AI covers the Cascade agent and its rules file. The safety rules are the same in all three: small jobs, read the plan, review the diff, commit first. Pick the tool whose home you already live in — the terminal or an editor — and the workflow follows.

Sources

Frequently Asked Questions

Is Claude Code free?

No. Claude Code needs a paid Claude plan — Pro at $20 a month ($17 a month billed annually) or Max from $100 a month — or a pay-as-you-go Console API account. The free Claude.ai plan does not include it. Installing costs nothing; signing in is where the paid account is needed.

How do I install Claude Code on Windows?

Open PowerShell and run irm https://claude.ai/install.ps1 | iex. If you use the old command prompt instead, run curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd. Or use WSL and the macOS/Linux installer. Then open a new terminal and check with claude --version. Native Windows support exists now; WSL is still the better choice if your projects rely on Unix tools.

What is the difference between Claude Code and Claude.ai?

Claude.ai is the chat app: you type, it answers. Claude Code is the terminal agent: it reads your project, edits files, and runs commands such as tests and builds. They share one account and one set of usage limits, but they do different jobs — chat for questions, Claude Code for work on real code.

Is Claude Code safe to use on a real project?

It is safe if you follow the rules: commit with Git first, stay in default permission mode, read the plan in Plan Mode, review every diff, and never use --dangerously-skip-permissions outside a throwaway container. Claude Code can edit files and run commands, so the supervision is the safety — the tool is only as careful as the person approving its steps.

What does /cost do in Claude Code?

/cost shows what the current session has spent so far, including the prompt-cache hit ratio and a likely cause for each cache miss. Use it with /compact to compress a long conversation and /usage to see your plan limits. Switching to Haiku with /model keeps cheap jobs cheap, and Opus is for the hard ones.