Handbook · Updated 23 Oct 2026

The Claude Handbook

From your first chat to your own agent. Hand-drawn diagrams, real commands, and things to click.

Start reading
Levels
3
Modules
10
Chapters
44
How to read this book
Turn the pagesThe cards at the foot of every page, or the arrow keys.
Jump anywhereThe menu lists every module and chapter, with search. « hides it.
See your progressEach module in the menu counts the chapters you have opened, on this device.
Sources: code.claude.com/docs (setup, MCP, plugins, skills, hooks), claude.com/docs/connectors, platform.claude.com/docs (models, tool use), modelcontextprotocol.io (spec 2026-07-28), and each AI company's release pages. Checked 14 Oct 2026; new and updated chapters checked 23 Oct 2026. Diagrams drawn with rough.js in the Excalidraw style.

Contents

What is inside

Every topic on one map, then every chapter with its page number.

Every topic, grouped by level. Click one to open its chapter.
Module 1 · Meet Claude
B11 of 5 in this module

What is Claude

What Claude is, what it can do for you, and where you can use it.

Claude is an AI assistant made by Anthropic. You type or speak a request in plain English. Claude writes, explains, plans, summarises, reads your files, and writes code.

What happens when you send a message. Your app sends the message out. The thinking happens on Anthropic's servers.

Where you can use it

WhereGood forPlan needed
Website: claude.aiChat from any browserFree works
Desktop app (Mac, Windows)Chat, plus a Code tab for codingFree works for chat
Phone app (iOS, Android)Chat on the goFree works
Claude Code (terminal, VS Code, JetBrains, web)Building and fixing softwarePro, Max, Team or Enterprise

The Claude models

A model is the brain that writes the answer. Bigger models think harder. Smaller models answer faster.

ModelIn plain words
Claude Fable 5.1The most capable. For the hardest thinking and long, multi-step jobs. Slowest.
Claude Opus 5.5Very strong at long coding and knowledge work.
Claude Sonnet 5.5The everyday balance of speed and smarts.
Claude Haiku 5.5The fastest and lightest. Good for quick, simple tasks.

You pick the model from a menu near the message box. If you're not sure, keep the default.

Module 1 · Meet Claude
B22 of 5 in this module

Plans and usage limits

Which plan fits you, what each one adds, and how usage limits reset.

Claude has a free plan and several paid ones. Paid plans add Claude Code, Cowork, Research and much more usage. Prices below were checked on 23 Oct 2026; confirm them on claude.com/pricing before you buy.

