Bot TutorialsGrok BotChatGPTClaudeGeminiCopilotPerplexityMore botsGuidesArticlesPapers
Topics
CookingHome automationFitnessCreative writingMusic productionCodingIndustrialPros (Professional track)
Search
A developer in a dark room works in a terminal on a wide monitor

How to use Claude Code: step-by-step tutorial

Anthropic’s coding agent for the terminal: install, plans that include it, shared limits, safe approvals, CLAUDE.md and coding workflows you can copy.

Step-by-stepLessonsBeginnerNoviceAdvancedPhD-levelQuiz

At a glance

Made byAnthropic. Terminal, IDE and web.
Strongest atReading a codebase, multi-file edits, tests and reviews.
PriceIncluded in Pro ($20), Max ($100), Ultra ($200), Team, Enterprise.
LimitsShares Claude’s 5-hour window and weekly limits.

Is Claude Code right for this job?

Use Claude Code for

  • Fixing bugs with a failing test first
  • Explaining an unfamiliar codebase
  • Multi-file refactors you review as a diff
  • Code review on a branch
  • Writing tests and docs

Think twice for

  • Approving commands you haven’t read
  • Repos with secrets in plain files
  • Huge jobs right before a limit resets
  • Deploying to production without a human check

Get set up: step by step

  1. Basics

    What it is

    Claude Code is Anthropic’s coding agent. It runs in your terminal (and in IDEs and on the web), reads your project, edits files and runs commands with your approval. It is included in the Pro, Max, Ultra, Team and Enterprise plans, not Free, and shares your Claude usage limits, which reset on a 5-hour window plus weekly limits (claude.com/pricing).

    Why this step matters: Knowing what it is good and bad at stops you using it for jobs where it will fail quietly.

  2. Setup

    Step 1: Get the official app

    1. Install Node.js 22 or newer.
    2. Run npm install -g @anthropic-ai/claude-code (no sudo), per Anthropic’s docs.
    3. In your project folder, run claude and sign in with your Claude account.
    4. Only install from npm’s official package name above or Anthropic’s docs at code.claude.com.

    Why this step matters: Copycat apps and unofficial installers are common; starting from the official source protects your account and data.

  3. Setup

    Step 2: Plans, limits and costs

    • Not included in Claude Free.
    • Pro: $20/month, or $17/month billed yearly ($200).
    • Max: from $100/month. Ultra: $200/month.
    • Team and Enterprise plans include it too.

    Claude Code shares your plan’s usage limits: a 5-hour window and weekly limits (claude.com/pricing, checked Oct 30, 2026).

    Why this step matters: Paying for features you don't use is the most common waste. Knowing the limits first tells you if the free tier is enough.

Real things to do with Claude Code

Fix a bug the safe way

Fix a bug the safe way

Ask for a failing test before the fix, so you know the bug is real and fixed.

The checkout total is wrong when a coupon and tax both apply.
Write a failing test that shows it, then the smallest fix. Show the diff before applying.
Review a pull request

Review a pull request

Get a severity-ranked review, then fix the top issues yourself or with its help.

Review the diff between main and this branch.
List issues by severity (high/medium/low) with file and line, and a one-line fix each.
Find security smells

Find security smells

Ask for a read-only scan for common risks, then verify each finding.

Read-only: look for hard-coded secrets, SQL built from strings, and missing input validation. List file and line. Don’t change anything.
Learn a new repo fast

Learn a new repo fast

A read-only tour, then a CLAUDE.md that captures what you learned.

Give me a tour of this repo: entry points, main modules, how to run tests. Then draft a CLAUDE.md.
Clean data with a script

Clean data with a script

Ask for a script with row counts before and after, and run it on a copy.

Write a Python script that dedupes customers.csv by email, keeping the newest row. Print counts before and after.
Write the docs nobody wrote

Write the docs nobody wrote

Have it read the code and draft a README you correct.

Read the src folder and draft a README: what it does, install, usage example, tests. Mark anything you’re unsure of.

The 5-part prompt that works in Claude Code

