Introduction to Claude Code

Get the most out of
Claude Code

Everything you need to work productively with Claude Code - commands, shortcuts, CLAUDE.md, Skills, permissions and workflows. Copy-paste ready examples.

11
chapters
7
copy-paste examples
100%
terminal
01

What is Claude Code

A coding tool that lives in your terminal.

Claude Code takes a natural-language request, reads your project files, edits them and runs commands - all directly from the terminal, with no copy-pasting into a chat window. It doesn't pre-index your code; it reads only what it needs, on demand, so it works well at any project size.

💡 Opening tip

Instead of approving every action manually, press Shift + Tab to cycle through permission modes. Switching to Auto is recommended - it decides what's safe to run automatically and saves endless clicks. Type / at any time to see the available commands.

When to use it - and when not

✓ Great for

Working with files, data analysis, development, automation - and generally any task of 10+ minutes that has clear steps.

Less suited to

General advice, a one-off question, quick research, brainstorming, writing an email, or generating images and videos. A regular chat is faster for those.

02

Commands

The built-in commands you'll use every day.

Most day-to-day work is managing context and sessions. These are the ones worth knowing first:

CommandWhat it doesWhen
/compactCompresses the conversation into a summary, keeping the same topicStaying on one task while context fills up
/clearFull reset, clean startSwitching to a new topic
/modelSwitch between modelsMatching the model to the task
/reviewCode review of your changesWhen finishing a feature
/resumeContinue a previous sessionReturning to unfinished work
/rewindGo back to an earlier point in the conversation or codeUndoing Claude's changes
/configSettings (theme, model, preferences)Personalizing
/doctorDiagnose your setup when something isn't workingTroubleshooting
/helpList all available commandsWhen you forget
/btwA quick side question that doesn't enter the conversation history or pollute the taskA short question mid-work
/initGenerate a draft CLAUDE.md from your codeOptional, see the CLAUDE.md chapter
💡 Tip

Not every command is available in every environment - some depend on platform or version. Type / to see exactly what you have.

03

Keyboard shortcuts

The shortcuts worth remembering from the start.
ShortcutWhat it does
Shift + EnterNew line without sending the message
Shift + TabCycle through permission modes (including Auto and Plan)
EscCancel the current input, or stop Claude mid-action
Ctrl + CCancel the running operation
Ctrl + RSearch command history
TabAutocomplete file names, and accept suggestions shown in gray text
↑ / ↓Scroll through your previous messages
💡 Tip

Even if you type a plain path, Claude will open the file itself. Typing @ before the path adds autocomplete as you type (fewer typos) and explicitly loads the file into context - more convenient and safer.

Attaching files and images

There are three handy ways to give Claude a file or image to look at:

MethodHow
DragDrag a file into the terminal window - the path appears automatically in the input line.
Type a pathType a file name or full path (with @ you get autocomplete).
Paste a screenshotCapture a screenshot (Win + Shift + S) and paste it directly with Ctrl + V - Claude sees the image.
04

CLAUDE.md

The context file that tells Claude how your project works.

Claude reads CLAUDE.md at the start of every session. It's where you put the project's architecture, code standards, run commands, and any rule you want Claude to follow. It's the big difference between Claude guessing and Claude knowing your project.

In an existing project you can run /init - Claude scans the code and generates a draft based on the conventions it detects. It's not mandatory: you can simply write the file by hand. Either way, review the result and fill in what Claude can't know on its own.

Where to put it

At the project root as CLAUDE.md (shared with your team), or at the user level (global) so it applies across all your projects.

CLAUDE.md - template
# Project: [name]