PlanPrice (US$ a month)Who it's forAdds
Free0Trying ClaudeChat on web, desktop and phone, web search, file creation, memory, Artifacts, connectors
Pro20 monthly, 17 a month billed yearlyOne person, regular useClaude Code, Cowork, Research, more models, Claude in Chrome
Max100 (5x Pro's usage) or 200 (20x)Heavy daily useEverything in Pro, much more usage, priority access
Team25 a seat monthly, 20 yearly; Premium seats cost moreSmall teamsShared projects, admin controls, single sign-on
EnterprisePer seat plus usage, through salesLarge organisationsAudit logs, custom data retention, role-based access

How usage limits work

  • A session limit that resets every five hours, and a weekly limit that resets once a week.
  • What you use depends on the length of the chat, the files you attach, the features (Research uses more), the model and the effort level.
  • To make your usage go further: start a new chat for a new topic, attach only the files you need, and use a lighter model for simple jobs.
Module 1 · Meet Claude
B33 of 5 in this module

Install the desktop app

Install the Claude desktop app on a Mac or Windows PC and sign in.

Check your computer first: macOS 13 or newer, or Windows 10 (version 1809) or newer. A Linux version is in beta.

  1. Download the installer: Claude for Mac. One file works on Intel and Apple-chip Macs.
  2. Open the downloaded .dmg file and drag Claude into Applications.
  3. Open Claude from Applications.
  4. Sign in with your Claude account, or create one.
  5. Type your first message.
The Code tab. The desktop app has a Code tab that runs Claude Code without a terminal. You choose a folder, pick a model, and describe the task. The Code tab needs a Pro plan or higher.
Module 1 · Meet Claude
B44 of 5 in this module

Claude on your phone

Get Claude on your phone and try voice, photos and widgets.

The Claude app is free to download on every plan. Your chats, projects, memory and settings sync between your phone, the desktop app and the web.

PhoneGet itNeeds
iPhone and iPadApp Store: search Claude by AnthropiciOS or iPadOS 18 or newer
AndroidGoogle PlayAndroid 8.0 or newer

Or open claude.ai/mobile on your phone.

Worth trying on a phone

  • Voice mode. Talk to Claude hands-free and hear it answer. Switch between voice and text in the same chat.
  • Photos. Take a photo of a sign, a form or a whiteboard and ask about it.
  • Dictation. Speak instead of typing a long prompt.
  • Widgets and shortcuts. Start a chat from your home screen, or from iOS Shortcuts.
Module 1 · Meet Claude
B55 of 5 in this module

Your first chats

Write your first prompts and see what a good one looks like.

A good prompt has three parts. Say what you need, give the background, and say what the answer should look like. The weak prompt below has only the first part. The better prompt has all three.

PartWeak promptBetter prompt
The task"Write an email.""Write an email asking my manager for Friday off."
The backgroundMissing, so Claude has to guess"I finished the report early. Keep it polite and short."
The shapeMissing, so Claude picks any length"Under 80 words, with a subject line."

Prompts to try today

  • "Summarise this PDF in 5 bullets." (attach the file)
  • "Make a weekly meal plan for two, as a table."
  • "Explain this error message in simple words."
  • "Ask me 5 questions, then write my cover letter."
Check the important facts. Claude can be wrong. For money, health or legal questions, check the answer with a trusted source.
Module 2 · Work with Claude
B61 of 7 in this module

Prompting well

Six habits that turn a vague request into a useful answer.

Anthropic's own advice comes down to one idea: treat Claude like a brilliant new colleague who knows nothing about your situation. If a colleague would be confused by your request, Claude will be too.

HabitWeakBetter
Be clear and direct"Fix this email.""Make this email shorter and more polite. Keep the deadline of 3 May."
Say why"No jargon.""No jargon: the readers are parents, not engineers."
Say what the answer should look like"Compare these phones.""Compare these phones in a table: price, battery, camera. Then one line on which to buy."
Show an example"Write product descriptions.""Write descriptions like this one: [example]. Same length and tone."
Give it a role"Check my contract.""You are a careful contracts lawyer. List the clauses that could cost me money."
Put long documents firstQuestion, then a 40-page reportThe report first, your question at the end

Two more tricks

  • Label the parts of a long prompt with tags such as <instructions>, <context> and <document>, so Claude knows which text is which.
  • Steps in order: when the order matters, write the steps as a numbered list.
Not happy with an answer? Don't start again. Say what was wrong: "Too long, and drop the last section." Claude keeps the conversation in mind.
Module 2 · Work with Claude
B72 of 7 in this module

Projects

Keep files, instructions and chats for one piece of work together.

A project is a workspace for one piece of ongoing work, such as a course, a client or a book. It keeps its own chats, its own files and its own instructions, so you don't have to explain the background every time.

  1. In the sidebar, open Projects and click New project. Give it a name.
  2. Add project knowledge: upload the documents Claude should know, such as a style guide or a syllabus. Each file can be up to 30 MB.
  3. Write project instructions, for example "Answer as a tutor for first-year students. Short answers, one example each."
  4. Start chats inside the project. Every chat sees the files and follows the instructions.
FactDetail
MemoryEach project has its own memory, kept apart from your other chats
Lots of filesOn paid plans, a project can hold much more than one chat can, because Claude searches the files for what it needs
SharingOn Team and Enterprise, share a project with colleagues as "Can view" or "Can edit"
Module 2 · Work with Claude
B83 of 7 in this module

Artifacts

Get documents, charts, diagrams and small apps you can share.

An artifact is something Claude makes for you to use or show someone: a document, a slide deck, a chart, a diagram, a web page or a small working app. It opens in a panel beside the chat, where you can view it, change it and share it.

Ask forYou get
"Make a one-page study plan for my exams."A document you can edit and download
"Turn this data into a bar chart."A chart
"Draw a flowchart of our hiring process."A diagram
"Build a quiz with ten questions on photosynthesis."A small interactive app
  • Private first. An artifact is visible only to you until you share it. Sharing gives it its own link.
  • AI-powered artifacts can use Claude themselves, so the people using them can ask questions or get feedback.
  • Turn it on. Artifacts need Settings → Capabilities → Code execution and file creation.
Module 2 · Work with Claude
B94 of 7 in this module

Files, web search and Research

Attach files, let Claude search the web, and run deep Research.

Attach files

Drag files into the chat, or click +. Claude reads them and answers about them.

FactLimit
Files per chatUp to 20
Size per fileUp to 500 MB
DocumentsPDF (up to 1,000 pages), Word, CSV, text, HTML, EPUB, JSON, and Excel (with code execution on)
ImagesJPEG, PNG, GIF, WebP

Web search

Claude can look things up and show its sources. Click + and turn on Web search. On Team and Enterprise, an owner must first allow it for the organisation.

Research

Research goes further: Claude runs many searches, each building on the last, decides what to look into next, and writes a report with sources. It can also search your connected tools, such as Google Drive. Turn it on with + → Research. It is on paid plans and uses your limits faster.

Module 2 · Work with Claude
B105 of 7 in this module

Memory and incognito chats

Let Claude remember you, see what it keeps, and chat off the record.

With memory on, Claude remembers useful things about you and your work from past chats, such as your job or how you like answers written. You can also tell it directly: "Remember that I teach year-9 science."

ToGo to
Turn memory on or offSettings → Memory → Generate memory from chats
See and edit what it remembersSettings → Memory → Topics, or ask Claude in a chat
Pause itKeeps what is saved, but stops using it
Reset itDeletes every memory for good, including project memories

Incognito chats

For a chat you don't want kept, start a new chat and click the ghost icon. An incognito chat isn't saved to your history and isn't used for memory. Every plan has it.

Module 2 · Work with Claude
B116 of 7 in this module

App features

The other tools in the app, on one page.

Projects

Keep related chats and files together, so Claude has the background every time.

Artifacts

Claude makes a document, page, chart or small app in a panel you can edit and share.

File uploads

Attach PDFs, images, spreadsheets or code and ask about them.

Web search

Claude looks things up online and shows its sources.

Memory

Claude remembers useful details about you between chats.

Extended thinking

Claude thinks longer before answering. Use it for hard problems.

Connectors

Link Google Drive, Notion, GitHub, Slack and more, so Claude can use them.

Skills

Steps for a job you repeat, written once. Claude follows them every time that job comes up.

Cowork

Give Claude a bigger task and it works on it in the background.

Voice

Talk to Claude and hear it answer.

Claude in Chrome

A browser extension, so Claude can help on the page you're viewing.

Module 2 · Work with Claude
B127 of 7 in this module

Privacy and your data

Decide whether your chats train Claude, and how long data is kept.

On Free, Pro and Max, you choose whether your chats help train Claude. Team and Enterprise work differently.

QuestionAnswer
Where is the setting?Settings → Privacy → Help improve our AI models
If I turn it off?New chats and coding sessions aren't used for training. Chats are kept for 30 days.
If I leave it on?Chats may be used to train models and kept for up to 5 years, with personal details removed.
Deleted chats?Gone from your history at once, and from Anthropic's systems within 30 days.
Incognito chats?Kept for 30 days, then deleted.
Team and Enterprise?Not used for training by default. Enterprise can set its own retention period.
Good habit. Don't paste passwords, card numbers or other people's private details into any AI chat, whatever the settings.
Module 3 · Choose the right tool
B131 of 2 in this module

Which Claude to use

Chat, Claude Code or Cowork: pick the one that fits the job.

Claude comes in three products, and each fits a different kind of work. Pick by what you want at the end, not by habit.

When to use what. Each column shows what the product is best for and how you work with it.
  1. Claude app (chat). Web, desktop or phone. You steer every reply. Claude works only inside the chat unless you add connectors.
  2. Claude Code. Reads your code, edits files and runs commands. Runs in a terminal, the desktop app's Code tab, VS Code, JetBrains or the web. The terminal is a hurdle if you've never used one. Paid plans only.
  3. Cowork. A tab in the Claude desktop app (Mac and Windows), plus cloud sessions. You describe the outcome and review at the end, so give clear instructions and only the folders it needs. Paid plans only.

Try it: which one fits?

Answer three questions to see which one fits your task.

Module 3 · Choose the right tool
B142 of 2 in this module

Other frontier models

What a frontier model is, and the other leading ones today.

A frontier is the far edge of explored land. In AI, the frontier is the edge of what AI can do today. Frontier models are the newest, most capable models that sit at that edge, and each new release pushes the edge further out. Claude is one of several.

This table was checked on 14 Oct 2026, and these models change almost every month.

CompanyTop model nowApp to try itKnown forOpen weights
AnthropicClaude Fable 5.1, Opus 5.5Claude, claude.aiWriting, careful reasoning, codingNo
OpenAIGPT-6 family (Astra, Sol, Luna)ChatGPTThe most widely used chatbot. Paid plans get Sol, free plans get Luna.No
GoogleGemini 4 ArgonGemini appCoding and research; built into Gmail and DriveNot checked
xAIGrok 4.7Grok, grok.comCoding and knowledge workNot checked
MetaMuse Spark (replaced Llama as the lead model)Meta AI, meta.aiBuilt into WhatsApp, Instagram and FacebookNo (older Llama: yes)
Mistral (France)Mistral Large 4 (preview)Vibe, chat.mistral.aiEuropean lab, long memoryYes (weights coming soon)
DeepSeek (China)DeepSeek V4-Pro, V4.1-FlashDeepSeek appStrong models at low costYes (Flash)
AlibabaQwen3.8-MaxQwen Chat, chat.qwen.aiLarge open models for coding and office workYes

Open weights means anyone can download the model and run it on their own machines. Closed models run only through the company's app or API.

Module 4 · Start Claude Code
I11 of 4 in this module

Claude Code in the terminal

Install Claude Code, start it in a project, and learn the first commands.

Claude Code is Claude for building software. Claude Code reads the files in a folder, edits them, and runs commands. Before risky steps, Claude Code asks you first.

You need: a Pro, Max, Team or Enterprise plan, 4 GB of memory or more, and an internet connection. The Free plan does not include Claude Code.

Open a terminal

ComputerHow
MacPress Cmd + Space, type Terminal, press Enter.
WindowsClick Start, type PowerShell, press Enter.

Install

curl -fsSL https://claude.ai/install.sh | bash

Homebrew and WinGet work too: brew install --cask claude-code or winget install Anthropic.ClaudeCode.

Start and sign in

  1. Go to a project folder: cd Documents/my-project
  2. Type claude and press Enter.
  3. A browser window opens. Sign in with your Claude account.
  4. Back in the terminal, ask: "What does this project do?"

Commands worth knowing

TypeWhat it does
/helpShows every command.
/Lists commands and skills.
/clearStarts a fresh conversation.
/code-reviewReviews your changes.
/mcpShows connected MCP servers, their status, and sign-in.
/pluginFinds and installs plugins.
/exitLeaves Claude Code.

Update and uninstall

The standard install updates itself. For Homebrew or WinGet, run brew upgrade claude-code or winget upgrade Anthropic.ClaudeCode. To uninstall on Mac or Linux:

rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
No terminal? Claude Code also runs in the desktop app's Code tab, in VS Code and JetBrains editors, and on the web at claude.ai/code.
Module 4 · Start Claude Code
I22 of 4 in this module

Claude Code in your editor, desktop and web

Run the same Claude Code in VS Code, JetBrains, the desktop app or the web.

The terminal is one way in. The same Claude Code also runs inside your code editor, in the desktop app, and in the browser. Pick the one that fits how you work.

WhereHow to startWhat you getWhere the code runs
VS Code (also Cursor)Install Claude Code from the VS Code MarketplacePlans to review before edits, inline diffs, @-mention files with line ranges, several chats in tabsYour computer
JetBrains (IntelliJ, PyCharm and others)Install the CLI, then the Claude Code plugin from the JetBrains Marketplace. Open it with Cmd+Esc (Mac) or Ctrl+EscChanges shown in the IDE's own diff viewer, your selection shared with Claude, editor errors passed to ClaudeYour computer
Desktop app, Code tabOpen the Claude desktop app and choose CodeDiff viewer, terminal, file editor, several sessions side by side. Choose Local or Cloud when you startYour computer, or Anthropic's cloud
Web, claude.ai/codeSign in and connect GitHubClones your repository, works on a branch and pushes it. Keeps running after you close the browserAnthropic's cloud

All four need a paid plan. From a terminal, claude --cloud "fix the flaky login test" hands a task to a cloud session.

Which one? Use your editor if you live in it, the desktop app if you'd rather not touch a terminal, and the web for long jobs you want to leave running.
Module 4 · Start Claude Code
I33 of 4 in this module

How Claude Code works

How Claude Code reads, plans, acts and checks until a task is done.

Claude Code works in a loop. Claude Code reads, plans, acts, and checks, and repeats until the task is done. You stay in charge of every risky step.

The agent loop. Red marks the step where you approve or refuse.
Module 4 · Start Claude Code
I44 of 4 in this module

Effort, modes and context

Set how hard Claude thinks, how much it may do alone, and what it holds in mind.

Three controls decide how Claude Code works on a task: effort (how hard Claude thinks), permission mode (how much it may do without asking) and the context window (how much it can hold in mind at once).

Effort levels

Effort sets how much Claude thinks on each step. More effort means deeper reasoning, but slower answers and more tokens used, so more of your plan's usage or a higher bill. Drag the slider to compare the levels.

Try it: drag the slider

Thinking depth
Speed
Token use

The bars show the direction of each change. They are not measurements.

How to set itWhat it does
/effortOpens a slider. Press Enter to save it as your default, or s for this session only.
/effort highSets a level directly. /effort auto goes back to the model's default.
claude --effort highStarts a session at that level.
ultrathinkPut this word anywhere in a prompt for deeper thinking on that one turn. Your effort setting stays the same.
effort: highIn a skill's or subagent's frontmatter. That skill or subagent runs at that level.

The default is medium on Opus 5.5, Sonnet 5.5 and Haiku 5.5, and high on most other models, including Fable 5.1. On these newer models thinking can't be switched off. Effort decides how much of it happens.

Permission modes

Press Shift+Tab to move through the modes. The current mode shows at the bottom of the screen.

ModeWhat Claude may do without askingUse it when
defaultRead files. It asks before editing a file or running a command.You want to review every action.
acceptEditsRead and edit files, and run common file commands.You trust the task and will review the changes at the end.
planRead and explore, then write a plan. No edits until you approve the plan.A big or unclear change. Agree on the approach first.
autoEverything, with safety checks running in the background. Shown only where available.Long tasks where stopping to ask would slow you down.

The context window

The context window is Claude's working memory for one conversation. It holds your messages, the files Claude has read, command output, your CLAUDE.md and the one-line descriptions of your skills. When it fills up, older detail gets squeezed out.

TypeWhat it does
/contextShows what is filling the window right now, by category.
/compactSummarises the conversation to free space. Claude Code also does this by itself when the window is nearly full.
/clearStarts a fresh conversation in the same folder. Use it between unrelated tasks.
Module 5 · Daily workflow
I51 of 5 in this module

Everyday workflows

The everyday loop, and the prompts that start the common jobs.

Most good sessions follow the same shape: understand, plan, change, check, save. The diagram shows the loop. The table gives the prompts that start each common job.

The everyday loop. Red marks the step where you approve the plan.
  1. Explore. Ask Claude to read the relevant code and explain it. No edits yet.
  2. Plan. Switch to plan mode (Shift+Tab or /plan). Claude proposes the change. You read it and approve, or ask for changes.
  3. Change. Claude edits the files. In default mode you approve each edit.
  4. Check. Claude runs the tests or the app. If something fails, it goes back to step 3.
  5. Save. Claude commits, and can open a pull request for review.
JobA good first prompt
Understand a new codebase"Give me an overview of this project, then walk me through how a request reaches the database."
Fix a bug"Here is the error: [paste]. Find the cause, explain it, then fix it and add a test that fails without the fix."
Test first"Write failing tests for a discount rule: 10% off orders over 100. Don't write the code yet." Then: "Now make the tests pass."
Build a featureStart in plan mode: "Plan how to add CSV export to the reports page. List the files you'll change."
Module 5 · Daily workflow
I62 of 5 in this module

Git, branches and pull requests

Branches, commits and pull requests, in plain words.

Claude Code works with git the way you would. Ask in plain words and it runs the commands, so you don't need to remember them.

You sayWhat Claude does
"Make a branch for this work."Creates and switches to a new branch
"Commit these changes."Looks at the diff, writes a message describing it, and commits
"Open a pull request."Pushes the branch and opens a PR with a written description, using the GitHub CLI (gh) if you have it
"Rebase on main and fix the conflicts."Rebases, reads both sides of each conflict, and resolves them, asking when the intent is unclear

Later, claude --from-pr 1234 finds the sessions that worked on pull request 1234.

Good habit. Ask Claude to work on a branch, and read the diff before you let it commit. Commits are easy to undo; a pushed main branch is not.
Module 5 · Daily workflow
I73 of 5 in this module

Checkpoints and rewind

Undo a bad change with checkpoints, and know what rewind cannot undo.

Before each prompt you send, Claude Code takes a snapshot of the files it is about to change. If a change goes wrong, you can step back to any of those points.

  1. Press Esc twice on an empty prompt, or type /rewind.
  2. Pick the point in the conversation you want to go back to.
  3. Choose what to restore: code and conversation, conversation only (keep the code), or code only (keep the chat).
Rewind can undoRewind cannot undo
Edits Claude made with its file toolsChanges made by shell commands, such as a database migration, a deleted folder or a deploy
The conversation after that pointEdits you made yourself outside Claude Code
Up to the last 100 checkpoints in a sessionAnything already pushed or sent somewhere else
Checkpoints are not git. They are a quick local undo. Keep committing your work, because git is the history you share.
Module 5 · Daily workflow
I84 of 5 in this module

Work in parallel

Run several sessions at once without them editing over each other.

You can run several Claude Code sessions at once, for example one building a feature while another fixes a bug. Each needs its own copy of the files, or they will edit over each other. A git worktree gives each session that copy.

# terminal 1: a new worktree and branch for the feature
claude --worktree feature-auth
# terminal 2: a second, separate copy for the bug fix
claude -w fix-login
FactDetail
Where it lives.claude/worktrees/<name>/, on a new branch called worktree-<name>. Add .claude/worktrees/ to .gitignore.
When you exitA clean worktree is removed. If it holds work, Claude asks whether to keep it, and prints the command to come back to it.
SecretsA worktree starts without your .env files. List them in a .worktreeinclude file to copy them in.
Pick up laterclaude -c continues the last session; claude -r lets you choose one.
Long commandsPress Ctrl+B to send a running command or subagent to the background, and /tasks to see what is running.
Module 5 · Daily workflow
I95 of 5 in this module

Review before you ship

Check every change before anyone else sees it.

Three commands help you check Claude's work before anyone else sees it.

CommandWhat it showsUse it when
/diffEvery change made so far, line by line. You can comment on lines and send the comments back to Claude.Before every commit
/code-reviewA review of your branch against the base branch: bugs, risky changes, style problemsBefore opening a pull request
/security-reviewThe changes on your branch, checked for security weaknessesWhen the change touches logins, payments, user input or secrets
You are still the reviewer. These commands catch a lot, but read the diff yourself. Claude can be confidently wrong.
Module 6 · Shape Claude Code
I101 of 7 in this module

The five layers

The five layers that shape Claude Code, and the problem each one solves.

Claude Code's features stack in five layers. Each layer fixes a problem that a better prompt can't. The lower layers are the foundation, and each layer up gives you more control. Click a box to see its file, when it loads, and an example.

Each layer, the job it does, and when it loads. Click a box for details.
  1. CLAUDE.md, the memory layer. Standing project rules and conventions. Loaded in full at the start of every session.
  2. Skills, the knowledge layer. Steps, checklists and templates for a repeat job. Only the one-line description loads at the start. The full steps load when the task matches or you type /name.
  3. Hooks, the guardrail layer. Your own script, run every time a set event happens, such as before or after a tool. A rule in CLAUDE.md is advice Claude may miss. A hook always runs.
  4. Subagents, the delegation layer. A helper with its own context window and tool list. It does a side job and returns a summary. Subagents can start their own, up to three levels deep.
  5. Plugins, the distribution layer. A bundle of skills, subagents, hooks and MCP servers. One install gives the whole team the same setup.
  6. MCP servers. Not a layer of behaviour but the connection to the real world: issue trackers, web APIs, databases, files. Any layer can use the tools they add.

Check yourself: which layer?

Each question is a real problem. Pick the layer that solves it.

Module 6 · Shape Claude Code
I112 of 7 in this module

Claude Code folder structure

Every file Claude Code reads, where it lives, and who it affects.

Claude Code reads its files from two places: ~/.claude/ in your home folder, and your project folder. Each file has a scope, meaning who it affects. Most people only ever edit CLAUDE.md and settings.json. The rest is optional.

Same colour = same kind of file:instructionssettingsskillssubagentshooks, pluginsMCP, memorydashed = only you, out of git

Explore the folders

Click any file or folder. Use the buttons to show only one scope.

PROJECT SCOPE · my-project/

USER SCOPE · your home folder ~/

When two settings files disagree

The same setting can appear in several settings.json files. Claude Code uses the value from the highest level that sets it.

Settings precedence. The higher box wins.
  1. Managed settings. Set by your organisation. Nothing you set can override them.
  2. Command line. claude --settings '{...}' applies to that one session only.
  3. Project local (.claude/settings.local.json). Your personal changes for this project.
  4. Shared project (.claude/settings.json). The team's settings, committed to git.
  5. User (~/.claude/settings.json). Your settings for every project.
Lists add up. List settings such as permissions.allow are combined across all the files, not replaced. CLAUDE.md files don't override each other either: Claude Code loads them all together. Run /status to see which settings files loaded.
Module 6 · Shape Claude Code
I123 of 7 in this module

Write a good CLAUDE.md

Write the short briefing Claude reads at the start of every session.

CLAUDE.md is the briefing Claude reads at the start of every session. A good one is short, specific, and full of things Claude can't guess from the code.

# CLAUDE.md
# shop-api
Node 22, Express, Postgres. API handlers live in src/routes/.

## Commands
- Install: pnpm install
- Test: pnpm test (run before saying a task is done)
- Type check: pnpm tsc --noEmit

## Rules
- Use pnpm, never npm.
- Every new endpoint gets a test in tests/routes/.
- Never edit files in src/generated/.

@docs/architecture.md
DoDon't
Keep it under 200 lines. Longer files use more context and get followed less closely.Paste whole documents into it. Link them with @path instead.
Write commands Claude should run, and rules it should followRepeat what the code already shows
Move rules for one part of the code into .claude/rules/ with pathsLeave two rules that contradict each other
FactDetail
/initWrites a first CLAUDE.md by reading your project
/memoryOpens your CLAUDE.md files for editing
@path/to/filePulls another file in. Imports can nest up to four levels deep.
SubfoldersA CLAUDE.md in a subfolder loads when Claude first works with a file in that folder
AGENTS.mdIf your project already has one for other AI tools, Claude Code can read it instead
Advice, not a lock. Claude treats CLAUDE.md as context, so it can occasionally miss a rule. For something that must never happen, use a hook (chapter I15).
Module 6 · Shape Claude Code
I134 of 7 in this module

Skills

Save the steps for a job you repeat, so Claude follows them every time.

Think of a skill as a recipe card. Without one, you explain the same job to Claude every time: which file to read, what headings to use, how long to make it. With a skill, you write those steps once, and Claude follows them whenever that job comes up.

A skill is a folder with one file in it, SKILL.md. The top of the file holds a name and a one-line description. The rest holds the steps.

# .claude/skills/weekly-report/SKILL.md
---
name: weekly-report
description: Write my weekly status report. Use when I ask for a weekly update.
---
1. Read the notes in reports/notes.md.
2. Group the items under Done, In progress and Blocked.
3. Keep it under 200 words, in plain English.
StepWhat happens
1. You save the skillClaude Code sees only the skill's name and description. The steps stay unread, so they cost almost nothing.
2. You ask for the job"Write my weekly update" matches the description, so Claude opens the skill and reads the steps.
3. Claude follows the stepsSame headings, same length, every week.
Or: you call it by nameType /weekly-report. Text after the name reaches the skill as $ARGUMENTS.

Useful frontmatter

FieldWhat it does
descriptionWhen Claude should use the skill. The most important line: Claude matches tasks against it.
disable-model-invocation: trueOnly you can run it, by typing /name. Good for anything that deploys or sends.
allowed-toolsTools the skill may use without asking, such as Bash(git *)
argumentsNamed inputs, used in the steps as $name
effortThe effort level the skill runs at

A skill can carry helper files, such as a script or a template, in its folder. Skills in ~/.claude/skills/ work in every project; skills in a project's .claude/skills/ work for everyone who opens it.

Module 6 · Shape Claude Code
I145 of 7 in this module

Subagents

Hand side jobs to helpers that work in their own context window.

A subagent is a helper Claude hands a side job to. It works in its own context window with its own instructions and tools, then reports back a short summary. Your main conversation stays clean.

# .claude/agents/code-reviewer.md
---
name: code-reviewer
description: Reviews changed code for bugs. Use proactively after any code change.
tools: Read, Grep, Glob
model: inherit
---
You are a careful reviewer. List real bugs only, each with its file and line.
Ignore style unless it hides a bug.
FactDetail
Create oneAsk Claude to write it, or create the file in .claude/agents/ (team) or ~/.claude/agents/ (just you)
How it is pickedClaude delegates when a task matches the description. Add "use proactively" to encourage it.
Call one directlyType @ and pick it from the list, or write @agent-code-reviewer
ToolsThe tools line limits what it may use. A reviewer that can only read can't break anything.
Built inExplore searches code quickly without editing; Plan researches for plan mode
NestingA subagent can start its own subagents, up to three levels below your conversation
When to use one. Searching many files, reading long logs, or a second opinion. Not for a two-line change: the hand-off costs more than it saves.
Module 6 · Shape Claude Code
I156 of 7 in this module

Hooks

Run your own script at set moments, for rules that must never be skipped.

A hook is your own script that Claude Code runs at a set moment, every time, whatever Claude decides. Use hooks for rules that must never be skipped.

Where hooks run in a session. Red marks the hook that can block an action.
  1. SessionStart. The session begins or resumes. Good for loading context, such as today's tickets.
  2. UserPromptSubmit. You send a prompt, before Claude sees it. Can add context or block it.
  3. PreToolUse. Claude is about to use a tool. Your script can block it, for example any edit to .env.
  4. The tool runs. The edit, command or search happens.
  5. PostToolUse. The tool finished. Good for running the formatter or the linter.
  6. Stop. Claude has finished its answer. Good for a final check or a notification.
# .claude/settings.json: block every edit to .env files
{
  "hooks": {
    "PreToolUse": [{
      "matcher": "Edit|Write",
      "hooks": [{ "type": "command",
        "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/protect-env.sh" }]
    }]
  }
}
# .claude/hooks/protect-env.sh
#!/bin/sh
# Claude Code sends details of the tool call as JSON on stdin
path=$(jq -r '.tool_input.file_path')
case "$path" in
  *.env|*.env.*) echo "Editing $path is not allowed" >&2; exit 2 ;;
