Skip to content

Skills, Hooks & Extending Claude Code

!!! info “You don’t need any of this on day one” Vanilla Claude Code is powerful enough to keep you busy for months. This page is for when you’re comfortable with the basics and want to customize or automate further. If you just installed Claude Code, come back here later.


Skills — Custom Commands You Can Build or Install

Section titled “Skills — Custom Commands You Can Build or Install”

Skills are reusable instructions that become slash commands inside Claude Code. Instead of re-typing a prompt you use all the time, you save it as a skill and invoke it with /yourcommand.

Why skills matter: Some tasks you run repeatedly with slight variations — “review my code before committing,” “summarize what I worked on today,” “generate a test for this function.” Skills turn those recurring prompts into one-word commands.

These come with Claude Code out of the box:

CommandWhat It Does
/helpShow available commands and shortcuts
/statusShow current session info, model, costs so far
/costShow token usage and estimated cost for this session
/memoryView and manage what Claude Code has stored in memory
/compactCompress the conversation history to free up context window
/clearStart fresh — wipe the current conversation

Skills live in your .claude/commands/ folder as Markdown files. The filename becomes the command name.

Create .claude/commands/review.md:

Review the code changes I'm about to commit. Look for:
- Bugs or logic errors
- Security issues (hardcoded secrets, SQL injection, etc.)
- Code that's hard to read or maintain
- Missing error handling
Be direct. List issues by severity: critical, medium, low.
For each issue, show the problematic line and suggest a fix.

Now inside any Claude Code session, you can type /review and it runs that full prompt automatically.

Project-level skills (in <project>/.claude/commands/) only appear in that project. Global skills (in ~/.claude/commands/) appear everywhere.

The Claude Code community shares skills on GitHub and forums. Search for “Claude Code slash commands” or “Claude Code skills.” Before installing anything, read what it does — you’re adding instructions that run inside your session.


Hooks let you attach behavior to events in Claude Code’s lifecycle. When something happens (Claude finishes a task, Claude is about to run a command, a session ends), a hook can trigger automatically.

This is where Claude Code starts to feel like an intelligent coworker with routines, not just a chat interface you have to drive manually.

Hooks are defined in your settings.json. Each hook listens for an event and runs a shell command when that event fires.

{
"hooks": {
"PostToolUse": [
{
"matcher": "Write",
"hooks": [
{
"type": "command",
"command": "echo 'File was just written'"
}
]
}
]
}
}
EventWhen It Fires
PreToolUseBefore Claude runs any tool
PostToolUseAfter a tool call completes
StopWhen the session ends or Claude finishes a task
NotificationWhen Claude sends you a notification

A real example: auto-format code after edits

Section titled “A real example: auto-format code after edits”

If you want your code auto-formatted every time Claude Code edits a Python file, add this to .claude/settings.json:

{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "black \"$CLAUDE_FILE_PATH\" 2>/dev/null || true"
}
]
}
]
}
}

Now every file Claude Code writes or edits gets run through Black (a Python formatter) automatically. You never have to think about it.

!!! warning “Test hooks carefully” Hooks run automatically, which means mistakes run automatically too. Start with hooks that only echo or log — confirm they fire when you expect — before adding hooks that modify files or run commands with side effects.

If Claude Code is running a long task in the background, you can hook the Stop event to send yourself a notification:

{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "osascript -e 'display notification \"Claude finished\" with title \"Claude Code\"'"
}
]
}
]
}
}

That’s a Mac notification. Adapt for your platform.


Plugins extend what Claude Code can access and do in a session — they add new tools, new knowledge, or new integrations.

The most important type of plugin in practice is an MCP server (Model Context Protocol). MCP servers let Claude Code connect to external services: databases, APIs, third-party tools. The Integrations section covers MCP in detail.

For most users, plugins are not a day-one concern. The built-in tools — file access, bash, web search — cover the majority of what you’ll need.


A realistic progression:

Week 1–2: Use vanilla Claude Code. Learn what you actually find yourself repeating.

Week 3+: Create your first custom skill for the prompt you use most often.

Month 2+: Add a hook for something you always forget (formatting, linting, notifications).

When you have a specific integration need: Look at MCP servers. There are community-built servers for GitHub, databases, Slack, and more.

The temptation is to configure everything upfront. Resist it. Every customization you add before you know you need it is noise. Add things when the absence of them is slowing you down.

!!! example “Your first skill — make it small” Think of one prompt you’ve typed into Claude Code more than twice this week. Save it as a skill. Navigate to your home folder, create ~/.claude/commands/ if it doesn’t exist, and save your prompt as a .md file in there. Next session, try invoking it with a slash command.