## What this is
[one sentence: what the system does and who it's for]

## Stack
- language / framework + version
- database, main libraries

## How to run
- local:  [command]
- tests:  [command]
- build:  [command]

## Where things live
- main code:        [path]
- models / types:   [path]
- tests:            [path]

## House rules
- run tests after every change
- keep files under 300 lines, otherwise split
- don't change existing behavior without saying so explicitly
💡 Tip

Keep the file short and focused, under 200 lines. That's enough for most projects.

05

Custom commands & Skills

Turn repeated instructions into a single command.

If you find yourself giving Claude the same instructions over and over, turn them into a permanent file. It's always a single markdown file - the main difference is whether you added a small header at the top (and which folder it lives in).

Command

A plain md file, no header. You run it manually by typing /name. The simplest option - start here.

Skill

The same md file, but with a short header at the top (between two --- lines) holding a name and description. The description is what lets Claude decide on its own when to run it.

That header is called frontmatter: a few lines between --- and --- right at the start of the file. Without it - a command you run manually. With it - Claude reads the description and runs the skill on its own when it's relevant. Nothing beyond markdown is required.

A manual command (no header) is saved as .claude/commands/<name>.md. A Skill (with a frontmatter header) is saved at .claude/skills/<name>/SKILL.md. Either way you can save it at the project level (in the project's .claude folder) or at the user level (global, in ~/.claude) so it's available across all your projects. You can use $ARGUMENTS to receive input at invocation time.

Example: code audit (manual command, no header)

.claude/commands/audit.md
Audit $ARGUMENTS for problems.

Group the findings by severity:
- Correctness: wrong results or unhandled inputs
- Safety: anything that can crash or lose data
- Clarity: confusing names, dead code

Give the location of each finding and a one-line fix.
List only - do not change any code yet.

Example: documenting functions

.claude/commands/document.md
Add short documentation to every public function in $ARGUMENTS.

For each one, note:
- What it does, in one sentence
- What each input expects
- What it returns or changes

Follow the file's existing style. Don't touch the logic.

Example: a Skill with automatic invocation (with a frontmatter header)

Note the lines between --- at the top of the file - that's the header. The description in it is what Claude reads to decide when to load the skill on its own.

.claude/skills/naming-check/SKILL.md
---
name: naming-check
description: Reviews variable and function names for clarity. Use when the user asks to rename, clean up, or review naming.
---

When checking names:
1. Flag vague ones (data, temp, x, helper, doStuff)
2. Suggest a name that states what the thing is or does
3. Keep the project's existing casing convention
4. Names only - never change behavior
06

Workflows

The mental models that separate productive use from frustrating use.

The three pillars

1

Modular structure

Each feature in its own file. Past 300 lines? You probably need to split.

2

One task per session

A clean session keeps quality high. A polluted session drags Claude into wrong associations. Done? /clear.

3

Understand the building blocks

Before you prompt: what data flows in? What's the expected output? Plan, then write.

The development cycle

Plan Code Test /compact · /clear
⚡ Pro tip

At the end of each round you have two options: if you're continuing the same topic, /compact compresses the conversation and keeps the context; if you're moving to a new task, /clear opens a clean page. That keeps context focused and stops Claude from being dragged into old context.

07

Permissions

Advanced topic - controlling what Claude Code may and may not do.

Claude Code uses a tiered permission system: read-only tools (like Read and Grep) need no approval; system commands and file edits do. Rules are checked in the order deny → ask → allow, and a block always wins. Most users can simply stay on Auto mode and not touch anything - this chapter is for those who want precise control.

💡 The lines scrolling by aren't errors

When you see lines like Read, Edit or Bash appear during work - those are Claude's tools, not yours. That's how it reads files, edits them and runs commands. No need to respond - just let it finish.

Where to configure

Settings live in a settings.json file at two levels: project level as .claude/settings.json (shared with the team), and the user level (global) that applies to all your projects.

💡 Tip

Project-level settings override global ones. If a tool is denied in the project, no global rule can allow it.

Permission modes

ModeBehavior
defaultAsks for approval on first use of each tool
planRead-only - Claude analyzes and plans, changes nothing
autoAutomatically decides what's safe to approve
acceptEditsAuto-approves file edits for the session
⚠️ Back up before working

In automatic modes Claude may change source files. Save a copy or work under version control (git) before you start - so there's always somewhere to go back to.

Example: minimal - auto-approve read-only

A safe starting point. Claude reads the code freely but asks before running commands or editing.

.claude/settings.json (project)
{
  "permissions": {
    "allow": [
      "Read",
      "Grep",
      "Glob"
    ]
  }
}

Example: solo developer - trust most tools

For personal projects, minimum interruptions. Worth putting in your global settings.

settings.json (global)
{
  "permissions": {
    "allow": [
      "Bash(npm *)",
      "Read",
      "Edit",
      "Grep",
      "Glob",
      "WebFetch",
      "WebSearch"
    ],
    "deny": [
      "Bash(rm -rf *)",
      "Bash(sudo *)"
    ]
  }
}
08

Plugins & MCP

Extending Claude Code - in brief.

Plugins - a single package bundling skills, hooks and MCP servers together, easy to share and install. You enable and install them with the /plugin command.

MCP servers - connect Claude to external tools: browsers, databases and APIs.

Plugins

Run /plugin inside a session to open the plugin manager and see what's available, or install directly:

Inside Claude Code
# UI design system
/plugin install frontend-design@claude-plugins-official
💡 Tip

You don't need MCP to get started. Most day-to-day work happens with no external server - add one only when there's a real need.

09

Choosing a model

Match the model to the kind of task.

Switch between models with /model. A simple rule of thumb:

ModelGood for
OpusComplex architecture, planning, hard problems
SonnetRoutine coding, most tasks
HaikuFast, mechanical tasks
⚡ Pro tip

Run the main session on a strong model for quality, and set parallel sub-tasks to a lighter one - depth where you need it, speed everywhere else.

10

Sub-agents

Advanced topic - when to split work across parallel agents, and when it's overkill.

A sub-agent is a copy of Claude that gets its own task and runs in a separate context, sometimes in parallel with others. The main session divides the work, each agent focuses on its part and returns the result. The upside: broad, fast coverage without overloading a single conversation. The downside: each agent has its own cost and setup, so it's not always worth it.

✓ Worth it

Scanning or fixing dozens of files in parallel, independent tasks that need different specializations, and long work (30+ minutes) that splits into clear parts.

Overkill

A simple question, a five-minute task, or anything you can just write directly. In those cases a sub-agent only adds overhead.

💡 Tip

Combine it with model choice: run the main session on a strong model, and set the parallel sub-agents to a lighter one - depth where needed, speed elsewhere.

11

FAQ

Short answers to the recurring questions.
Is Claude Code free?
You need a Pro subscription, a Max subscription, or Anthropic API credits. Up-to-date details are on Anthropic's site.
What's the difference between Commands and Skills?
Commands are simple markdown files run manually with a slash. Skills add YAML frontmatter, automatic invocation based on context, and support for scripts and accompanying assets. Both work, and Skills are the more advanced approach.
What happens when context fills up?
Claude compacts automatically as it nears the limit, summarizing the history to free up room. You can also run /compact manually to stay on the same topic, or /clear to start clean on a new task.
Does Claude index all my code?
No. It navigates the code on demand with tools like Read, Grep and Glob, reading files only when needed. That's why it works well at any project size with no upfront indexing step.
Claude changed something and I want to go back
Use /rewind to return to an earlier point in the conversation or code and undo changes it made.
How do I make Claude plan before it writes code?
Press Shift + Tab and switch to Plan mode - a read-only mode where Claude analyzes and proposes a plan without touching files. Approve the plan, and only then move to implementation.
Can I point Claude at a specific file?
Yes - just paste the path and Claude will open the file itself. If you type @ before the path you get autocomplete as you type (fewer typos) and the file is explicitly loaded into context.
Can Claude work in other languages?
Yes - just talk to it in your language and it replies in kind, and you can pin this with a line in CLAUDE.md. Worth knowing: non-English languages (for example Hebrew) can use roughly 1.5-2x more tokens than English, so for heavy work English stretches your quota further.