esac
exit 0
Exit codeMeaning
0Carry on
2Block. What the script prints to stderr is shown to Claude as the reason.

Type /hooks to see the hooks that are set up.

Module 6 · Shape Claude Code
I167 of 7 in this module

Permissions and safety

Decide what Claude may do without asking, and stay safe.

Permission rules decide what Claude Code may do without asking. They live in settings.json under permissions, as three lists: allow, ask and deny.

# .claude/settings.json
{
  "permissions": {
    "allow": ["Bash(npm run test *)", "WebFetch(domain:docs.python.org)"],
    "ask":   ["Bash(git push *)"],
    "deny":  ["Read(./.env)", "Read(./secrets/**)", "Bash(curl *)"]
  }
}
RuleMatches
Bash(npm run test *)Any command starting with npm run test
Read(./.env)Reading that one file
EditEvery file edit (a bare tool name matches all uses)
WebFetch(domain:docs.python.org)Fetching pages from that site
mcp__github__create_issueOne tool from one MCP server

Order: deny is checked first, then ask, then allow. A deny rule always wins, and an allow rule can't make an exception to it. Type /permissions to see and edit the rules.

Stay safe

  • Treat what Claude reads as untrusted. A web page, issue or file can hide instructions aimed at the model. This is called prompt injection.
  • Deny reads of secrets, such as .env files and key folders.
  • Keep asking on for risky commands: pushes, deletes, deploys, anything that spends money.
  • Use the sandbox. /sandbox limits which files and network addresses shell commands can reach (macOS, Linux and WSL2).
  • Install only plugins and MCP servers you trust.
