Step 1 of 4
Claude Code Mastery
From first install to power user: CLAUDE.md, skills, subagents, MCP, hooks, plan mode, permissions, worktrees, and design tooling.
17 min read
Claude Code is an agentic coding tool: it reads your codebase, edits files, runs commands, and works through multi-step tasks with you. It runs in the terminal, in VS Code and JetBrains, in a desktop app, and on the web. This guide takes you from a fresh install to the concepts power users rely on, then covers the tooling that makes its frontend work look designed rather than generated.
Getting started#
1. Pick your surface#
Claude.ai
chatConversations, Projects with shared files, and artifacts. The best place to learn prompting, draft, and research.
Claude API
buildProgrammatic access for your own apps. Create a key in the Claude Console and call the Messages API from any SDK.
Claude Code
codeThe agent that works in your repository: terminal, IDE extensions, desktop app, and web.
2. Install Claude Code#
# macOS, Linux, WSL - native installer
curl -fsSL https://claude.ai/install.sh | bash
# or with npm
npm install -g @anthropic-ai/claude-code
Then, from your project folder:
cd my-project
claude # start an interactive session (sign in on first run)
3. Your first session#
- Run
/init. Claude explores the repository and writes a starter CLAUDE.md describing how to build, test, and navigate it. - Ask a question about the codebase: "How does authentication work here?" Claude reads the relevant files and explains.
- Ask for a small change: "Add input validation to the signup form and a test for it." Review each proposed edit.
- Ask it to run the tests and fix anything that fails.
20 core concepts#
Context and memory#
CLAUDE.md
Persistent instructions read at the start of every session: build commands, conventions, gotchas. Project-level (checked in), personal (~/.claude/CLAUDE.md), or local. Repositories using AGENTS.md work too.
Auto memory
Claude can record learnings from your corrections so it doesn't repeat mistakes across sessions.
Context window
Everything Claude sees - conversation, files read, tool output. It's finite; manage it deliberately.
/compact
Summarize the conversation to reclaim context while keeping the important state. Add focus instructions, e.g. /compact keep the API decisions.
/clear
Start fresh between unrelated tasks. Stale context from the last task hurts the next one.
- Context window
- The maximum amount of text (measured in tokens) the model can process at once - conversation history, file contents, and tool output all share this space.
- Prompt caching
- Reusing the processed form of repeated context (system prompt, CLAUDE.md, files read earlier) across calls, cutting cost and latency for long sessions.
- CLAUDE.md
- A Markdown file of persistent instructions read at the start of every Claude Code session - build commands, conventions, and project-specific guidance.
Extending Claude#
Skills
Reusable instructions in a SKILL.md (e.g. .claude/skills/deploy/SKILL.md), loaded automatically when relevant or invoked with /skill-name. Custom slash commands are now skills.
Slash commands
Built-ins like /init, /compact, /rewind, /mcp, /plugin - plus your own skills invoked by name.
Subagents
Specialized agents defined in .claude/agents/ with their own prompt, tools, and separate context. Great for parallel research or focused reviews without cluttering the main thread.
MCP servers
Connect external tools and data - GitHub, databases, browsers, docs - via the Model Context Protocol (claude mcp add ...).
Hooks
Shell commands that run automatically on events like PreToolUse, PostToolUse, or Stop - run formatters after edits, block writes to protected files, notify when done.
Plugins
Bundles of skills, agents, hooks, and MCP servers installed as one unit from a marketplace via /plugin.
Control and safety#
Permission modes
Six modes, cycled with Shift+Tab: Manual (default - asks before most actions), acceptEdits, plan, auto (a classifier reviews actions), dontAsk (only pre-approved tools, for CI), and bypassPermissions (isolated containers only).
Plan mode
Claude researches and proposes a plan without editing anything until you approve. Use it for architectural changes and unfamiliar code.
Permission rules
Allow, ask, or deny specific tools and commands in settings - e.g. deny Bash(git push *). Deny rules apply in every mode.
Checkpoints and /rewind
Claude checkpoints its edits. Run /rewind (or press Esc twice) to roll code and/or conversation back to an earlier point.
Scale and speed#
Worktrees
claude --worktree feature-auth starts an isolated session on its own branch and checkout, so parallel sessions don't collide.
Headless mode
claude -p "prompt" runs non-interactively and prints the result - pipe it into scripts, CI jobs, and other tools.
Background tasks
Ctrl+B sends a running command or agent to the background so you can keep working; /tasks shows what's running.
Extended thinking
Give Claude more reasoning budget for hard problems - debugging subtle issues, designing systems, weighing trade-offs.
Prompt caching
Repeated context (system prompt, CLAUDE.md, files) is cached automatically, making long sessions faster and cheaper.
A workflow that works#
- 01ExploreRead relevant code; don't edit yet
- 02PlanPlan mode; agree on the approach
- 03ImplementSmall, verifiable steps
- 04VerifyRun tests, lint, check the UI
- 05CommitClear message; open a PR
UI design tools for Claude Code#
Coding agents default to generic, forgettable interfaces - the same gradients, card grids, and spacing everywhere. Five kinds of tooling fix that:
Anti-slop frontend skills
tasteSkills that push toward distinctive, production-grade design: committed typography and color choices, real hierarchy, and a checklist of generic patterns to avoid. Anthropic's frontend-design skill is a good starting point.
Interface guidelines
rulesWritten rules for accessibility, focus states, forms, motion, and performance that the agent audits its UI against - e.g. Vercel's web interface guidelines.
Design-system references
consistencyPoint the agent at a real design system (tokens, components, examples) so it composes from your parts instead of inventing new ones.
Image-to-code
referencePaste a screenshot or mockup and ask for a faithful implementation - then iterate by comparing screenshots side by side.
Browser screenshots
verifyA browser tool (such as the Playwright MCP server) lets Claude open the page, take screenshots, and check its own work at different widths and themes.