How to Use Claude Code: The Complete Guide
Setup, permission modes, CLAUDE.md, context, cost, skills, hooks and the seven day path to actually learning it.
From the videoLearn 95% Of Claude Code In 29 Minutes
Claude Code is Anthropic's coding agent. It runs inside your project folder, edits your real files, and shows you what it changed. You install it with one command or from the Claude desktop app, point it at a folder, and then control three things: permissions, a CLAUDE.md file, and your context window. Get those three right and it stops fighting you.
Most people install it, watch it burn through a usage limit in an afternoon, and conclude it is overhyped. The tool is fine. The defaults are what get you. This guide covers the parts that actually decide whether it works, in the order you need them.
What Claude Code is, and how it differs from the Claude app and Cowork
There are three Claudes and each is built for a different job.
The Claude app is the normal chat. Questions, quick lookups, explaining an error, drafting an email. You ask, you get an answer, you move on.
Cowork does work on your computer. Point it at a messy folder and it sorts every file. Hand it a hundred PDFs and it pulls every invoice total into one spreadsheet.
Claude Code writes code. It lives inside your project and it builds: a full app from scratch, a bug fixed across your codebase, a feature added to something you already shipped.
The one idea worth carrying: Claude Code does not suggest code. It does the work in your actual project and then shows you what it did.
How to install Claude Code
Two paths, about two minutes either way.
Terminal:
npm install -g @anthropic-ai/claude-code
Then type claude and hit enter.
Or install the Claude desktop app and find Claude Code inside it. No terminal at all. That is the path most people should take.

Either way, point it at a folder. An existing codebase, or an empty folder for something new. From that second it can see everything inside that folder, which is the whole point.
Claude Code permission modes, and which one to use
Before a file changes or a command runs, Claude Code can stop and ask. That is the permission mode. Cycle it with shift+tab, or click it in the desktop app.
- Auto is the default. A second model checks each action in the background, so it only stops you for what actually matters.
- Manual asks before every change. Correct, and unbearably spammy.
- Accept edits stops asking about file edits and makes them while you watch.
- Plan only plans. Nothing changes until you approve the plan.
- Bypass permissions is a separate toggle. Enable it and Claude never asks for anything, ever.

Use Auto for most work. Start with Bypass permissions off. Turn it on later, once you know what it does when nobody is watching.
What CLAUDE.md is, and the prompt that writes it for you
If you take one thing from this guide, take this.
CLAUDE.md is a plain text file in your project. Every time Claude Code starts, it reads that file first. It is a memory that survives. Without it you re-teach the same context every session. With it, Claude Code walks in already knowing your rules.

The trap is dumping everything into it. The whole file tree, every dependency, a paragraph on the architecture. That file loads into memory on every single session, so every line you put in it, you pay for, on every message you send. Stuff it full and you burn tokens all day while burying the rules that actually matter, so it follows them less.

The fix is that you write none of it. Paste this in and let Claude write its own instructions:
Read my whole codebase and write me a CLAUDE.md. Keep it under 40 lines. Only include what you could not work out by reading the code yourself. The exact build and test commands, the conventions I follow, the folders to never touch, and my always-do-it-this-way rules. Do not describe the file structure, and do not list dependencies. Be specific.
That returns a tight, high signal file in about thirty seconds. If yours has already grown into a monster, do not start over. Run /doctor. It reads the file, shows you everything Claude could already work out for itself, and trims it the moment you say yes.
One honest catch: this file is guidance, not a cage. Claude reads it and almost always follows it. Almost. For something that has to happen every time, like running tests before a commit, you want a hook, not a line in here.
How the context window works, and the three commands that manage it
Claude Code has a memory limit for a single conversation, called the context window. Everything it has read and done this session sits inside it.
Here is the part nobody warns you about. As that window fills, the tool gets worse. It forgets your early instructions, repeats itself, and re-breaks things it already fixed. It is not getting dumber. It is getting full.

Three moves:
/contextshows how full it is. The small wheel next to the chat window shows the same thing faster./compactsummarises the session so far and frees room. You lose detail in the squeeze./clearwipes it entirely. The equivalent of a new chat.
The professional habit is not to compact endlessly. Finish a task, /clear, start the next one clean, and let CLAUDE.md carry the important things across.
This is what is really happening when it feels like it got dumb halfway through a session. It did not get dumb. The window filled up and you did not catch it.
What Claude Code costs, and which model to pick
Cost depends almost entirely on two things you control: which model you use, and how full your context gets. Every message carries the whole conversation with it, so a long bloated session is not just forgetful, it is expensive. You are paying to re-send everything, every turn.