Most weak answers come from weak instructions, not a weak model. Before you send anything important to Claude Code, check that your message has these five parts. It takes thirty seconds and saves several rounds of “that’s not what I meant.”

  1. Situation. Who you are and why you are asking. “I run a two-person bakery” changes every answer that follows.
  2. Task. One clear verb: draft, compare, summarize, fix, plan, explain. If you have three tasks, send them as three steps.
  3. Inputs. Paste or attach the material it should use, and say what to ignore. Name the file and the pages if it is long.
  4. Format. Length, structure and tone: “a table with 4 columns”, “under 150 words”, “plain English, no jargon”.
  5. Checks. Tell it how you will judge the answer: “give a source link for every number”, “say unknown instead of guessing”, “list your assumptions first”.
I run a two-person bakery in Ohio (situation). Draft a 120-word reply to this customer complaint (task). Use only the facts in the email below; ignore the order history (inputs). Warm, plain English, one apology, end with a clear next step (format). List anything you had to assume at the end (checks).

Save the version that works. In Claude Code the natural home for reusable instructions is a CLAUDE.md file in your repo with build, test and style rules, so you never type the same context twice.

Go further: steps continued

  1. Use

    Step 3: Your first real task

    Start read-only: ask Claude Code to explain your project before it changes anything.

    Read this repository and explain, in 10 bullets, what it does, how to run it, and where the tests live.
    Don’t change any files yet.

    Why this step matters: A prompt with situation, task and format gets a usable answer first time, so you learn what the tool can actually do.

  2. Setup

    Step 4: Privacy

    • Don't paste passwords, ID numbers, card numbers or other people's private details.
    • Assume the company can read and keep your chats unless its official policy says otherwise.
    • For health, money or legal decisions, confirm with a professional or an official source.
    • Keep secrets in environment variables or a secrets manager, never in files Claude Code reads into chat.
    • Review every command before you approve it, especially anything that deletes, pushes or deploys.
    • Use your employer’s approved plan for company code.

    Why this step matters: Anything you paste may be stored and read. Deciding what never goes in is easier than undoing a leak.

  3. Mistakes

    Mistakes

    • Approving commands without reading them.
    • Starting a huge refactor late in a 5-hour window.
    • Letting it commit without running tests.
    • Pointing it at a folder with secrets in plain files.

    Why this step matters: Knowing how it typically fails tells you where to look when you review its work.

A good session, start to finish

  1. Decide what “done” looks like

    Write one sentence describing the finished result before you open the chat: “a one-page plan I can send to my landlord by Friday.” If you cannot describe it, the bot cannot hit it.

  2. Give context once, in the right place

    Put standing facts about you, your business or your project where {name} keeps them between chats, instead of pasting them into every message.

  3. Ask for a draft, then steer

    Take the first answer as a rough draft. Reply with specific edits (“shorter”, “cut the second option”, “use our real prices”) rather than starting over.

  4. Check the parts that matter

    Open the source behind every number, name, date and quote you will reuse. For files, spot-check two page references. For code, run it.

  5. Save what worked

    Copy the final prompt into a notes file or saved instructions. Next time the same job takes one message instead of ten, and you spend fewer credits doing it.

Your first week with Claude Code

Day 1: Set it up properlyInstall Claude Code from the official source, sign in with the right account (personal for personal, work for work) and open the settings. Decide the privacy and data choices now, before you have shared anything, and write a short note about who you are and how you like answers.
Day 2: One real taskPick a task you would have done anyway this week, such as an email, a plan or a summary. Use the 5-part prompt below. Compare the result with what you would have written yourself, and note what you had to fix.
Day 3: Check everything onceTake one answer that contains facts and verify every number, name and date against the source. This tells you how much checking Claude Code needs for your kind of work, which is the most useful thing you will learn all week.
Day 4: Save your contextMove your standing facts and instructions into a CLAUDE.md file in your repo with build, test and style rules. From now on, new chats start with that context and you stop retyping it.
Day 5: Try the feature you skippedUse one feature beyond basic chat: files, voice, images, research or whatever this page covers. Small, low-stakes tests first.
Days 6–7: Decide about moneyLook at what you actually used. If the free tier covered it, stay free. If you hit a limit on real work, compare plans on the official pricing page and note your renewal date before you pay.