Module 7 · Connect tools
I171 of 2 in this module

Connect tools

Link Claude to your tools with connectors and MCP servers.

Out of the box, Claude only sees what you type or attach. A connector (in the apps) or an MCP server (in Claude Code) lets Claude read and act on a real tool, such as your Drive, GitHub or a database. Both use the same standard, called MCP. The Advanced section explains how MCP works inside.

In the Claude app

  1. Open Settings → Connectors. Newer versions may label the menu Customize → Connectors.
  2. Click Discover and pick a tool, such as Google Drive.
  3. Click Connect and sign in to that tool in the browser window.
  4. Ask: "Find last week's meeting notes in my Drive."

Tools not in the list can be added as a custom connector by pasting the MCP server's URL. Every paid plan can add custom connectors. On Team and Enterprise, the owners add connectors for the whole organisation.

In Claude Code

# a remote server, reached over the internet
claude mcp add --transport http notion https://mcp.notion.com/mcp
# a local server, started on your computer
claude mcp add db -- npx -y @bytebase/dbhub --dsn "postgresql://..."

Then type /mcp inside Claude Code to check the connection and sign in. claude mcp list shows every server you added.

Scope flagWho gets the serverSaved in
--scope localThe default. Only you, only this project.~/.claude.json
--scope projectEveryone who opens this project..mcp.json in the project
--scope userOnly you, in every project.~/.claude.json
# .mcp.json, shared with your team through git
{
  "mcpServers": {
    "notion": { "type": "http", "url": "https://mcp.notion.com/mcp" }
  }
}
Safety. A connector can see whatever its account can see. Add only tools you trust, and give them only the access they need.
Module 7 · Connect tools
I182 of 2 in this module