The model line-up, cheapest first:
- Haiku is fastest and cheapest. Simple mechanical tasks.
- Sonnet is the generalist you will live in. Routine, well-scoped work.
- Opus is the expert. Complex problems needing real judgment.
- Fable is the specialist. The genuinely hard things smaller models keep failing.
The bigger and more ambiguous the problem, the bigger the model.
One thing that costs people real money: set your model at the start of a session, not partway through. Every model keeps its own separate cache of your conversation. Switch mid-session and the new one has none of that cache, so it re-reads the entire conversation from scratch at full price. Claude Code will stop and ask you to confirm, because it knows what it is about to cost you.
Claude Code is not expensive if you drive it properly. It is expensive if you put your senior engineer on every tiny job and never clear the desk.
How to install Claude Code skills
A skill is a saved procedure. Install or write one once and Claude Code knows how to do that task correctly, forever. It is the difference between telling a new hire how to do something and handing them the handbook.
You already have some. /code-review goes through your changes hunting real bugs, not style. /security-review looks for holes in what you just wrote. Both ship built in.
Three more worth installing on day one:
# Anthropic's own skills: real Word files, Excel sheets, slide decks, PDFs
/plugin marketplace add anthropics/skills
/plugin install document-skills@anthropic-agent-skills
# Superpowers: interviews you, writes a plan, builds test first
/plugin install superpowers@claude-plugins-official
# Oh My Claude Code: routes each job to the model that suits it
/plugin marketplace add https://github.com/Yeachan-Heo/oh-my-claudecode
/plugin install oh-my-claudecode


The honest catch: a skill is not just text. It can run shell commands on your machine. Before you install one, ask Claude to read it and tell you whether it is safe.
What subagents do
A subagent is a second Claude your main Claude hands a job to. It runs in its own context, does the task, and reports back with just the answer. The messy, token-heavy work happens off to the side and your main session stays clean. Use /agents to set them up.

The catch is that subagents cannot talk to each other, and each one costs. This is not about spawning ten agents for a thumbnail. It is about pushing large, dirty reading and searching jobs off your main thread.
MCP or the command line: which to use
To do real work, Claude Code often needs to reach outside your folder. Your database, GitHub, a browser.
MCP (Model Context Protocol) is an adapter that plugs a service directly in, with permissions and structure. Add one with claude mcp add.
The command line means letting Claude use tools you already have, like the GitHub CLI.

The tradeoff that matters: every connected MCP server loads its instructions into your context whether you use it that session or not. The CLI is lighter but messier.
So connect an MCP server when you will genuinely use it a lot. Lean on the CLI for one-off jobs. And go into Connectors, Manage Connections, and turn off anything you have not used in a month. You are paying for those instructions in every message.
Six Claude Code hacks worth learning today
- Make it interview you first. Put
use askuserquestion until you reach clarityat the end of your prompt. It fires multiple choice questions at you, you answer, then it builds the thing you actually wanted. More wrong builds come from vague asks than from hard problems. - Turn the thinking up.
/effortsets the dial: low, medium, high, extra, max. For a single message, put the wordultrathinkanywhere in the prompt. It costs more because it thinks for longer. - Point at files with
@. Type@, start typing a filename, and it pulls that exact file in. It stops hunting and stops reading the wrong thing. - Never sit and wait. Type your next instruction while it works and it queues behind the current one. Hit escape to stop, and it keeps the work already done.
- Show it, do not describe it. Paste a screenshot straight into the prompt. Describing a broken layout in words is slow and loses detail.
- Ask side questions with
/btw. You get your answer without adding it to the session history, so your context stays clean.

And one worth ten of those: /batch takes a big job, splits it into as many as thirty pieces, runs them in parallel in their own copies of your project, and opens the pull requests when they are done.
Every one of these is speed, not judgment. /batch will happily open thirty pull requests full of the same wrong idea, and ultrathink on a vague prompt buys you a confidently wrong answer more slowly and more expensively. The prompt still has to be good.
What to do when Claude Code goes wrong
Three failure modes, three fixes.
- The loop. It tries a fix, fails, tries almost the same fix, fails again, forever. Do not repeat yourself. Change the instruction entirely.
- Confidently wrong. It acts on a misunderstanding and your code is worse. Make it explain before it acts.
- It did too much. Use
/rewindto roll the conversation and its changes back. Then remember git exists:git statusto see what it touched,git restoreto undo since your last commit.

Commit before you start. That is the whole trick.
How to make Claude Code check its own security
Claude Code will build you a working app you can ship without opening a single file it wrote. Running and safe are not the same thing.
Instead of a checklist you will not follow, install the official plugin:
/plugin install security-guidance@claude-plugins-official
In the desktop app: the + button next to the prompt, then Plugins, then Add plugin.
It reviews Claude's code while Claude writes it, on three levels. Every file written is pattern matched for dangerous things, and that layer is free because there is no model behind it. At the end of every turn it diffs what changed and sends it to a background review. On every commit it runs a deeper review that reads the surrounding code first. That review is a separate call with a fresh context and one instruction, so it is not the same Claude grading its own homework.

