Go beyond vibe coding. Learn to use Claude Code as a professional tool — from basic prompting to custom agents and team workflows.
Getting Started
Beyond Vibe Coding
Essential Commands
Workflows
CLAUDE.md & Memory
Skills
Agents
Customization
Tips & Next Steps
Installing Claude Code
Prerequisite
Homebrew must be installed on your Mac.
Install via Homebrew
Run this in your terminal:
brew install claude-code
Verify Installation
claude --version
Update Later
brew upgrade claude-code
Run /doctor anytime to check your installation health.
Login Options
Two ways to authenticate with Claude Code:
Option A: Subscription (claude.ai)
Use your Claude Pro/Team/Enterprise subscription.
claude# Select "Claude.ai" at the login prompt# Opens browser for OAuth
Best for: Individual developers, teams with existing subscriptions
Option B: API Key
Use an Anthropic API key (pay per token).
export ANTHROPIC_API_KEY=sk-ant-...claude
Best for: CI/CD, automation, pay-as-you-go usage
Your First Session
Start Claude Code
Navigate to your project and run:
cd ~/my-project
claude
What Happens
Claude Code scans your project structure, reads CLAUDE.md (if it exists), and opens an interactive REPL where you can type prompts.
Key Concept
Claude Code is project-aware. Always run it from your project's root directory so it understands your codebase.
The Interface
╭──────────────────────────────────────╮│Claude Code v2.1.33
│ Model: claude-opus-4-6
│ Project: ~/my-project
╰──────────────────────────────────────╯> Type your prompt here...
Quick Reference
⌨️
EnterSubmit your prompt
↩️
Shift+Enter or \New line (multiline input)
🛑
Ctrl+CCancel current generation
🚪
Ctrl+D or /exitExit Claude Code
Beyond Vibe Coding
Effective prompting that produces real, production-quality results — not AI slop.
Your First Prompt
Try This
Start simple — ask Claude to understand your project:
> Read the README.md and give me a summary of this project
Claude will use the Read tool to open the file, then summarize it. You'll see the tool call in the output.
What Just Happened?
1️⃣
Claude read your promptUnderstood you want a summary
2️⃣
Used the Read toolOpened README.md from your project
3️⃣
Responded with a summaryBased on actual file contents, not guessing
Good vs Bad Prompts
The difference between vibe coding and professional usage:
❌ Vibe Coding
make it work
fix the bug
add a login page
refactor everything
Vague, no context, no constraints. Claude guesses — and often guesses wrong.
✅ Professional
The /api/users endpoint returns 500 when email is null. Add validation in src/routes/users.ts
Add JWT auth middleware to the Express routes in src/middleware/. Follow the existing pattern in auth.ts
Specific file, specific problem, specific approach.
Providing Context
Key Rule
The more context you give, the better Claude performs. Use @ to reference files directly in your prompt.
Try This
> Look at @src/api/routes.ts and @src/models/user.ts
Add input validation for the create user endpoint
Context Tips
📄
@file/pathReference specific files for Claude to read
📸
Paste screenshotsCtrl+V to paste images of errors or UI
📋
Paste error logsCopy the full error message into your prompt
How Claude Uses Tools
Claude Code doesn't just generate text — it takes actions using tools:
File Tools
Read — Read file contents
Edit — Modify existing files
Write — Create new files
Glob — Find files by pattern
Grep — Search file contents
Action Tools
Bash — Run shell commands
Task — Spawn subagents
WebFetch — Fetch URLs
WebSearch — Search the web
Skill — Invoke skills
Important
Claude asks for permission before running potentially dangerous commands. Always review what it's about to do.
File Operations
Reading Files
> Read the package.json file
Editing Files
> In src/utils/format.ts, change the date format from MM/DD to DD/MM
Creating Files
> Create a new test file for the user service at tests/user.test.ts
Pro Tip
Always tell Claude which file to edit. Don't say "fix the bug" — say "fix the null check in src/handlers/auth.ts line 42".
Bash Commands & Search
Running Commands
> Run the test suite: npm test
> Check which port the server is using
> Install express as a dependency
Searching the Codebase
> Find all files that import the UserService class
> Search for any TODO comments in the src directory
> Find where the API_KEY environment variable is used
Pro Tip
Use ! prefix for quick bash commands: !git status runs the command and shows output without Claude analyzing it.
Understanding the Context Window
Key Concept
Claude has a context window — a limit on how much conversation it can remember. Think of it as short-term memory.
What Fills Up Context
💬
Your promptsEvery message you type
📄
File contentsEvery file Claude reads gets added to context
🖥️
Command outputResults from bash commands and tool calls
🤖
Claude's responsesEverything Claude says back to you
When Context Fills Up
Claude auto-compacts (summarizes) old messages. Run /compact manually at ~50% to stay in control.
Prompting Best Practices
🎯
Be specific about files"In src/api/users.ts" not "in the user code"
🔍
Describe the problem, not just the fix"The API returns 500 when..." not "make it work"
📐
Reference existing patterns"Follow the pattern in auth.ts" gives Claude a template
🧩
One task at a timeSmall, focused requests get better results than mega-prompts
✅
Ask Claude to verify"Run the tests after making changes" catches errors early
📸
Provide screenshots for UI issuesA picture is worth a thousand words of description
Essential Commands
Slash commands that transform Claude Code from a chatbot into a power tool.
/help
Try This
> /help
Shows all available slash commands. This is your starting point when you forget a command.
Commands You'll Use Most
Daily Use
/model — Switch models
/plan — Plan before coding
/compact — Free up context
/cost — Check spending
Project Setup
/init — Create CLAUDE.md
/memory — Edit memory
/config — Settings
/doctor — Diagnostics
/model — Switch Models
Try This
> /model
Opens the model picker. Use arrow keys to select:
🧠
Opus 4.6 (Default)Most capable — complex tasks, architecture, debugging
⚡
Sonnet 4.5Fast and capable — everyday coding, quick edits
Plan first, execute second. Professional workflows that prevent wasted effort.
Why Plan Before Code
❌ Without Planning
1. Ask Claude to add a feature
2. Claude writes code immediately
3. Wrong approach — redo everything
4. Context wasted, tokens burned
50% of context gone before the real work starts.
✅ With Planning
1. Enter plan mode
2. Claude explores and proposes approach
3. You review and approve
4. Claude executes the approved plan
Right approach from the start. Context preserved.
Plan Mode in Practice
Step by Step
# Step 1: Enter plan mode> /plan
# Step 2: Describe what you want> Add pagination to the /api/products endpoint
# Step 3: Claude explores and writes a plan# (reads files, checks patterns, proposes approach)# Step 4: Review the plan and approve it# Claude then executes the approved plan
Rule of Thumb
Always start with plan mode for any task that touches more than 2-3 files or involves architectural decisions.
Task Lists
For complex tasks, Claude creates a task list to track progress:
> Add user authentication with JWT, including:
- Login endpoint
- Register endpoint
- Auth middleware
- Token refresh
- Tests for all endpoints
Claude breaks this into individual tasks and shows progress as it works through each one.
Best Practice
Break subtasks small enough that each can be completed in under 50% context. Commit after each subtask.
The Commit Workflow
Ask Claude to Commit
> Commit these changes with a descriptive message
Claude will:
1️⃣
Run git status & diffReviews all staged and unstaged changes
2️⃣
Draft a commit messageFocuses on "why" not "what", following your repo's style
3️⃣
Stage and commitAdds specific files (not git add -A) and creates the commit
Important
Commit often — as soon as a task is completed. This gives you clean rollback points.
The PR Workflow
Ask Claude to Create a PR
> Create a pull request for these changes
Claude will:
1️⃣
Review all commits on the branchAnalyzes the full diff from base branch
2️⃣
Write PR title & descriptionSummary, test plan, and changes overview
3️⃣
Push and create PR via gh CLIUses GitHub CLI to create the pull request
Workflow Best Practices
🗺️
Always start with plan modeFor any non-trivial task
🧩
Break tasks into small piecesEach subtask should complete in under 50% context
💾
Commit after each subtaskClean rollback points, not one mega-commit
📦
Manual /compact at ~50%Don't wait for auto-compact
🤖
Vanilla Claude Code for small tasksSimple tasks don't need elaborate workflows
CLAUDE.md & Memory
Make Claude remember your project, conventions, and preferences across every session.
What is CLAUDE.md?
Key Concept
CLAUDE.md is a markdown file that Claude reads at the start of every session. It's your project's instruction manual for Claude.
Think of it like a README, but for Claude. It tells Claude:
📋
Project overviewWhat this project does, its architecture
Critical rulesThings Claude must always or never do
Creating CLAUDE.md
Try This
> /init
Claude scans your project and generates a CLAUDE.md with:
# CLAUDE.md## Project Overview
A Node.js REST API for managing user accounts...
## Key Components
- src/routes/ — API endpoints
- src/models/ — Database models
- src/middleware/ — Auth and validation
## Development Commands
- npm run dev — Start development server
- npm test — Run test suite
## Coding Conventions
- Use TypeScript strict mode
- Follow existing error handling patterns in src/utils/errors.ts
What to Include in CLAUDE.md
✅ Include
Project architecture overview
Build and test commands
Key file locations
Coding conventions
Common patterns to follow
Critical do's and don'ts
❌ Avoid
Entire API documentation
Long code examples
Secrets or API keys
Information that changes often
Anything over 150 lines total
Keep It Under 150 Lines
Critical Rule
CLAUDE.md should not exceed 150 lines. Longer files dilute the instructions — Claude may ignore parts of it.
If You Need More Space
📄
Use RulesPut topic-specific instructions in .claude/rules/*.md files
📚
Use SkillsPut domain knowledge in .claude/skills/ — loaded on demand
🔗
Reference filesPoint to docs rather than inlining content
/memory Command
Try This
> /memory
Opens all your CLAUDE.md files in an editor so you can add or modify instructions.
Memory Hierarchy
# Loaded in this order (all combined):
~/.claude/CLAUDE.md # Global — all projects
.claude/CLAUDE.md # Project — shared with team
.claude/CLAUDE.local.md # Local — personal, git-ignored
Claude also learns automatically — it may add notes to a separate auto-memory file as you work.
Rules (.claude/rules/)
What Are Rules?
Modular, topic-specific instructions in individual markdown files. Unlike CLAUDE.md, rules can be scoped to specific paths.
# .claude/rules/testing.md
---
globs: ["src/**/*.test.ts", "tests/**"]
---
When writing tests:
- Use vitest, not jest
- Follow AAA pattern (Arrange, Act, Assert)
- Mock external dependencies
This rule only activates when Claude is working on test files — keeping context clean for other tasks.
Memory Best Practices
📏
CLAUDE.md under 150 linesBrief, focused, high-signal instructions
📂
Use rules for specificsPath-scoped rules in .claude/rules/ for targeted guidance
👥
Commit project CLAUDE.mdTeam shares project conventions via git
🔒
Use .local.md for personal prefsGit-ignored, won't affect teammates
🔄
Review and trim regularlyOutdated instructions cause confusion
Skills
Reusable knowledge and workflows that Claude loads on-demand — like giving it a manual.
What Are Skills?
Key Concept
Skills are markdown files that contain domain knowledge — instructions, patterns, or workflows that Claude can load when needed. Think of them as micro-manuals.
Why Skills?
📚
Progressive DisclosureKnowledge loaded only when relevant — doesn't bloat every session
♻️
ReusableSame skill works across agents and workflows
👥
ShareableCommit to git — your whole team benefits
Skill Directory Structure
# Skills live in .claude/skills/
.claude/
skills/
weather-fetcher/
SKILL.md # Main skill file (required)
examples.md # Supporting file (optional)
weather-transformer/
SKILL.md
api-conventions/
SKILL.md
error-patterns.md
Key Rule
Each skill lives in its own directory under .claude/skills/. The SKILL.md file is the entry point.
SKILL.md Frontmatter
# .claude/skills/weather-fetcher/SKILL.md
---
name: weather-fetcherdescription: Fetch weather data from wttr.in API
---
Fetch the current temperature for a city using:
curl -s "wttr.in/{city}?format=%t"
Return only the temperature value in Celsius.
Frontmatter Options
📛
nameSkill identifier (uses directory name if omitted)
📝
descriptionWhen to invoke — helps Claude auto-discover the skill
🤖
modelOverride which model runs the skill
🔧
allowed-toolsRestrict which tools the skill can use
Creating Your First Skill
Try This
> Create a skill called "code-review" in .claude/skills/
that tells Claude how to review code:
- Check for security issues
- Check for performance problems
- Verify error handling
- Suggest improvements
Claude will create:
.claude/skills/code-review/SKILL.md
Pro Tip
You can also create skills manually — they're just markdown files. No special tooling required.
Invoking Skills
Manual Invocation (Slash Command)
> /weather-fetcher
> /code-review
Type / and the skill name to invoke it. The skill's content gets loaded into Claude's context.
Auto-Invocation
If a skill has a description field, Claude can discover and load it automatically when relevant.
Preloaded into Agents
# In an agent's frontmatter:skills:
- weather-fetcher
- weather-transformer
Skills preloaded into agents are available from the start — no manual invocation needed.
Skills Summary
What They Are
Markdown files with domain knowledge
Live in .claude/skills/
Have SKILL.md + optional supporting files
How to Use
/skill-name — manual invoke
Auto-discovered by description
Preloaded into agents via skills:
Skills vs CLAUDE.md
CLAUDE.md = always loaded, every session. Skills = loaded on-demand, when relevant. Use skills for knowledge that's only needed sometimes.
Agents
Custom agents with their own tools, skills, and personality — from simple helpers to complex workflows.
What Are Agents?
Key Concept
Agents are markdown files in .claude/agents/ that define a custom Claude persona with its own tools, model, skills, and behavior.
Two Ways to Use Agents
As Main Agent
Replaces the default Claude for your entire conversation.
# Set in settings.json"agent": "my-agent"# Or via CLI flag$ claude --agent my-agent
As Subagent
Spawned by Claude in an isolated context via the Task tool.
# Claude spawns it:
Task(
subagent_type="my-agent"
prompt="Review this PR"
)
Agent Frontmatter
# .claude/agents/code-reviewer.md
---
name: code-reviewerdescription: Reviews code for quality and best practicestools: Read, Grep, Globmodel: sonnetcolor: greenskills:
- code-review
memory: user
---
You are a code reviewer. Check for security issues,
performance problems, and suggest improvements.
Review your memory for patterns you've seen before.
Key Fields
tools — what the agent can do. skills — knowledge preloaded at startup. memory — persistent learning across sessions.
Example: The Weather Agent
This repository includes a working example of the Command → Agent → Skills pattern:
# .claude/agents/weather.md
---
name: weatherdescription: Fetch and transform weather datatools: Read, Write, WebFetch, Bashmodel: haikucolor: cyanskills:
- weather-fetcher
- weather-transformer
---
You are a weather agent. Use your preloaded skills
to fetch weather data and apply transformations.
How It Works
The agent starts with both skills already loaded — it knows how to fetch weather and how to transform the data without being told.
haikuFast, cheap — great for simple, focused tasks
Agents with Preloaded Skills
Key Pattern
Skills provide static knowledge (what to do). Agents provide execution context (how to do it, with which tools). Together, they're powerful.
# Agent with multiple skills preloaded
---
name: api-developertools: Read, Write, Edit, Bashmodel: sonnetskills:
- api-conventions # How we structure APIs
- error-handling # Error patterns to follow
- testing-patterns # How to write tests
---
Build API endpoints following the preloaded conventions.
The agent gets all three skills injected at startup — it already knows your team's patterns.
Now every time you run claude in this project, you'll talk to the api-developer agent instead of default Claude.
Per-Session Override
$ claude --agent code-reviewer
Manage Agents
Run /agents to view, create, edit, or delete agents interactively.
Subagents via Task Tool
Key Concept
Subagents run in an isolated context — separate from the main conversation. They do their work, return a summary, and their context is discarded.
# Claude spawns a subagent automatically or you can ask:> Use the code-reviewer agent to review src/api/users.ts
# Claude uses the Task tool internally:
Task(
subagent_type="code-reviewer",
prompt="Review src/api/users.ts for quality"
)
Built-in Subagent Types
ExplorePlanBashYour Custom Agents
Command → Agent → Skills
The full architecture pattern for complex workflows:
┌─────────────────────────────────────────────┐│/weather-orchestrator (Command) ││ Entry point — user invokes this ││ ↓ ││weather agent (Agent) ││ Orchestrates with preloaded skills ││ ↓ ││weather-fetcher + weather-transformer││ (Skills — domain knowledge) │└─────────────────────────────────────────────┘