Reviewed by Jonathan West · Updated Jul 27, 2026

How to Use Claude Code: A Step-by-Step Tutorial

From installation to your first productive workflow in under an hour.

Reviewed by Jonathan West · Updated Jul 27, 2026

This tutorial walks you through how to use Claude Code from scratch. You will install it, configure permissions, write your first project instructions, and complete a real task with reviewable output.

Claude Code runs as a CLI, a desktop app, a web app at claude.ai/code, and as IDE extensions for VS Code and JetBrains. This guide covers all four paths so you can start with whichever feels most comfortable.

By the end, you will understand the core workflow loop: describe a task, let the agent work, review the changes, and iterate. That loop is the same whether you are a developer refactoring code or an analyst building a dashboard.


How to install Claude Code

The CLI is the original and most flexible way to run Claude Code. Install it globally with npm: run npm install -g @anthropic-ai/claude-code in your terminal. You need Node.js 18 or later. After installation, type claude to launch the agent in any directory.

The desktop app is available for Mac and Windows. Download it from Anthropic's website, install it like any application, and sign in with your Anthropic account. The desktop app wraps the same agent with a graphical interface that shows file changes, command output, and diffs in a visual layout.

The web app at claude.ai/code requires no installation at all. Sign in and start a session directly in your browser. It works well for trying Claude Code before committing to a local setup.

IDE extensions bring Claude Code into VS Code and JetBrains editors. Install the extension from the marketplace, authenticate, and use Claude Code in a side panel without leaving your editor.

  • CLI: npm install -g @anthropic-ai/claude-code (requires Node.js 18+).
  • Desktop: download from Anthropic, runs on Mac and Windows.
  • Web: claude.ai/code, no install required.
  • IDE: VS Code and JetBrains extensions from their marketplaces.
The CLI and desktop app work offline against local files. The web app runs in the cloud with a managed container.

Want a guided Claude Code setup tailored to your team's stack and workflows? We handle installation, permissions, and your first three automations.

Book a Consultation

Your first run: what to expect

Open a terminal in any project directory and type claude. The agent starts a session and reads your project structure. It does not modify anything until you give it a task and approve the changes.

On your first run, Claude Code will ask you to authenticate. For CLI users, this means pasting an API key or signing in through the browser. For desktop and web users, sign-in happens through the app interface.

Once authenticated, you will see a prompt where you can type tasks in plain English. The agent responds with a plan, executes it step by step, and shows you each action it takes. You approve or reject each tool call depending on your permission settings.

  • Type claude in a project directory to start.
  • Authenticate with your Anthropic account or API key.
  • The agent reads your project but changes nothing until you approve.
  • You see each action and can accept or reject it.

Writing your CLAUDE.md file

CLAUDE.md is a markdown file at the root of your project that gives Claude Code persistent instructions. Every session reads it automatically. Think of it as onboarding documentation for the agent.

A good CLAUDE.md includes your project's tech stack, coding conventions, test commands, deployment process, and any files or patterns to avoid. It does not need to be long. A focused half-page beats a sprawling document the agent ignores.

Teams benefit most from CLAUDE.md because it standardizes behavior across everyone's sessions. Without it, each person writes their own ad-hoc instructions and gets inconsistent results. With it, the agent follows the same rules regardless of who starts the session.

  • Place CLAUDE.md at your project root.
  • Include tech stack, conventions, test commands, and off-limits areas.
  • Keep it focused. A half-page of clear rules beats a long wishlist.
  • Commit it to your repo so the whole team shares the same instructions.

Understanding permission modes

Claude Code asks permission before it reads sensitive files, writes changes, or runs commands. Three modes control this: ask mode prompts you every time, auto-allow mode lets approved tools run without confirmation, and deny mode blocks specific tools entirely.

Permissions are configured per tool in .claude/settings.json. You can allow file reads globally, require approval for file writes, and block dangerous commands like rm -rf. Admin-level policies can enforce these across an organization so individual users cannot weaken controls.

Start with ask mode for everything. After a few sessions, you will know which approvals are routine. Allowlist those specific tools to reduce friction while keeping guardrails on write operations and command execution.

  • Ask mode: confirm every tool call. Best for beginners.
  • Auto-allow mode: pre-approved tools run without prompts.
  • Deny mode: specific tools are blocked entirely.
  • Configure in .claude/settings.json with per-tool granularity.