How to spot a wrong answer

Warning signs

  • It gives an exact number, date or quote with no link, or with a link that does not contain it.
  • It agrees with everything you say, including a wrong assumption you slipped in to test it.
  • The answer is fluent but vague: lots of “generally” and “it depends” and no specifics you can act on.
  • It claims to have done something (sent, saved, booked, run) without a link, ID or file you can open.
  • Two answers to the same question, asked in fresh chats, disagree on a fact.
  • It names a setting, menu or plan feature you cannot find. Apps change their menus often, so check the official help pages.

What to do

Open the source and find the exact sentence. Ask Claude Code to separate what it checked from what it assumed. Re-ask in a fresh chat with the source attached. If it still cannot back the claim up, treat it as unknown and use the official page instead.

None of this means the tool is bad. It means you are the editor, and editors check.

Power-user tips

Write a CLAUDE.md

Build, test and style rules in the repo save tokens and mistakes every session.

Plan, then act

Ask for a plan and file list first; approve before edits.

Small diffs

Ask for the smallest change that passes tests.

Read every command

Deletes, pushes and installs deserve a second look.

Mind the 5-hour window

Start big refactors early in a window.

Use git as your undo

Commit before a session so you can roll back cleanly.

Privacy and safety with Claude Code

Claude Code reads files it needs from your project. Keep secrets out of the repo, review commands, and use your company’s approved plan for work code.

Claude Code or another bot?

If you need…PickWhy
Terminal coding agentClaude CodeReads the repo, edits and runs commands with approval.
AI code editorCursor or Windsurf/DevinFull editor with AI built in.
Code completion in GitHubGitHub CopilotTight GitHub integration.
Build an app in the browserReplitHosting and agent in one place.

Our editorial judgment, not a benchmark. Try your own real task in two bots before you pay for either.

Questions people ask

Is Claude Code free?

No. It’s included with Claude Pro ($20/month, or $17/month yearly at $200), Max (from $100), Ultra ($200), Team and Enterprise, but not Free (claude.com/pricing, checked Oct 30, 2026).

How do I install it?

Install Node.js 22+, then run npm install -g @anthropic-ai/claude-code (no sudo) and start with claude in your project.

Does it share limits with Claude chat?

Yes, it shares your plan’s 5-hour window and weekly limits.

Can it run commands?

Yes, with your approval. Read each one before approving.

What is CLAUDE.md?

A file in your repo with instructions Claude Code reads at the start of each session.

Can I use it in CI?

It supports non-interactive use; keep human approval on pushes and deploys.

Does it work in my IDE?

Anthropic documents IDE and web options alongside the terminal at code.claude.com.

Is my code used for training?

Check your Claude privacy settings and your plan’s terms; business plans have their own commitments.

Words you will see

Agent: an AI that takes actions (editing, running commands), not just answers.
Diff: the exact lines added and removed by a change.
CLAUDE.md: a repo file of standing instructions for Claude Code.
Headless mode: running without the interactive chat, e.g. in scripts or CI.
Prompt: the message you send. Better prompts give a situation, task, inputs, format and checks.
Context window: how much text the model can keep in mind at once. Long chats push early details out.
Hallucination: a confident answer that is false, such as a made-up citation or number.
Token: a chunk of text (roughly three-quarters of a word) used to measure limits and API prices.
Ready to test yourself?
The Claude Code quiz, first-week checklist and cost calculator now have their own page.
Take the Claude Code quiz →

Where these facts come from

Checked Oct 30, 2026. Plans change, so confirm on the official page before you pay.

Next: Claude Code lessons →

Related:Claude Code lessons FAQGrok Bot lessonsChatGPT lessonsClaude lessonsGemini lessonsCopilot lessonsPerplexity lessonsCatch made-up answersStop burning creditsWhich bot for whatFiles safelyScripts & templatesWorkflowsMore bot lessons