What is Claude Code
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.
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.
Commands
Most day-to-day work is managing context and sessions. These are the ones worth knowing first:
| Command | What it does | When |
|---|---|---|
/compact | Compresses the conversation into a summary, keeping the same topic | Staying on one task while context fills up |
/clear | Full reset, clean start | Switching to a new topic |
/model | Switch between models | Matching the model to the task |
/review | Code review of your changes | When finishing a feature |
/resume | Continue a previous session | Returning to unfinished work |
/rewind | Go back to an earlier point in the conversation or code | Undoing Claude's changes |
/config | Settings (theme, model, preferences) | Personalizing |
/doctor | Diagnose your setup when something isn't working | Troubleshooting |
/help | List all available commands | When you forget |
/btw | A quick side question that doesn't enter the conversation history or pollute the task | A short question mid-work |
/init | Generate a draft CLAUDE.md from your code | Optional, see the CLAUDE.md chapter |
Not every command is available in every environment - some depend on platform or version. Type /
to see exactly what you have.
Keyboard shortcuts
| Shortcut | What it does |
|---|---|
Shift + Enter | New line without sending the message |
Shift + Tab | Cycle through permission modes (including Auto and Plan) |
Esc | Cancel the current input, or stop Claude mid-action |
Ctrl + C | Cancel the running operation |
Ctrl + R | Search command history |
Tab | Autocomplete file names, and accept suggestions shown in gray text |
↑ / ↓ | Scroll through your previous messages |
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:
| Method | How |
|---|---|
| Drag | Drag a file into the terminal window - the path appears automatically in the input line. |
| Type a path | Type a file name or full path (with @ you get autocomplete). |
| Paste a screenshot | Capture a screenshot (Win + Shift + S) and paste it directly with Ctrl + V - Claude sees the image. |
CLAUDE.md
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.
# 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
Keep the file short and focused, under 200 lines. That's enough for most projects.
Custom commands & Skills
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)
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
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.
---
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
Workflows
The three pillars
Modular structure
Each feature in its own file. Past 300 lines? You probably need to split.
One task per session
A clean session keeps quality high. A polluted session drags Claude into wrong associations. Done? /clear.
Understand the building blocks
Before you prompt: what data flows in? What's the expected output? Plan, then write.
The development cycle
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.
Permissions
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.
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.
Project-level settings override global ones. If a tool is denied in the project, no global rule can allow it.
Permission modes
| Mode | Behavior |
|---|---|
default | Asks for approval on first use of each tool |
plan | Read-only - Claude analyzes and plans, changes nothing |
auto | Automatically decides what's safe to approve |
acceptEdits | Auto-approves file edits for the session |
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.
{
"permissions": {
"allow": [
"Read",
"Grep",
"Glob"
]
}
}
Example: solo developer - trust most tools
For personal projects, minimum interruptions. Worth putting in your global settings.
{
"permissions": {
"allow": [
"Bash(npm *)",
"Read",
"Edit",
"Grep",
"Glob",
"WebFetch",
"WebSearch"
],
"deny": [
"Bash(rm -rf *)",
"Bash(sudo *)"
]
}
}
Plugins & MCP
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:
# UI design system
/plugin install frontend-design@claude-plugins-official
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.
Choosing a model
Switch between models with /model. A simple rule of thumb:
| Model | Good for |
|---|---|
| Opus | Complex architecture, planning, hard problems |
| Sonnet | Routine coding, most tasks |
| Haiku | Fast, mechanical tasks |
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.
Sub-agents
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.
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.
FAQ
Is Claude Code free?
What's the difference between Commands and Skills?
What happens when context fills up?
/compact manually to stay on the same topic, or /clear to start clean on a new task.Does Claude index all my code?
Claude changed something and I want to go back
/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?
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?
@ 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?
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.