Claude Code How-To: Install, Workflow, CLAUDE.md, Skills, Subagents, MCP & Hooks
Claude Code is easy to misread as "chat that writes files." It isn't. It is an AI coding agent with an agentic loop, a context window, tools, and a permission system — you steer it through Explore → Plan → Code → Commit, then harden the workflow with CLAUDE.md, skills, subagents, MCP, and hooks.
1. What Claude Code actually is
From Claude Code 101 and Claude Platform 101: chat answers a question and the thread ends. An agent sends structured requests, chooses tools, observes results, and loops until the goal is done — under a context window and permission rules.
| Piece | Role |
|---|---|
| Agentic loop | Act → observe → decide → repeat until done or blocked |
| Context window | Everything Claude can "see" this session (files, tool results, your messages) |
| Tools | Read/edit files, run shell, search, Git, MCP servers, built-ins |
| Permissions | What runs without asking vs what needs approval |
| Project memory | CLAUDE.md, Skills, hooks — durable instructions across sessions |
How it differs from chat-based AI:
- Works inside your repo (not a paste-in playground)
- Proposes and applies edits under a permission mode you choose
- Can run tests, Git, and tools as part of completing a task
- Is customisable with project memory, skills, subagents, MCP, and hooks
Interfaces (same agent, different surfaces) — see Claude Code docs:
- Terminal CLI (
claude) - VS Code / JetBrains extensions
- Claude Desktop / Claude web (
claude.ai/code) - CI: GitHub Actions / GitLab, headless / routines (covered in Claude Code in Action)
Who it is for: new developers learning AI-assisted workflows, and experienced engineers who want an agent in the daily loop — not only autocomplete.
2. Prerequisites
| Need | Notes |
|---|---|
| Terminal + editor comfort | Basic shell and a code project |
| Account | Claude Pro, Max, Team, or Enterprise, or Console API key with credits |
| Enterprise cloud (optional) | Amazon Bedrock, Google Vertex / Cloud, or Microsoft Foundry |
| Windows tip | Prefer Git for Windows so the Bash tool works; WSL does not need it |
Fluency context (optional but useful before heavy agent use):
- AI Fluency: Framework & Foundations — Delegation, Description, Discernment, Diligence (4D)
- AI Capabilities and Limitations — next-token prediction, knowledge, working memory, steerability
3. Install and first login
Official path: Install · Quickstart.
Native installer (recommended)
macOS / Linux / WSL:
curl -fsSL https://claude.ai/install.sh | bash
Windows PowerShell:
irm https://claude.ai/install.ps1 | iex
Windows CMD:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
Package managers
# Homebrew (stable; does not auto-update — brew upgrade claude-code)
brew install --cask claude-code
# WinGet
winget install Anthropic.ClaudeCode
Linux package managers (apt / dnf / apk) are also documented under setup.
Verify:
claude --version
Log in and start
cd /path/to/your/project
claude
On first run you authenticate in the browser. Alternatives: ANTHROPIC_API_KEY, /login, or org cloud gateway / Bedrock / Vertex. Credentials persist after the first successful login.
Useful shell entry points:
| Command | What it does |
|---|---|
claude | Interactive session |
claude "task" | One-shot task in the project |
claude -p "query" | Print answer and exit |
claude -c | Continue most recent conversation here |
claude -r | Resume a previous conversation |
Inside a session: /help, /clear, /exit (or Ctrl+D twice).
4. Mental model: agentic loop + permissions
Agentic loop
You set a goal
→ Claude reads / searches / plans
→ Calls tools (edit, shell, MCP, …)
→ Observes results
→ Continues or asks you
→ Done (or blocked by permissions / context)
Claude Platform 101 teaches the same loop for API apps; Claude Code is that loop pre-wired for a codebase.
Permission modes (Shift+Tab to cycle)
| Mode | Behaviour | Best for |
|---|---|---|
| Default | Reads freely; asks before edits and many commands | First sessions, shared components |
Accept edits (acceptEdits) | Auto-applies file edits; still confirms risky commands | Scoped tasks with review of the final diff |
| Plan | Investigate and propose only — no edits | Unfamiliar repos, large changes, design review |
| Bypass / auto (advanced) | Minimal prompts or background safety checks | Sandboxes, throwaway repos, trusted CI — not day-one |
Start in Plan on any repo you did not write. Graduate to Default, then Accept edits only when the plan and test net are solid.
5. Core workflow: Explore → Plan → Code → Commit
This is the spine of Claude Code 101.
Explore
Ask Claude to map the system before changing it:
what does this project do?
what technologies does this project use?
where is the main entry point?
explain the folder structure around auth/
Plan
Switch to Plan mode (Shift+Tab), then:
Plan how to add rate limiting to the public API.
Do not edit files yet. List files you would touch and risks.
Read the plan. If it touches unexpected files, ask why. Rework the plan until you would bet your own name on it.
Code
Leave Plan mode. Give a crisp execution prompt:
Implement the approved plan for API rate limiting.
Follow existing patterns in middleware/.
Add tests. Do not change unrelated modules.
Review the diff. Prefer small vertical slices over "rewrite the service."
Commit
Commit after each logical change — not after a three-hour mega-session:
commit my changes with a descriptive message
A clean commit is your rewind point when the agent drifts.
Rule of thumb by codebase risk:
| Situation | Mode / stance |
|---|---|
| Greenfield + good tests | Accept edits OK after a short plan |
| Shared libraries / auth / payments | Plan only; human reviews every diff |
| Legacy, no tests | Explore deeply; tiny edits; never bypass permissions |
| New clone | /init → edit CLAUDE.md before any feature work |
6. Context management
The context window is finite. Claude Code 101 emphasises staying productive with:
| Command | Use when |
|---|---|
/context | You want to see what is filling the window |
/compact | The session is long but you still need continuity — summarise and keep working |
/clear | The topic is done; start a fresh task without baggage |
Claude Code in Action goes further: direct compaction so summaries keep what matters, and the rewind menu to course-correct long sessions without starting from zero.
Practical habits:
- One goal per session when possible.
- Compact before the model gets "foggy," not after it invents APIs.
- Clear between unrelated features.
- Prefer subagents for research dumps that would pollute the main thread (next sections).
7. CLAUDE.md — project memory that sticks
CLAUDE.md is a README for the agent: conventions, commands, architecture constraints, and "never do this."
Scopes
| Location | Scope |
|---|---|
~/.claude/CLAUDE.md | Your personal defaults across projects |
./CLAUDE.md or ./.claude/CLAUDE.md | Shared project rules (commit it) |
./CLAUDE.local.md | Local overrides (usually gitignored) |
Nested CLAUDE.md | Loads when Claude works in that subtree |
Bootstrap:
/init
Then edit ruthlessly. Claude Code in Action stresses a lean file Claude actually follows — not a novel.
What to put in
- How to build, test, lint, and run
- Package / module boundaries
- Naming and error-handling conventions
- Forbidden actions (e.g. no force-push, no production secrets, no drive-by refactors)
- Links to deeper docs (keep the file short; point elsewhere)
What to leave out
- Long tutorials Claude can discover by reading code
- Duplicate of Skills you will trigger on demand
- Vague slogans ("write clean code")
8. Skills — teach once, trigger automatically
From Introduction to agent skills: Skills are reusable markdown procedures (SKILL.md) Claude applies when the task matches the skill description.
Skills vs other customisation:
| Mechanism | Job |
|---|---|
| CLAUDE.md | Always-on project constitution |
| Skills | On-demand procedures (release, migrate, review checklist) |
| Hooks | Deterministic enforcement (format, block commands, gate on tests) |
| Subagents | Isolated workers with their own context |
Build a skill
- Create a skill directory with
SKILL.mdfrontmatter (name + description that matches real user phrasing). - Use progressive disclosure — short frontmatter/description in context; detail files loaded when needed.
- Optionally restrict tools with
allowed-tools. - Optionally add scripts that run without stuffing the context window.
Share
- Commit skills in the repo for the team
- Distribute via plugins
- Enterprise: managed settings org-wide
Troubleshoot: skill never triggers → rewrite the description to match how people ask; priority conflicts → narrow descriptions; runtime errors → check tool allowlists and script paths.
9. Subagents — keep the main context clean
From Introduction to subagents: a subagent gets its own context window, does focused work, and returns a summary — your main conversation stays sharp.
Use /agents to create specialists (code reviewer, docs writer, test author, security pass).
Design patterns that work:
- Structured output format (findings, files touched, open risks)
- Explicit obstacle reporting ("blocked on missing env X")
- Limited tool access (reviewer may not need write)
When to use: large research, parallel investigation, noisy log diving, specialised review.
When not to: tiny one-file edits (overhead > value), or tasks that need the full conversational history already in the main thread.
10. MCP — connect Claude Code to real systems
Claude Code 101 and Introduction to MCP treat MCP as how you attach external tools and data without hand-rolling every schema.
Three primitives:
| Primitive | Control | Example |
|---|---|---|
| Tools | Model-controlled | Create ticket, run query |
| Resources | App-controlled | Read-only docs, configs |
| Prompts | User-controlled | Prebuilt workflows |
Transports (MCP Advanced Topics):
- stdio — local servers launched by the client
- Streamable HTTP / SSE — remote servers, sessions, scaling trade-offs
In Claude Code, wire MCP servers in settings, verify with the MCP Inspector mindset (list tools → call one → confirm permissions), then use them in normal prompts ("use the Linear MCP to…").
Deeper playbook material: MCP overview, Build an MCP server, Build an MCP client.
11. Hooks — rules that cannot be skipped
Hooks are deterministic controls: format on save-equivalent events, block dangerous commands, notify, or gate turns on real test results.
Use hooks when prose in CLAUDE.md is not enough ("please run tests" is advisory; a hook that fails the turn if tests fail is policy).
Typical uses from Claude Code 101 / In Action:
- Enforce formatter / linter
- Block
rm -rf, force-push, or prod credential paths - Require green unit tests before accepting a multi-file change
- Notify the team channel when a long routine finishes
Combine: CLAUDE.md (intent) + Skills (procedure) + Hooks (enforcement).
12. Daily prompts that work
Be specific:
Fix the login bug where users see a blank screen after wrong credentials.
Reproduce from the auth tests if possible.
Break large work:
1. Add the user_profiles table migration
2. Add GET/PATCH /api/profile
3. Add the profile edit page
Stop after each step for review.
Code review:
Review my uncommitted changes. Focus on security, missing tests, and API contract breaks.
Git:
create a branch feature/rate-limit and open a PR summary when tests pass
13. From solo prompts to trusted long runs
Claude Code in Action is the next course after 101. Capstone ideas:
| Theme | Practice |
|---|---|
| Steer | Plan mode, compaction, rewind, hands-on vs goal/loop autonomy |
| Configure | Lean CLAUDE.md, skills, permission mode per job, hooks |
| Automate | Routines on Anthropic infra, headless CLI in your pipeline, GitHub Action + managed code review |
| Verify | Review unsupervised work in proportion to how little you watched; gate on tests; package a trusted setup as a plugin for the team |
Verification principle: the less you watched, the more you must verify — tests, diff review, and staging smoke beats vibes.
14. Anthropic Academy map (Claude-centric path)
All courses below are free on Anthropic Academy (Skilljar). You need a Skilljar login for progress tracking; a Claude account is separate if you want to use the product.
Start here (product & fluency)
| Course | Why |
|---|---|
| Claude 101 | Everyday Claude: projects, artifacts, skills, connectors, research |
| AI Fluency: Framework & Foundations | 4D collaboration skills |
| AI Capabilities and Limitations | Mental model of model behaviour |
Claude Code track (this article)
| Course | Why |
|---|---|
| Claude Code 101 | Install → EPCC → CLAUDE.md → subagents → skills → MCP → hooks |
| Introduction to agent skills | Deep dive on SKILL.md |
| Introduction to subagents | Delegation and context hygiene |
| Claude Code in Action | Long sessions, automation, verify & plugins |
Platform & API (build products on Claude)
| Course | Why |
|---|---|
| Claude Platform 101 | API → agent loop → tools → thinking → MCP → managed agents (TypeScript demos) |
| Building with the Claude API | Full Python path: prompts, tools, RAG, caching, MCP, agents |
| Claude with Amazon Bedrock | Same stack on AWS Bedrock |
| Claude on Google Cloud | Same stack on Vertex / Google Cloud |
MCP specialist
| Course | Why |
|---|---|
| Introduction to Model Context Protocol | Tools, resources, prompts in Python |
| MCP: Advanced Topics | Sampling, notifications, roots, stdio vs Streamable HTTP |
Audience adaptations of AI Fluency
| Course | Audience |
|---|---|
| AI Fluency for educators | Faculty / instructional design |
| Teaching AI Fluency | Instructor-led teaching & assessment |
| AI Fluency for students | Learners & career planning |
| AI Fluency for nonprofits | Mission-driven orgs (with GivingTuesday) |
| AI Fluency for small businesses | SMB operations |
| AI Fluency for builders | Product / engineering builders (with CodePath) |
| AI Fluency for pK–12 Educators | Path: educator + train-the-trainer |
Suggested order for an engineer:
Claude 101 (optional)
→ AI Fluency Foundations + Capabilities (optional)
→ Claude Code 101
→ Skills + Subagents
→ MCP Intro
→ Claude Code in Action
→ Platform 101 or Claude API / Bedrock / Vertex
→ MCP Advanced
15. Checklist: first productive week
- Install Claude Code;
claude --version; log in. - Open a real repo; ask "what does this project do?" in Plan mode.
- Run
/init; trimCLAUDE.mdto build/test commands and hard constraints. - Ship one tiny bugfix via Explore → Plan → Code → Commit.
- Add one Skill for a procedure you repeat weekly.
- Add one hook that runs tests or blocks a dangerous command.
- Connect one MCP server you already trust (docs, tracker, or DB read-only).
- Create one subagent for code review; use it on your next PR.
- Enrol in Claude Code 101; schedule In Action after a week of daily use.
16. Related playbook reading
- Claude Certified Architect – Foundations
- MCP overview · Build server · Build with Agent Skills
- Building production-grade AI agents
- Official docs: Quickstart · Install
Distilled from Anthropic Academy Skilljar course outlines (Claude Code 101, Claude Code in Action, agent skills, subagents, MCP, Platform/API/Bedrock/Vertex, and AI Fluency paths) plus current Claude Code documentation. Course pages remain the source of truth for video lessons and certificates.
Discussion
Comments
Share feedback or questions about this page. No account required.
Loading comments…