Skip to main content
Featured Fundamentals Claude Code Tutorial

Claude Code Complete Guide: From Setup to Advanced Workflows

The complete Claude Code tutorial. From installation to advanced features including CLAUDE.md, Hooks, MCP, and Custom Agents. Perfect for beginners to advanced users.

January 19, 2026 15 min read By Claude World

This is the most comprehensive Claude Code tutorial available. Whether you’re new to AI-assisted development or looking to master advanced features, this guide has you covered.


What is Claude Code?

Claude Code is Anthropic’s official AI coding assistant. What makes it different from other tools:

  • Terminal Native: Runs in the terminal, not tied to any editor
  • Project-Level Understanding: Understands your entire codebase, not just single files
  • Agent Architecture: Can autonomously execute tasks, not just answer questions

Why Choose Claude Code?

FeatureClaude CodeCursorGitHub Copilot
InterfaceTerminalIDEEditor Plugin
AutonomyHigh (Agent)MediumLow
CustomizationVery HighMediumLow
Best ForComplex tasks, automationGUI preferenceSimple completion

Choose Claude Code if you love the terminal, want maximum control, and need to handle complex tasks.


Installation & Setup

System Requirements

  • macOS: 10.15+
  • Linux: Ubuntu 20.04+ / Debian 10+
  • Windows: Windows 10+ (requires WSL or Git for Windows)

Installation Methods

Method 1: Official Install Script (Recommended)

# macOS / Linux / WSL
curl -fsSL https://claude.ai/install.sh | bash

Method 2: npm Installation

# Requires Node.js 18+
npm install -g @anthropic-ai/claude-code

First-Time Setup

After installation, run:

claude

The first run will guide you through:

  1. Authentication: Log in to your Anthropic account or enter API Key
  2. Plan Selection: Free / Pro / Max
  3. Permission Settings: Decide what operations Claude can perform

Verify Installation

claude --version
# Should display version, e.g., claude-code version 2.1.12

Basic Usage

Starting a Conversation

Run in any project directory:

cd /path/to/your/project
claude

Claude will automatically scan the project structure and build understanding.

Basic Commands

CommandFunction
claudeStart interactive conversation
claude "do something"Single task execution
claude --helpView all options
/helpGet help during conversation
/clearClear conversation history
Ctrl+CInterrupt current operation
Escape twiceExit Claude

Conversation Mode

In conversation, describe tasks in natural language:

You: Create a date formatting utility function in src/utils/

Claude: I'll create that utility function...
[Claude shows the file and content to create, waits for confirmation]

Plan Mode

Press Shift+Tab to enter Plan Mode:

You: [Shift+Tab] Implement user login feature

Claude: Let me analyze the requirements and plan the implementation...
[Claude researches the codebase, proposes a plan, but doesn't modify any files]

Plan Mode is ideal for: Complex features, when you’re unsure how to proceed


CLAUDE.md Configuration

CLAUDE.md is Claude Code’s most important configuration file. It tells Claude your project rules.

Creating CLAUDE.md

Create CLAUDE.md in your project root:

# Project Name

## Tech Stack
- Node.js + TypeScript
- React + Tailwind CSS
- PostgreSQL

## Development Rules
- Use pnpm as package manager
- All code must have TypeScript types
- Run `pnpm lint && pnpm test` before committing

## Directory Structure
- `src/` - Main source code
- `tests/` - Test files
- `docs/` - Documentation

## Forbidden Actions
- Don't use any type
- Don't delete existing tests
- Don't push directly to main branch

Quick Initialization

Use the built-in command to auto-generate:

claude
/init

Claude will analyze the project structure and generate an appropriate CLAUDE.md.

CLAUDE.md Locations

LocationPurpose
project-root/CLAUDE.mdProject-specific rules
~/.claude/CLAUDE.mdPersonal global rules

Advanced Features

1. Hooks (Automation Triggers)

Hooks let you automatically execute scripts at specific events.

Common Use Cases:

  • Auto-format after editing files
  • Run tests after every modification
  • Block dangerous commands

Configuration Example (.claude/settings.json):

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "pnpm lint --fix $CLAUDE_FILE_PATHS"
          }
        ]
      }
    ]
  }
}

👉 Detailed guide: Claude Code Hooks Complete Guide

2. MCP (Model Context Protocol)

MCP lets Claude connect to external tools and data sources.

Common MCP Servers:

  • memory - Cross-conversation memory
  • filesystem - Enhanced file operations
  • github - GitHub integration

Installation Example:

# Install memory server
claude mcp add memory -- npx -y @anthropic-ai/mcp-server-memory

👉 Detailed guide: Claude Code MCP Setup Guide

3. Custom Agents

Create agents specialized for specific tasks.

Creation Method:

claude
/agents
# Select "Generate with Claude"
# Describe the agent you want

Common Agent Types:

  • Code Reviewer - Code quality review
  • Debugger - Error analysis
  • Test Writer - Test creation

👉 Detailed guide: Claude Code Agents Complete Guide

4. Custom Skills

Skills are reusable command templates.

Creation Method:

Create Markdown files in .claude/skills/:

# my-deploy.md
---
name: deploy
description: "Deploy to production"
user-invocable: true
---

Execute the following deployment steps:
1. Run tests
2. Build project
3. Deploy to Cloudflare Pages

Usage: /deploy

👉 Detailed guide: Claude Code Skills Complete Guide


Best Practices

1. Keep Context Clean

Use /clear to clear conversation history after completing each task

Old conversation history consumes tokens and can confuse Claude.

2. Use Plan Mode

For complex tasks, enter Plan Mode first (Shift+Tab)
Let Claude research before taking action

3. Give Clear Instructions

Bad: “Improve this function”

Good: “Refactor the calculateTotal function to use reduce instead of a for loop, and add TypeScript types”

4. Use Test-Driven Development

You: Write tests first, confirm they fail, then implement the feature to make tests pass

Claude performs best when it has clear test targets.

5. Use Built-in Tools

CommandPurpose
/initInitialize CLAUDE.md
/costCheck token usage
/memoryManage memory
/modelSwitch models

FAQ

Q: Claude won’t execute my command?

A: Check permission settings. Claude may be waiting for your confirmation. Type y or a (accept all).

Q: How to reduce costs?

A:

  1. Use /clear to clear unnecessary history
  2. Use Shift+Tab to plan before executing
  3. Use Haiku model for simple tasks

Q: Claude’s generated code has errors?

A:

  1. Provide more context (related files)
  2. Use test-driven development
  3. Clearly indicate errors, let Claude fix them

Q: How to use with a team?

A:

  1. Add CLAUDE.md to version control
  2. Add .claude/ directory to version control (exclude settings.local.json)
  3. Use project scope for MCP settings

Q: Which programming languages are supported?

A: Claude Code supports all major programming languages, including but not limited to:

  • JavaScript/TypeScript
  • Python
  • Go
  • Rust
  • Java/Kotlin
  • C/C++
  • Swift
  • PHP
  • Ruby

Next Steps

Congratulations on completing the Claude Code basics! Recommended reading:

  1. Hooks Complete Guide - Build automated workflows
  2. MCP Setup Guide - Extend Claude’s capabilities
  3. Agents Complete Guide - Create custom agents
  4. Director Mode Methodology - Advanced development mode

Resources


Last updated: 2026-01-19