Plugins vs connectors

Tell a plugin from a connector, and when to use each.

A plugin is a box of parts. A connector is one cable to one service.
PluginConnector
What it isA bundle of add-ons, installed in one stepOne connection to one outside service
What it holdsSkills, subagents, hooks, MCP serversOne MCP server
Where you use itClaude Code and CoworkClaude apps (web, desktop, phone), also Claude Code and Cowork
How you add it/plugin, from a marketplaceSettings → Connectors, or a server URL
What it changesHow Claude works: new commands, habits and checksWhat Claude can reach: your data and services

A plugin's own description lives in .claude-plugin/plugin.json, with its name, version and description.

Module 8 · How MCP works
A11 of 5 in this module

MCP: the parts

The host, the client and the server, and how they talk.

MCP (Model Context Protocol) is an open standard for connecting AI apps to tools and data. MCP has three roles.

RoleWhat it doesExample
HostThe AI app you use. The host holds the chat, talks to the model, and asks your permission.Claude Code, Claude Desktop, claude.ai, your own app
ClientA connector inside the host. The host runs one client per server.Built into the host
ServerA small program that offers tools and data to any MCP host.A GitHub server, a files server, your own server
One host, two servers. The model never connects to a server directly. The host's clients make every connection.

What a server can offer

PrimitiveMeaningExample
ToolsActions Claude can ask to runcreate_issue, weather_current
ResourcesData Claude can readA file, a database row
PromptsReady-made prompt templates"Review this pull request"

