‘Do You Know Claude Code?’ – Master CLAUDE.md, Skills, Subagents, MCP, Hooks & Plugins
The article explains how to turn Claude Code from a forgetful assistant into an engineered AI teammate by using CLAUDE.md for persistent project context, Skills for on‑demand knowledge, Subagents for isolated tasks, MCP for external tool integration, Hooks for enforced policies, and Plugins for easy sharing across projects.
01 | How Can Claude Remember Your Project?
Most users run Claude Code by opening a terminal, typing a request, and waiting for the result, then they have to repeat the entire project background—framework, build command, immutable files—each new session.
Claude Code already provides a solution: a CLAUDE.md file. When placed in the project root, Claude automatically reads it at the start of every session, using its contents as the base context.
Think of CLAUDE.md as an onboarding manual for a new teammate: the rules are read once, no need to repeat training.
~/.claude/CLAUDE.md # Global, loaded for all projects
my-project/CLAUDE.md # Project‑level, loaded at startup
my-project/web/CLAUDE.md # Loaded only when Claude accesses the web module
my-project/core/CLAUDE.md # Loaded only when Claude accesses the core moduleProject‑level rules (e.g., JDK version, build commands) go in the root file, while module‑specific rules go in sub‑directories, keeping the context focused.
02 | Where to Put Infrequently Used Knowledge?
Loading large files like a full architecture document into CLAUDE.md dilutes important rules because every word consumes Claude’s limited context window.
Claude Code solves this with Skills . A Skill is a folder containing a SKILL.md with front‑matter (name and description). Only the description is loaded initially; the full content is read on demand.
code-review # Review code changes with a team checklist
deploy-check # Deploy steps and rollback plan
db-migrate # Flyway migration guidelinesExample SKILL.md for a code‑review Skill:
---
name: code-review
description: Review code changes, includes team checklist and output format
---
Review changes for:
1. Avoid bypassing service layer to query DB
2. Validate parameters on new APIs
3. Proper error handling (throw vs swallow)
Output format: "Problem | Location | Suggestion"03 | How to Turn Claude Into a Small Team?
Long sessions cause Claude to become “dumber” because the context fills with intermediate logs and file contents, pushing out the original rules.
Human teams solve this by delegating work to members. Claude’s equivalent is a Subagent , which runs in an isolated context, performs the heavy lifting (search, analysis), and returns only the final summary.
Subagents are defined by a markdown file in .claude/agents/ with front‑matter (name, description, tools, model) and a system prompt describing the role.
---
name: code-reviewer
description: Specialized code review, checks security, performance, and conventions
tools: Read, Grep, Glob
model: haiku
---
You are a team code reviewer. Examine each changed file, focus on security and performance issues. Output only a list of problems and suggestions, no raw code snippets.Subagents can run in parallel (e.g., security, performance, test coverage) and only the concise results are merged back into the main conversation.
04 | How Can Claude Reach External Systems?
Claude can generate correct API calls (e.g., GitHub PR details) but cannot execute them. The Model Context Protocol (MCP) provides a unified interface for AI models to call external tools.
With MCP, Claude acts as a client and tools expose their capabilities via a server. Example GitHub MCP tools:
get_pull_request # Retrieve PR details and changes
list_issues # List repository issues with filters
add_issue_comment # Comment on an issue or PRRegister an MCP server (e.g., for GitHub) with a single command:
claude mcp add --transport http github https://api.githubcopilot.com/mcp/ \
--header "Authorization: Bearer YOUR_GITHUB_TOKEN"After registration, Claude can directly fetch a PR, run a Skill’s checklist, and comment the review back to the PR.
05 | Why Do Some Rules Get Ignored?
Rules in CLAUDE.md or Skills are just prompts; Claude follows them probabilistically. When the context is long or the task complex, the model’s attention drifts, causing “8 out of 10 times it works” behavior.
To enforce rules absolutely, Claude Code offers Hooks , which are shell commands triggered at specific lifecycle events (e.g., before or after a tool use). Hooks run regardless of the model’s willingness.
Hook configuration lives in settings.json with a matcher to select events and a command to execute. Exit code 0 allows the operation; exit code 2 blocks it and returns the error to Claude.
{
"hooks": {
"PostToolUse": [{
"matcher": "Edit|Write",
"hooks": [{
"type": "command",
"command": "jq -r '.tool_input.file_path' | xargs npx prettier --write"
}]
}]
}
}Example Hook that prevents editing sensitive files:
{
"PreToolUse": [{
"matcher": "Edit|Write",
"hooks": [{
"type": "command",
"command": "~/.claude/hooks/protect.sh"
}]
}]
} protect.shchecks the file path and aborts with exit code 2 if the file matches .env or contains “secret”.
06 | How to Package the Whole Configuration?
Managing many files (CLAUDE.md, Skills, Subagents, Hooks, MCP config) across projects is error‑prone. Claude Code introduces Plugins**—a package manager for these assets.
A Plugin is a directory with a fixed layout:
my-review-kit/
├── .claude-plugin/plugin.json # name, version, description
├── skills/ # Skill markdown files
├── agents/ # Subagent markdown files
├── hooks/ # Hook JSON configs
└── .mcp.json # MCP integration configPublish the Plugin to a Git repository (the “marketplace”). Team members add the marketplace and install the Plugin with a single command:
/plugin install my-review-kit@team-marketplaceUpdates are propagated automatically, ensuring every developer works with the same set of rules and tools.
07 | Putting the Six Pieces Together
Typical workflow for a code review:
Claude loads CLAUDE.md (project context).
User asks “review today’s PR”.
MCP fetches the PR diff from GitHub.
A code-reviewer Subagent runs, loading the code-review Skill to apply the checklist.
Claude returns a clean list of findings.
Hooks automatically format edited files and block modifications to sensitive files.
Results are posted back to the PR via MCP.
All configuration can be shared as a Plugin, guaranteeing consistency across the team while keeping security in mind (Hooks can execute arbitrary commands, so only trusted Plugins should be installed).
In summary, the six‑piece framework—CLAUDE.md, Skills, Subagents, MCP, Hooks, Plugins—turns Claude Code from a forgetful assistant into a disciplined, extensible AI teammate that scales across projects and teams.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Tech Enthusiast
Sharing computer programming language knowledge, focusing on Java fundamentals, data structures, related tools, Spring Cloud, IntelliJ IDEA... Book giveaways, red‑packet rewards and other perks await!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