Your first useful task with Claude Code

Pick a task that is small, verifiable, and low-risk. Good options include adding a missing test, updating outdated documentation, fixing a linting error, or generating a simple report from a CSV file.

Write the task clearly. Instead of 'fix the tests,' say 'add unit tests for the calculateTotal function in src/utils/billing.ts covering zero items, negative prices, and discount codes.' Specific prompts produce better results and easier reviews.

After the agent finishes, review the diff carefully. Check that it only changed what you asked for. Run the tests. If something is wrong, tell the agent what to fix rather than starting over. The conversation is iterative by design.

  • Pick a task you can verify in under ten minutes.
  • Write specific instructions with file names and expected behavior.
  • Review the complete diff before accepting changes.
  • Iterate by telling the agent what to correct, not by restarting.

How to read Claude Code output

Claude Code shows its work as it goes. You will see tool calls (file reads, edits, command executions) with their results. Each action is labeled so you know whether the agent is reading, writing, or running a command.

File edits appear as diffs with added and removed lines highlighted. Command output shows exactly what ran and what the terminal returned. If a test fails, you see the failure output in real time.

Pay attention to the agent's reasoning between tool calls. It explains why it is making each change. If the reasoning does not match your intent, interrupt and redirect before the agent goes further down the wrong path.

  • Tool calls show the action type: read, write, or execute.
  • File edits display as standard diffs with additions and removals.
  • Command output appears inline so you see test results immediately.
  • Agent reasoning between steps explains the 'why' behind each change.

The Claude Code workflow loop

Every Claude Code session follows the same loop: describe the task, let the agent plan and execute, review the changes, and provide feedback. This loop repeats until the task is done or you decide to stop.

The review step is not optional. Claude Code produces better results than a chatbot, but it still makes mistakes. Reviewing diffs, running tests, and checking edge cases are part of the workflow, not signs of failure.

As you get comfortable, you will batch more steps together. Early on, approve each action individually. Later, allowlist routine tools and let the agent chain multiple steps between reviews. The goal is efficiency with accountability, not blind trust.

  • Describe: give the agent a clear, scoped task.
  • Execute: the agent plans, reads files, makes changes, runs tests.
  • Review: check the diff, test results, and reasoning.
  • Iterate: correct mistakes or approve and move to the next task.

What to learn next

Once you are comfortable with the basic loop, explore Skills to save repeatable workflows as slash commands. Learn how Hooks can auto-format or auto-test after every change. Look into MCP to connect Claude Code to your databases, APIs, and business tools.

For team adoption, write a shared CLAUDE.md, agree on permission defaults, and document your first three successful workflows. These artifacts matter more than any individual prompt because they make results repeatable across the team.

The biggest mistake new users make is trying to do too much too soon. Master one workflow before adding complexity. A narrow, reliable automation is worth more than a broad, unpredictable one.

  • Skills: package repeatable workflows as slash commands.
  • Hooks: automate quality checks after every change.
  • MCP: connect to external databases, APIs, and services.
  • Team setup: shared CLAUDE.md, permission defaults, and documented workflows.

Frequently Asked Questions

  • Install the CLI with npm install -g @anthropic-ai/claude-code (requires Node.js 18+). Alternatively, download the desktop app for Mac or Windows, use the web app at claude.ai/code, or install the VS Code or JetBrains extension.
  • No. The desktop app and web interface have graphical interfaces. Non-developers use Claude Code for data processing, report generation, and dashboard creation. However, understanding what the agent changed (reviewing diffs) matters regardless of your technical background.
  • CLAUDE.md is a markdown file at your project root that gives Claude Code persistent instructions about your tech stack, conventions, and constraints. You do not strictly need one, but sessions without it produce less consistent results because the agent has no project-specific context.
  • Yes, with proper permissions. Start in ask mode so you approve every change. Use a branch or sandbox for early work. Never give the agent production credentials or database write access until you have a proven review process.
  • Claude Code has a free tier with usage limits on Sonnet. Paid individual plans start at $100 per month (Max). Team plans start at $30 per seat per month. API access is pay-per-token starting at $1 per million input tokens with Haiku 4.5.

Need Help Setting Up Claude Code for Your Team?

Layer3 Labs handles the installation, CLAUDE.md configuration, permission model, and first three automated workflows so your team starts productive from day one.

Book a Free AI Workflow Audit