How the messages travel

Every message is JSON-RPC 2.0, a simple JSON format for requests and replies. Two transports carry the messages:

TransportWhen
stdioThe server runs on the same computer as the host. The host starts the server as a child program and they talk through standard input and output.
Streamable HTTPThe server runs somewhere else and is reached over the internet. The older HTTP + SSE transport is deprecated.

The current spec is dated 2026-07-28: modelcontextprotocol.io/specification.

Module 8 · How MCP works
A22 of 5 in this module

How a tool is defined

What a tool definition contains, field by field.

A tool is a small JSON description. The server writes the description, and the model reads it to decide when and how to use the tool. A clear description matters as much as the code behind it.

# a tool definition, as the server sends it in tools/list
{
  "name": "weather_current",
  "title": "Weather Information",
  "description": "Get current weather for any location worldwide",
  "inputSchema": {
    "type": "object",
    "properties": {
      "location": { "type": "string", "description": "City name or coordinates" },
      "units": { "type": "string", "enum": ["metric", "imperial"], "default": "metric" }
    },
    "required": ["location"]
  }
}
FieldRequiredWhat it is for
nameYesThe ID the model uses to call the tool. Letters, numbers, _ and -, up to 128 characters.
descriptionYesPlain words telling the model what the tool does and when to use it.
inputSchemaYesA JSON Schema for the inputs: names, types, which are required.
titleNoA friendly name to show people.
outputSchemaNoThe shape of the result, if the tool returns structured data.
annotationsNoHints about behaviour, such as whether the tool only reads.

The two calls

# host → server: run the tool
{ "jsonrpc": "2.0", "id": 7, "method": "tools/call",
  "params": { "name": "weather_current", "arguments": { "location": "Pune" } } }
# server → host: the result
{ "jsonrpc": "2.0", "id": 7,
  "result": { "content": [ { "type": "text", "text": "24°C, cloudy" } ], "isError": false } }

tools/list asks a server for all its tool definitions. tools/call runs one tool. If the tool fails, the result carries "isError": true and a message the model can read.

Module 8 · How MCP works
A33 of 5 in this module

How Claude uses a tool, step by step

Follow one tool call from your prompt to the final answer.

Follow the numbers down the left. Solid arrows are requests. Dashed arrows are replies.

One question, one tool call. The model decides. The host carries every message. The server runs the code.
The key pointThe model never runs anything. The model only writes a request: "please call weather_current with Pune". The host decides whether to allow the call, and the MCP server runs the code.
Module 8 · How MCP works
A44 of 5 in this module

Claude side or server side?

Which parts run on Anthropic's side, and which run with you.

Both, for different jobsChoosing a tool happens on Claude's side, in the model. Running the tool happens on the server side, in the MCP server. The host app sits between them and carries the messages.

Where the server itself runs depends on how you connect. The three common setups:

Red marks where the tool's code actually runs in each setup.
SetupWho calls the serverWhere the tool runsNeeds to be public?
A. Claude Code + local serverClaude Code on your computerYour computerNo
B. Claude Code + remote serverClaude Code on your computerThe server's hostReachable from your computer
C. claude.ai / desktop custom connectorAnthropic's cloudYour serverYes, reachable from the internet
D. Desktop extension (MCPB file)Claude Desktop on your computerYour computer, over stdioNo

Custom connectors sign in with OAuth. Claude supports dynamic client registration and token refresh, and redirects to https://claude.ai/api/mcp/auth_callback after sign-in.

