CLAUDE CODE · SLASH COMMANDS · PERMISSION MODES
Claude Code Tutorial: Commands, Modes, and Memory
A working Claude Code tutorial for the current 2.x CLI: install in two minutes, the ten commands that run 90% of sessions, permission modes (plan → edit → auto), CLAUDE.md project memory, custom skills, and the verify-the-result step beginners skip. Windows without WSL. Then run it beside your other agents in the free harness.
Step 0 — Install and authenticate
Two install paths. The native installer is the current recommendation; npm works if you already run Node 18+:
# macOS / Linux
curl -fsSL https://claude.ai/install.sh | bash
# Windows (PowerShell)
irm https://claude.ai/install.ps1 | iex
# npm alternative
npm install -g @anthropic-ai/claude-code
claude --version
Then claude from any project directory. The first run opens an OAuth
browser flow — a Claude Pro seat ($20/mo) is enough to start; Max tiers ($100–200/mo)
buy more headroom when you hit usage limits. API-key auth works too
(claude setup-token generates a long-lived token for CI). Verify with
claude --help.
Desktop app or VS Code extension instead of the terminal? They share your account and your project's CLAUDE.md — start wherever you are comfortable and move later. This tutorial covers the CLI, because everything else layers on top of it.
Step 1 — First session: the agent loop
Start in a real project — that is where Claude Code differs from a chat window:
cd my-project
claude
> Explain the architecture of this project. Do not modify anything.
Watch the loop: Claude picks a tool (Glob to scan, Read to open, Grep for patterns), executes it, reads the result, and decides whether it needs another pass. Every tool call prints in your terminal. This loop — goal, tool, result, repeat — is the entire mental model. Everything below just controls it.
Three input prefixes matter from minute one: @src/auth.ts attaches a file
to your prompt, !ls -la runs a shell command inline (output goes to
Claude), and # adds a fact to project memory. Esc
interrupts mid-turn and keeps work done so far; Shift+Tab cycles
permission modes (next section).
Step 2 — The commands that matter
Claude Code ships dozens of commands; ten cover about 90% of real sessions. A command
is only recognized at the start of your message, everything after the name becomes its
arguments, and /help lists what your version actually exposes — versions
move fast, so type / and filter rather than memorizing.
| Command | What it does | When you reach for it |
|---|---|---|
/init | Scans the codebase and generates CLAUDE.md | First session in any repo — do this before anything else |
/clear | Wipes session context, fresh start | Switching to an unrelated task |
/compact | Summarizes old context to free token budget | Long session, same task — keeps the thread alive |
/context | Shows what is eating the context window | Model behaving oddly, or memory files you expected are missing |
/model | Switch model mid-session | Burn through quota fast on a hard problem — or save quota on easy ones |
/rewind | Roll back code, conversation, or both | The agent went down a wrong path |
/resume | Continue a previous session by name or picker | Back the next day; claude -c continues the most recent |
/review | Review a diff or PR for correctness bugs | Before you commit agent-written code |
/security-review | Check the diff for security vulnerabilities | Any auth, input, or secret-handling change |
/memory | Browse and edit memory files | CLAUDE.md upkeep, toggling auto memory |
CLI flags round out the session layer: claude -p "query" is print mode for
scripts and CI (pipe-friendly, exits when done), claude --permission-mode plan
boots read-only, and cat file | claude -p "summarize" is the headless
pattern. Everything else — --verbose, --add-dir,
claude mcp for server config — you will pick up when you need it.
Step 3 — Permission modes: the control surface
This is the part most tutorials wave past and the part that decides whether you trust the agent. Shift+Tab cycles modes; the current one shows in the status bar:
plan — read-only
Claude can read files, search, and run non-mutating commands, but cannot edit files or change state. Start every non-trivial task here: the plan it produces is cheap to correct. Enter with Shift+Tab, claude --permission-mode plan, or set "permissions": {"defaultMode": "plan"} in settings.
default — approve each action
Every file edit and mutating command asks first. Slowest, safest — right for production repos and your first week.
acceptEdits — auto-approve edits
File edits go through; shell commands still gate. The working middle for tight iterate-and-review loops.
auto — classifier-approved
Longer autonomous stretches with fewer prompts; dangerous classes of commands (deploys, force-pushes, external code execution) stay blocked by default. Use only on repos you can roll back.
The pattern that works in practice: plan → edit → verify. Plan the approach read-only, switch modes and let it execute, then run the test suite yourself. Skip the plan phase on typo-level tasks — that round trip is pure overhead there.
Step 4 — CLAUDE.md: the memory that makes it good
Claude Code is stateless between sessions until you give it a memory file. Run
/init in your repo and it generates a starting CLAUDE.md from
your codebase (it even imports existing Cursor rules, Copilot instructions, and
AGENTS.md). The generated file is a first draft — the highest-leverage edit is making
it short and specific:
# Project: billing-service
## Stack
- Bun + Hono on PostgreSQL (Drizzle ORM). Never suggest npm.
## Commands
- bun dev / bun test / bun db:migrate
## Conventions
- TypeScript strict. Tests colocated as *.test.ts.
## Don't
- Don't touch src/legacy/ — frozen.
- Don't add dependencies without asking.
Keep it under ~800 tokens of facts Claude needs every session — build commands, conventions, boundaries. Multi-step procedures belong in skills (next section), not here. The three sections that earn their tokens: the stack block (kills wrong-framework suggestions), the Don't block (your most common agent mistakes from past sessions), and the commands block (so it never guesses variants).
Scope layers naturally: ~/.claude/CLAUDE.md is your global default,
./CLAUDE.md is team-shared project memory, subdirectory files apply when
Claude works in them (nearest wins on conflict), and CLAUDE.local.md
holds private per-project preferences you gitignore. Auto memory is the other half:
Claude writes its own notes across sessions (debugging insights, style preferences)
into ~/.claude/projects/<project>/memory/ — toggle it with
/memory. Our AGENTS.md template
covers the vendor-neutral twin of this file if your team runs mixed agents.
Step 5 — Skills: your own slash commands
Anything you paste into chat more than twice wants to be a skill. A skill is a folder
with a SKILL.md (YAML frontmatter + instructions); its directory name
becomes the command. Drop it in .claude/skills/deploy/SKILL.md and
/deploy exists — for you, for teammates who pull the repo, and loadable
by Claude automatically when relevant:
---
name: deploy
description: Ship the current branch to staging with checks.
disable-model-invocation: true
---
Run the pre-deploy checklist: bun test, bun lint, then
deploy to staging with bun run deploy:staging. Report
each gate's result before moving to the next.
The two frontmatter flags that matter: disable-model-invocation: true
makes it you-only (right for anything with side effects like deploys — Claude should
never decide to deploy), and context: fork runs it in an isolated
subagent. Long reference material is nearly free in a skill — the body loads only when
used — while CLAUDE.md content taxes every message. That split is the whole design.
Old .claude/commands/*.md files still work — custom commands merged into
skills. MCP servers extend tools instead of commands: wire them with
claude mcp, and see our
MCP tools guide for the servers worth attaching.
Step 6 — Verify (the step beginners skip)
The agent says done. Your job is not done. Three closes, every time:
1. Run the suite yourself
Whatever your project uses — npm test, pytest, go test. Agents pass their own tests more often than they pass yours.
2. Make it prove the behavior
"Prove this works — show me the behavior difference between main and this branch." A demo, a diff walk, or a failing-before/passing-after test.
3. Review the diff like a PR
/review for correctness, /security-review for anything touching auth or inputs. Agent code ships through the same review gate as human code.
This is not ceremony — it is the loop that separates developers who get real leverage from agents from those who ship subtle bugs. Our vibe coding security guide covers the failure modes (45% of AI-generated code carries an OWASP flaw in 2026 studies) and the 8-step review loop that closes them.
Run Claude Code beside your other agents
Claude Code is a terminal agent; a harness decides where it runs and what it can touch. VibeFuse is the first ever free widget-based AI harness: Claude Code, Codex, and Gemini as live widgets on one Windows canvas — sessions named and resumable, MCP tools attached, local Whisper voice control, all processing locally. The harness is $0; you pay only the model vendors you already use.
Skills you write for Claude Code are portable: VibeFuse reads the same SKILL.md format, and the open-source marketplace lets you sell your skills, widgets, and styling packs with 80% payouts to creators. Works in any app you already use.
- ✓ Runs Claude Code + Codex + Gemini
- ✓ Named resumable sessions
- ✓ Local Whisper + Piper
- ✓ 80% creator payouts
Explore VibeFuse & harness guides
- Harness Guide
- Free Coding Tools
- AI Coding Agent Desktop
- Free Voice Transcription
- Free Text to Speech
- VibeFuse Product
- Widget Marketplace
- Download Free
- VibeFuse Docs
- Shareable AI Widgets
- Shareable AI Skills
- MCP Tools
- AI Agent Harness
- Harness Engineering
- HyperFrames Video
- Skill Seekers
- Sell AI Skills
- AI Skills Marketplace Compared
- Cursor Alternative
- Local Whisper + Piper
- Custom AI Dashboard
- Community Hub
Claude Code tutorial FAQ
How do I install Claude Code?
Run the native installer — curl -fsSL https://claude.ai/install.sh | bash on macOS/Linux, or irm https://claude.ai/install.ps1 | iex in Windows PowerShell (no WSL needed). The npm alternative is npm install -g @anthropic-ai/claude-code. Verify with claude --version, then run claude in any project directory; the first launch opens an OAuth browser flow. A Claude Pro seat ($20/mo) is enough to start.
What are the most important Claude Code slash commands?
Ten cover ~90% of sessions: /init (generate CLAUDE.md), /clear (fresh context), /compact (summarize old context to free tokens), /context (see what is using the window), /model (switch mid-session), /rewind (roll back code or conversation), /resume (continue a past session), /review and /security-review (audit the diff), and /memory (edit memory files). Type / in a session to see everything your version ships.
What is the difference between Claude Code permission modes?
Plan mode is read-only — Claude explores and drafts a plan but cannot edit files or run mutating commands. Default asks approval for every action. acceptEdits auto-approves file edits but still gates shell commands. Auto extends autonomy with a classifier that still blocks dangerous operations (deploys, force-pushes, external code execution). Cycle them with Shift+Tab; the safe working pattern is plan first, then switch modes to execute.
How do I set up project memory in Claude Code?
Run /init in your repo — it generates a CLAUDE.md from your codebase and can import existing Cursor rules, Copilot instructions, and AGENTS.md. Keep it under ~800 tokens of per-session facts: build commands, conventions, and an explicit Don't block. Scope layers: ~/.claude/CLAUDE.md is global, ./CLAUDE.md is team-shared, subdirectory files load contextually, and CLAUDE.local.md stays private. Verify what loaded with /context.
How do I create custom slash commands in Claude Code?
Write a SKILL.md in .claude/skills/<name>/ — its directory name becomes the slash command, so .claude/skills/deploy/SKILL.md creates /deploy. Add YAML frontmatter: description (so Claude can auto-load it), disable-model-invocation: true for side-effectful workflows you want to trigger manually, and context: fork to run it in an isolated subagent. Legacy .claude/commands/*.md files keep working — custom commands merged into skills.
How much does Claude Code cost?
The CLI itself is free; you pay for model access. Claude Pro ($20/mo) includes Claude Code with weekly limits, Max tiers ($100–200/mo) raise headroom, and API-key billing meters tokens directly (setup-token generates a long-lived key for CI). 2026 benchmarks put typical tasks at $0.10–0.30 each on subscription plans, with complex multi-file features running higher.
Does Claude Code work on Windows?
Yes, natively — install with irm https://claude.ai/install.ps1 | iex in PowerShell. No WSL required. The VS Code extension and desktop app share your account and project CLAUDE.md if you want editor integration, and VibeFuse runs the official Claude Code CLI as a free harness widget on Windows beside Codex and Gemini with named sessions and local voice control.
Can I run Claude Code with other AI coding agents?
Yes — that is what an agent harness is for. VibeFuse is the first ever free widget-based AI harness: Claude Code, Codex, and Gemini as live widgets on one Windows canvas, sessions named and resumable, MCP tools attached, local Whisper + Piper voice. Skills in SKILL.md format are portable across Claude Code and the VibeFuse marketplace, where creators keep 80% of sales.