Two things to know before you install: it needs Python 3.7 or later on your PATH, and 3.10 or later for the commit review. On first run it builds a virtual environment. And only the per-edit pattern check is free. Both model-backed layers cost usage.
The honest catch: none of this blocks anything. It does not stop the write, it does not stop the commit, and it can still miss things.
Hooks, and running Claude Code from your phone
Hooks are automatic rules that fire on a trigger. Every time it finishes editing a file, run the tests. Set once, happens forever.
They live in ~/.claude/settings.json for you or .claude/settings.json for a project. You do not write that file yourself. Say it in plain English:
add a hook that runs my tests every time I edit a file
It writes the rule, saves it, and it goes live without a restart. Then /hooks shows every rule you have running and where each came from. Note that /hooks is view only. You change hooks by asking Claude or editing the file.

Remote control pairs your phone to a session running on your machine. Run claude remote-control, press space to show the QR code, then open the Claude app on your phone, go to Code, and scan it. From then on you can approve a permission prompt from the sofa, send new instructions, and watch output land.
The work is still running on your computer with your files and your tools. Your phone is only the steering wheel. It needs a Pro, Max, Team or Enterprise plan and a claude.ai login. It does not work on an API key, on Bedrock, Vertex or Foundry, or with a custom ANTHROPIC_BASE_URL. Your computer has to stay awake, and Ctrl+C ends the session.
On hooks, one warning: automation multiplies mistakes as fast as it multiplies work. A hook that runs the wrong command runs it every single time.
When Claude Code is the wrong tool
It is the wrong tool when the job is tiny and you already know the answer. If you need a fast question answered that has nothing to do with a codebase, just ask Claude chat.
The honest catch on all of it: Claude Code makes a mediocre engineer faster and a careless engineer dangerous. It amplifies whoever is driving. It does not replace judgment, it scales it in both directions.
A seven day plan to learn Claude Code
You do not need to master all of this today. Each day removes the reason you could not go further the day before.
- Install it. Point it at a folder and make one small change in plan mode.
- Write your
CLAUDE.mdwith the prompt above. Every session after this one starts smarter, so this is the day that pays back longest. - Learn the meter. Watch context fill and clear between tasks instead of compacting forever.
- Pick your model and effort on purpose instead of leaving the default.
- Install the security plugin and one skill. Safer and more capable, and neither took work.
- Break something on purpose and get out with
/rewind. This is the day you stop being scared of it. - Hand it a real job you have been putting off. Turn on remote control, walk away, and watch it from your phone.

Do that for a week and it stops feeling like a fight. The hard part was never the tool. It was starting on the right step.
Chapters
| Time | Section |
|---|---|
| 0:00 | Intro |
| 0:57 | The mental model |
| 2:10 | Setup |
| 3:12 | Permissions |
| 4:36 | CLAUDE.md |
| 6:57 | Context |
| 8:59 | Cost |
| 11:52 | Skills |
| 14:21 | Subagents |
| 15:31 | MCP vs the CLI |
| 17:25 | The six hacks |
| 20:53 | When it breaks |
| 22:15 | Security |
| 23:59 | Hooks and phone |
| 26:07 | The wrong tool |
| 27:02 | The 7-day path |
Start here
Install it, point it at a folder, and run the CLAUDE.md prompt above before you do anything else. That single file is what makes every session after it start smarter, and it takes about thirty seconds to produce. Everything else on this page is easier once it exists.
Questions
- What is CLAUDE.md and where does it go?
- CLAUDE.md is a plain text file in your project root. Claude Code reads it first every time it starts, so it works as a memory that survives between sessions. Keep it under about 40 lines and include only what cannot be worked out by reading the code, such as build commands, conventions and folders never to touch.
- Why does Claude Code get worse partway through a session?
- The context window filled up. Everything it has read and done that session sits inside it, and as it fills the model forgets early instructions, repeats itself and re-breaks things it already fixed. Check it with /context, then use /clear between tasks rather than compacting endlessly.
- How do I reduce what Claude Code costs?
- Two levers control almost all of it: which model you use and how full your context gets. Use Haiku or Sonnet for routine work and save Opus or Fable for genuinely hard problems. Set the model at the start of a session, because switching midway makes the new model re-read the whole conversation at full price.
- Is code written by Claude Code safe to ship?
- Running and safe are not the same thing. Install the official security-guidance plugin, which pattern matches every file edit for free and sends the diff for a background review at the end of each turn. It surfaces findings but does not block writes or commits, so you still have to read them.
- Can I run Claude Code from my phone?
- Yes, with remote control. Run claude remote-control on your computer, press space to show the QR code, then scan it from the Code tab in the Claude phone app. The work still runs on your machine. It needs a Pro, Max, Team or Enterprise plan and does not work with an API key or a custom base URL.
You made it to the end
That is the whole build. Want the next one?
Read next
Claude Code Rate Limit: Why You Hit It and the 7 Fixes That Actually Work
Almost none of your Claude Code usage limit comes from what you type. Here is what actually burns it and how to stop it.
10 Open Source Alternatives to Paid Subscriptions
Ten self-hosted repos that replace about $183 a month of software, with the honest catch on every one and the prompt to hand a repo to your agent.
How to Build an Agent Skill That Actually Fires
I measured the 55 most popular skills on GitHub. Half of them never tell your agent when to run, and they charge you tokens on every message anyway.