Module 8 · How MCP works
A55 of 5 in this module

MCP vs API

When to build an MCP server, and when to call the API with tools.

An API is one service's own set of URLs and rules. MCP is one shared plug shape that any AI app can use for any tool. An MCP server usually calls a service's API underneath. So MCP does not replace APIs. MCP wraps APIs in a form AI apps can discover and use.

Without MCP every pair needs its own code. With MCP each side is built once.
APIMCP
What it isOne service's interfaceOne standard for AI apps to find and use tools
Built forAny programAI apps and models
How tools are foundA developer reads the docs and writes codeThe host asks tools/list while running, and the model reads the descriptions
Work per new appNew code for every serviceNone, if the app speaks MCP
Who decides what to callThe developer's codeThe model, with the host's permission

Tools in the Claude API, without MCP

The Claude API has its own tools parameter. The flow is the same as MCP: Claude replies with a tool_use block, your code runs the tool, and you send back a tool_result block. The only difference is that your code holds the tools, with no MCP server involved. The schema field is spelled input_schema in the API and inputSchema in MCP.

Module 9 · The Claude API
A61 of 2 in this module

Your first API call

Pick a model and send your first message from your own code.

The Claude API lets your own code send messages to Claude. You need an API key from the Claude Console. API use is billed per token, separately from Claude app plans.

The models

Checked on 23 Oct 2026 against Anthropic's models page. Prices are US dollars per million tokens (MTok).

ModelAPI IDBest forInputOutput
Claude Fable 5.1claude-fable-5-1Demanding reasoning and long agentic work$10$50
Claude Opus 5.5claude-opus-5-5Long-running coding and knowledge work. The suggested starting point.$4$20
Claude Sonnet 5.5claude-sonnet-5-5The best mix of speed and intelligence$2$10
Claude Haiku 5.5claude-haiku-5-5High-volume, fast jobs: sorting, extracting, routingfrom $0.10from $0.50

All four have a 1M-token context window and up to 128K tokens of output.

The call

# terminal: send one message
curl https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{"model": "claude-opus-5-5", "max_tokens": 1024,
       "messages": [{"role": "user", "content": "Hello, Claude"}]}'
# Python: pip install anthropic
import anthropic

client = anthropic.Anthropic()  # reads ANTHROPIC_API_KEY
msg = client.messages.create(
    model="claude-opus-5-5",
    max_tokens=1024,
    system="You answer in one short paragraph.",
    messages=[{"role": "user", "content": "What is a context window?"}],
)
print(msg.content[0].text)
FieldMeaning
modelWhich model answers
max_tokensThe longest answer you'll accept
systemStanding instructions for the whole conversation (optional)
messagesThe conversation so far, as user and assistant turns. The API keeps no memory: you send the history every time.
contentIn the reply: the answer, as a list of blocks
stop_reasonWhy it stopped: end_turn (finished), max_tokens (ran out), tool_use (wants a tool)
usageTokens in and out, which is what you pay for
Module 9 · The Claude API
A72 of 2 in this module

Save money and get reliable output

Cut API cost with caching and batches, and get JSON you can trust.

Three API features cut cost or make answers easier to use in code.

Prompt caching

If every request starts with the same long text, such as a manual or a big system prompt, mark it for caching. Later requests read it from the cache at a fraction of the price.

# mark the long, unchanging part
"system": [{
  "type": "text",
  "text": "...a long product manual...",
  "cache_control": {"type": "ephemeral"}
}]
FactDetail
How long it lasts5 minutes by default, or 1 hour if you ask for it
Writing to the cache1.25 times the normal input price (2 times for the 1-hour cache)
Reading from the cacheA small share of the input price: 5% on Opus 5.5 and Sonnet 5.5, 2.5% on Fable 5.1
What breaks itChanging anything before the marked point, such as the tools or the system prompt

Message Batches

For work that doesn't need an answer right now, send up to 100,000 requests in one batch. Batches cost 50% less. Most finish within an hour, and every batch finishes within 24 hours. Good for evaluations, tagging and bulk summaries.

Structured outputs

When your code needs JSON, give the API a JSON Schema. The answer is guaranteed to match it, so you don't have to check and retry.

# Python, with a Pydantic model as the schema
from pydantic import BaseModel

class Contact(BaseModel):
    name: str
    email: str

result = client.messages.parse(
    model="claude-opus-5-5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Extract the contact: Asha Rao, asha@example.com"}],
    output_format=Contact,
)
print(result.parsed_output.email)
Module 10 · Build and automate
A81 of 5 in this module

Connect your own app

Connect your own app to Claude, through MCP or the API.

"Connecting your app to MCP" means one of two things. Pick the path that matches your goal.

Path 1 puts your app inside Claude. Path 2 puts Claude inside your app.

Path 1. Let Claude use your app: build an MCP server

  1. Write a server that wraps your app's actions as tools. The Python SDK keeps a small server very short:
# server.py, using the official Python SDK (pip install mcp)
from mcp.server.fastmcp import FastMCP

mcp = FastMCP("weather")

@mcp.tool()
def weather_current(location: str) -> str:
    """Get current weather for a city."""
    # call your real API or database here
    return f"24°C, cloudy in {location}"

if __name__ == "__main__":
    mcp.run()  # stdio

The SDK turns the function name, the docstring and the type hints into the tool's name, description and inputSchema. A TypeScript SDK also exists: @modelcontextprotocol/sdk.

  1. Test the server with the MCP Inspector, which lists your tools and lets you call them by hand.
  2. Add the server to Claude Code: claude mcp add weather -- uv run server.py
  3. To use the server in claude.ai, run it over Streamable HTTP on a public URL, add OAuth, and add the URL as a custom connector.
stdio servers must not print. On stdio, standard output carries the JSON-RPC messages. A stray print() breaks them. Log to standard error instead.

Path 2. Use Claude inside your app: call the API with tools

# your app, using the Anthropic Python SDK
import anthropic
client = anthropic.Anthropic()

tools = [{
    "name": "weather_current",
    "description": "Get current weather for a city",
    "input_schema": {"type": "object",
                     "properties": {"location": {"type": "string"}},
                     "required": ["location"]}
}]

msg = client.messages.create(
    model="claude-sonnet-5-5", max_tokens=1024, tools=tools,
    messages=[{"role": "user", "content": "Weather in Pune?"}])

# msg.content holds a tool_use block. Run the tool yourself,
# or forward it to an MCP server with tools/call, then send
# the output back as a tool_result block in the next request.

To use existing MCP servers here, make your app an MCP client with the MCP SDK. Call tools/list, pass those tools to Claude, and turn each tool_use into a tools/call.

Module 10 · Build and automate
A92 of 5 in this module

Claude Code in CI and GitHub

