← Back

Claude Code Extension Concepts

Summary Table

⚡ Command🔧 Tool / MCP🧠 Skill🛡️ Hook📦 Plugin
What it is Manual shortcut External connection protocol Reusable workflow instructions Deterministic lifecycle rule Bundled distribution package
Activation User types /cmd On demand / always available Auto (context-matching) Always — guaranteed Via install
Scope Claude Code only Claude-wide + multi-vendor Claude-wide Claude Code only Claude Code only
Token cost Minimal Front-loads all capabilities ~100 tokens until needed Zero (runs outside Claude) Depends on contents
Best for Manual workflows External APIs & data Repeatable expertise Enforcing quality gates Team sharing & distribution
Can contain Prompts / bash scripts Tool definitions Instructions + scripts Shell commands / prompts / agents Skills + MCP + Agents + Hooks
Installation Save .md to .claude/commands/ Add to config or claude mcp add Place in .claude/skills/ or via plugin .claude/settings.json or /hooks /plugin install or npm i
Examples /review, /deploy, /write-plan, /audit GitHub, Postgres, Slack, Filesystem, Brave Search tdd, code-review, docx, internal-comms, deploy Auto-lint, test gate, notification, security scan supabase-pack, devops-automation-pack, skills-toolkit

Layered Mental Model

Ordered by learning sequence

Claude Code Extension & Customization ├── 1. Commands → user-triggered shortcuts ├── 2. MCP / Tools → external connections (GitHub, DBs, APIs) ├── 3. Skills → auto-loaded domain expertise ├── 4. Hooks → guaranteed enforcement at lifecycle events └── 5. Plugins → bundled distributions of the above

In a single sentence each:


Installation Methods

⚡ Commands

# Save a markdown file to the commands directory
.claude/commands/review.md   # → triggers as /review
.claude/commands/deploy.md   # → triggers as /deploy

🔧 MCP / Tools

# Via CLI
claude mcp add <server-name>

# Or manually in .mcp.json (project-level)
{
  "mcpServers": {
    "github": { "command": "npx", "args": ["@modelcontextprotocol/server-github"] }
  }
}

🧠 Skills

# Drop a folder into your project
.claude/skills/my-skill/
├── SKILL.md       # instructions + YAML frontmatter
├── scripts/       # optional executables
└── resources/     # optional supporting files

# Or install via plugin marketplace
/plugin marketplace add anthropics/skills

🛡️ Hooks

# In .claude/settings.json
{
  "hooks": {
    "PostToolUse": [{
      "matcher": "Write|Edit",
      "hooks": [{ "type": "command", "command": "npm run lint:fix" }]
    }]
  }
}

# Or interactively via /hooks menu

📦 Plugins

# Install from marketplace inside Claude Code
/plugin install supabase-pack

# Or via npm
npm i @intentsolutionsio/supabase-pack
See real examples: View the CLAUDE.md & AGENTS.md from this repository side by side — the project-level config files that Claude Code and Codex read at session start.

Configuration Scoping — Where You Put Things Matters

Every piece of Claude Code configuration — hooks, skills, commands, MCP servers, and CLAUDE.md — is directory-scoped. The directory you launch Claude from determines which configuration is active. This has real practical consequences:

Example: If you add a PostToolUse lint hook to ~/.claude/settings.json (user level), it fires on every project you open — even repos where that linter isn’t installed or applicable. Put the same hook in the project’s .claude/settings.json instead, and it only runs when you launch Claude from that project.

Scope Hierarchy (highest precedence first)

ScopeLocationApplies toShared?
ManagedSystem directories (IT/enterprise)All users on machineYes (admin-deployed)
Local.claude/settings.local.jsonYou, current project onlyNo (gitignored)
Project.claude/settings.jsonAll project collaboratorsYes (committed to git)
User~/.claude/settings.jsonYou, all your projectsNo

How Each Config Type Resolves

ConfigResolution rule
Settings & HooksMerged across scopes. Arrays concatenate; objects use highest-precedence scope. A hook defined at user level runs everywhere unless overridden.
CLAUDE.mdWalks up the directory tree from your working directory, loading every CLAUDE.md it finds. Subdirectory files lazy-load when Claude reads files there. User-level ~/.claude/CLAUDE.md applies to all projects.
SkillsDiscovered from the project’s .claude/skills/. Not inherited from parent directories or user home.
CommandsDiscovered from the project’s .claude/commands/. User-level commands in ~/.claude/commands/ are available everywhere.
MCP ServersThree scopes: local (you + this project), project (.mcp.json, shared), user (~/.claude.json, all projects). Local > Project > User.

Practical Rule of Thumb


Popular Examples by Category

⚡ Commands

CommandWhat it does
/reviewFull code review of current file
/deploy --productionRuns deployment checklist and executes deploy
/write-planBrainstorms and writes an implementation plan
/audit --comprehensiveFull project health audit
/create-skillGuided workflow to generate a new Skill file

🔧 MCP / Tools

ServerWhat it does
githubRead PRs, create issues, review code diffs
postgresQuery your database in plain English
slackRead channels, post messages, search threads
filesystemRead/write local files outside the chat
brave-searchLive web search mid-conversation

🧠 Skills

SkillAuto-activates when…
tddYou ask Claude to write tests
code-reviewYou paste code and ask for a review
docxYou ask Claude to create/edit a Word document
internal-commsYou ask Claude to draft a company announcement
deployYou mention deployment or release

🛡️ Hooks

Hook Lifecycle Events

EventFires when…Can block?
PreToolUseBefore any tool executesYes
PostToolUseAfter any tool executesNo
UserPromptSubmitBefore Claude sees your promptYes
NotificationClaude needs your attention/inputNo
StopClaude finishes a responseNo
SessionStartSession begins or resumesNo
PreCompactBefore conversation compactionNo

Handler Types

TypeHow it worksBest for
commandRuns a shell script, pass/fail via exit codeFormatting, test gates, git guards
promptSends a prompt to Claude for evaluationSemantic checks, security review
agentSpawns a subagent with tool accessDeep code analysis, complex validation

Popular Hook Examples

HookWhat it enforces
PostToolUse on Write/Edit → npm run lint:fixAuto-format every file Claude touches
PreToolUse on git commit → run testsBlock commits until tests pass
Notification → OS/Slack alertPing you when Claude is waiting for input
UserPromptSubmit → security scanBlock prompts that reference sensitive files
SessionStart → load git statusInject fresh context at session start

📦 Plugins

Example Plugin Bundles

PluginWhat's inside
supabase-packSkills for auth, storage, edge functions + MCP for DB
devops-automation-packCI/CD skills + /deploy, /audit commands + lint hooks
skills-toolkitSkill-creator agent + /create-skill command + templates
openrouter-packSkills + MCP for routing LLM calls across providers

Illustrative examples of what a Claude Code plugin bundle could contain, not a verified marketplace ranking.


Built-in Session Management Commands

Not part of the extension stack — native Claude Code utilities

CommandWhat it does
/initGenerate a CLAUDE.md scaffold for the current project
/contextShow current token usage vs. context window limit
/clearWipe conversation history; re-reads CLAUDE.md
/compactSummarize conversation to save tokens
--continue / -cLoad the most recent conversation in the current directory
--resume / -rResume a specific session by ID or name (CLI flag)
/resumeReopen a saved conversation (interactive slash command)