Run Claude Code in scripts and CI, and from @claude on GitHub.

Claude Code can run without a chat window, inside scripts and CI jobs. On GitHub, you can mention @claude in an issue or pull request and it does the work there.

In a script

# answer once and exit; JSON is easy for scripts to read
claude -p "Summarise what changed in the last 5 commits" --output-format json
cat build.log | claude -p "Why did this build fail?"

On GitHub

  1. In Claude Code, run /install-github-app. It installs the GitHub app and adds the secret. It needs the GitHub CLI signed in.
  2. A workflow file using anthropics/claude-code-action@v1 is added to .github/workflows/.
  3. Comment "@claude fix the failing test" on a pull request. Claude works in the action and pushes its changes.
# .github/workflows/claude.yml (the core of it)
on:
  issue_comment:
    types: [created]
jobs:
  claude:
    if: contains(github.event.comment.body, '@claude')
    runs-on: ubuntu-latest
    permissions: { contents: write, pull-requests: write, issues: write, id-token: write }
    steps:
      - uses: actions/checkout@v6
      - uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
Module 10 · Build and automate
A103 of 5 in this module

Build your own agent: the Agent SDK

Build your own agent on the engine Claude Code runs on.

The Claude Agent SDK gives your program the same engine Claude Code runs on: the agent loop, the built-in tools (read, edit, run commands, search), permissions, hooks, subagents and MCP. You write the program; the SDK does the agent work.

LanguageInstall
Pythonpip install claude-agent-sdk
TypeScriptnpm install @anthropic-ai/claude-agent-sdk
# Python: an agent that fixes bugs in one file
import asyncio
from claude_agent_sdk import query, ClaudeAgentOptions

async def main():
    async for message in query(
        prompt="Find the bugs in utils.py and fix them",
        options=ClaudeAgentOptions(
            allowed_tools=["Read", "Edit", "Glob"],
            permission_mode="acceptEdits",
        ),
    ):
        print(message)

asyncio.run(main())
SDK or API? Use the API (chapter A6) when you want one answer to one request. Use the Agent SDK when the job takes many steps with tools, the way Claude Code works.
Module 10 · Build and automate
A114 of 5 in this module

Automate Claude

Every way to automate Claude, and a security checklist.

ToolUse it for
claude -p "prompt"Run Claude Code once without the chat window, for scripts and CI jobs.
Claude Agent SDKBuild your own agent on the same loop Claude Code uses, in Python or TypeScript.
HooksRun your own checks automatically around Claude's actions.
PluginsPackage your skills, agents, hooks and servers so your team installs them in one step.

Security checklist for tools

  • Give each server the smallest access that works, such as read-only tokens.
  • Treat tool results as untrusted text. A web page or file can contain instructions aimed at the model.
  • Keep approval on for tools that write, delete, send or pay.
  • Install servers and plugins only from sources you trust.
Module 10 · Build and automate
A125 of 5 in this module

Word list

Every term in this book, in one line each.

WordMeaning
PromptWhat you type to Claude.
ModelThe AI brain that writes the answer.
TokenA small piece of text, roughly ¾ of a word. Limits and prices are counted in tokens.
Context windowHow much text the model can keep in mind at once.
AgentAn AI that takes steps on its own to finish a task.
HostThe AI app that runs MCP clients and talks to the model.
MCP serverA program that offers tools and data to MCP hosts.
ToolOne action a server offers, described by a name, a description and an input schema.
tool_use / tool_resultThe model's request to run a tool, and the reply carrying the output.
JSON-RPCThe request and reply format MCP messages use.
OAuthA standard way to sign in to a service without sharing your password.

CSCheat sheet

The essentials on one page, checked against the Claude Code docs on 23 Oct 2026.

Keys

EscStop Claude. Work so far is kept.
Esc EscRewind to an earlier point (empty prompt)
Shift+TabNext permission mode
Shift+EnterNew line in your prompt
Ctrl+CInterrupt, or clear the prompt
Ctrl+DExit (press twice)
Ctrl+OShow every tool call in detail
Ctrl+RSearch your past prompts
Ctrl+GWrite the prompt in your editor
Ctrl+BSend a running task to the background
Ctrl+TShow Claude's to-do list
Ctrl+VPaste an image
Option+PSwitch model (Alt+P on Windows)
?All shortcuts (empty prompt)

Start a line with

/A command or a skill
!Run a shell command yourself
@Mention a file, or a subagent

Commands: every day

/initWrite a CLAUDE.md for this project
/planPlan first, no edits yet
/modelSwitch model
/effortChange effort
/contextWhat fills the context window
/compactSummarise to free space
/clearFresh conversation
/resumeReopen an earlier conversation
/btwSide question, kept out of the chat
/usageCost and plan limits

Commands: review and undo

/diffSee every change made so far
/rewindUndo the chat and the code
/code-reviewReview your changes
/security-reviewCheck your branch for security holes

Commands: set up and check

/memoryEdit CLAUDE.md files
/permissionsAllow, ask and deny rules
/mcpMCP servers and sign-in
/pluginFind and install plugins
/skillsList your skills
/hooksView your hooks
/statusVersion, model, settings loaded
/doctorFind setup problems

From the terminal

claudeStart in this folder
claude "task"Start with a first prompt
claude -p "task"Answer once and exit (scripts)
cat log | claude -pPipe a file in
claude -cContinue the last conversation
claude -rResume a chosen conversation
--effort highStart at an effort level
--permission-mode planStart in a mode
--add-dir ../apiLet it see another folder
claude mcp addAdd an MCP server
claude updateUpdate Claude Code

Files

CLAUDE.mdTeam rules, every session
CLAUDE.local.mdYour notes, gitignore it
.claude/settings.jsonTeam permissions and hooks
settings.local.jsonYour overrides, out of git
skills/<name>/SKILL.mdA skill
agents/<name>.mdA subagent
rules/<topic>.mdA topic rule
.mcp.jsonTeam MCP servers
~/.claude/Same files, for you in every project

The five layers

CLAUDE.mdMemory. Every session.
SkillsKnow-how. When the task matches.
HooksGuardrails. Every time the event fires.
SubagentsDelegation. Own context window.
PluginsDistribution. One install for the team.

Effort

lowBrainstorms, renames, first sketches
mediumClear, day-to-day work (default on 5.5)
highBug fixes, where edge cases matter
xhighDeeper reasoning, more tokens
maxHardest problems. Test first.
ultrathinkIn a prompt: think harder, this turn only

Modes (Shift+Tab)

defaultAsks before edits and commands
acceptEditsEdits files without asking
planPlans first, edits after approval
autoEverything, with safety checks

Which Claude

Claude appChat, ideas, drafts. You steer.
Claude CodeSoftware. Reads, edits, runs.
CoworkHand off an outcome, get files back.