- Add claude-howto-logo.svg to 12 README files across the project - Use appropriate relative paths for different directory levels - Include new memory guide screenshots - Add personal CLAUDE.md configuration 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
Claude How To
Complete collection of examples for some important Claude Code features and concepts.
Quick Navigation
| Feature | Description | Folder |
|---|---|---|
| Slash Commands | User-invoked shortcuts | 01-slash-commands/ |
| Subagents | Specialized AI assistants | 02-subagents/ |
| Memory | Persistent context | 03-memory/ |
| MCP Protocol | External tool access | 04-mcp/ |
| Skills | Reusable capabilities | 05-skills/ |
| Plugins | Bundled features | 06-plugins/ |
| Hooks | Event-driven automation | 07-hooks/ |
| Checkpoints | Session snapshots & rewind | 08-checkpoints/ |
| Advanced Features | Planning, thinking, background tasks | 09-advanced-features/ |
01. Slash Commands
Location: 01-slash-commands/
What: User-invoked shortcuts stored as Markdown files
Examples:
optimize.md- Code optimization analysispr.md- Pull request preparationgenerate-api-docs.md- API documentation generator
Installation:
cp 01-slash-commands/*.md /path/to/project/.claude/commands/
Usage:
/optimize
/pr
/generate-api-docs
02. Subagents
Location: 02-subagents/
What: Specialized AI assistants with isolated contexts and custom prompts
Examples:
code-reviewer.md- Comprehensive code quality analysistest-engineer.md- Test strategy and coveragedocumentation-writer.md- Technical documentationsecure-reviewer.md- Security-focused review (read-only)implementation-agent.md- Full feature implementation
Installation:
cp 02-subagents/*.md /path/to/project/.claude/agents/
Usage: Automatically delegated by main agent
03. Memory
Location: 03-memory/
What: Persistent context across sessions
Examples:
project-CLAUDE.md- Team-wide project standardsdirectory-api-CLAUDE.md- Directory-specific rulespersonal-CLAUDE.md- Personal preferences
Installation:
# Project memory
cp 03-memory/project-CLAUDE.md /path/to/project/CLAUDE.md
# Directory memory
cp 03-memory/directory-api-CLAUDE.md /path/to/project/src/api/CLAUDE.md
# Personal memory
cp 03-memory/personal-CLAUDE.md ~/.claude/CLAUDE.md
Usage: Automatically loaded by Claude
04. MCP Protocol
Location: 04-mcp/
What: Model Context Protocol for accessing external tools and APIs
Examples:
github-mcp.json- GitHub integrationdatabase-mcp.json- Database queriesfilesystem-mcp.json- File operationsmulti-mcp.json- Multiple MCP servers
Installation:
# Set environment variables
export GITHUB_TOKEN="your_token"
export DATABASE_URL="postgresql://..."
# Copy configuration
cp 04-mcp/github-mcp.json ~/.claude/mcp.json
Usage:
/mcp__github__list_prs
/mcp__github__get_pr 456
05. Skills
Location: 05-skills/
What: Reusable, auto-invoked capabilities with instructions and scripts
Examples:
code-review/- Comprehensive code review with scriptsbrand-voice/- Brand voice consistency checkerdoc-generator/- API documentation generator
Installation:
# Personal skills
cp -r 05-skills/code-review ~/.claude/skills/
# Project skills
cp -r 05-skills/code-review /path/to/project/.claude/skills/
Usage: Automatically invoked when relevant
06. Plugins
Location: 06-plugins/
What: Bundled collections of commands, agents, MCP, and hooks
Examples:
pr-review/- Complete PR review workflowdevops-automation/- Deployment and monitoringdocumentation/- Documentation generation
Installation:
/plugin install pr-review
/plugin install devops-automation
/plugin install documentation
Usage: Use bundled slash commands and features
07. Hooks
Location: 07-hooks/
What: Event-driven shell commands that execute automatically in response to Claude Code events
Examples:
format-code.sh- Auto-format code before writingpre-commit.sh- Run tests before commitssecurity-scan.sh- Scan for security issueslog-bash.sh- Log all bash commandsvalidate-prompt.sh- Validate user promptsnotify-team.sh- Send notifications on events
Installation:
mkdir -p ~/.claude/hooks
cp 07-hooks/*.sh ~/.claude/hooks/
chmod +x ~/.claude/hooks/*.sh
# Configure in settings
echo '{
"hooks": {
"PreToolUse:Write": "~/.claude/hooks/format-code.sh ${file_path}",
"PostToolUse:Write": "~/.claude/hooks/security-scan.sh ${file_path}",
"PreCommit": "~/.claude/hooks/pre-commit.sh"
}
}' > ~/.claude/hooks-config.json
Usage: Hooks execute automatically on events
Hook Types:
- Tool Hooks:
PreToolUse:*,PostToolUse:* - Session Hooks:
UserPromptSubmit,SessionStart,SessionEnd - Git Hooks:
PreCommit,PostCommit,PrePush
08. Checkpoints and Rewind
Location: 08-checkpoints/
What: Save conversation state and rewind to previous points to explore different approaches
Key Concepts:
- Checkpoint: Snapshot of conversation state
- Rewind: Return to previous checkpoint
- Branch Point: Explore multiple approaches from same checkpoint
Usage:
# Create checkpoint
/checkpoint save "Before refactoring"
# List checkpoints
/checkpoint list
# Rewind to checkpoint
/checkpoint rewind "Before refactoring"
# Compare checkpoints
/checkpoint diff checkpoint-1 checkpoint-2
Use Cases:
- Try different implementation approaches
- Recover from mistakes
- Safe experimentation
- Compare alternative solutions
- A/B testing different designs
Example Workflow:
1. /checkpoint save "Working state"
2. Try experimental approach
3. If it works: Continue
4. If it fails: /checkpoint rewind "Working state"
09. Advanced Features
Location: 09-advanced-features/
What: Advanced capabilities for complex workflows and automation
Planning Mode
Create detailed implementation plans before coding:
User: /plan Implement user authentication system
Claude: [Creates comprehensive step-by-step plan]
User: Approve and proceed
Benefits: Clear roadmap, time estimates, risk assessment
Extended Thinking
Deep reasoning for complex problems:
User: /think Should we use microservices or monolith?
Claude: [Analyzes trade-offs systematically]
Benefits: Better architectural decisions, thorough analysis
Background Tasks
Run long operations without blocking:
User: Run tests in background
Claude: Started bg-1234, you can continue working
[Later] Test results: 245 passed, 3 failed
Benefits: Parallel development, no waiting
Permission Modes
Control what Claude can do:
- Unrestricted: Full access (default)
- Confirm: Ask before actions
- Read-only: Analysis only, no modifications
- Custom: Granular permissions
/permission readonly # Code review mode
/permission confirm # Learning mode
/permission unrestricted # Full automation
Headless Mode
Run Claude Code in CI/CD and automation:
claude-code --headless --task "Run tests and generate report"
Use Cases: CI/CD, automated reviews, batch processing
Session Management
Manage multiple work sessions:
/session list # Show all sessions
/session new "Feature" # Create new session
/session switch "Bug" # Switch sessions
/session save # Save current state
Interactive Features
Keyboard Shortcuts: Ctrl+R (search), Tab (complete), ↑/↓ (history)
Command History: Access previous commands
Multi-line Input: Complex prompts across multiple lines
Configuration
Customize Claude Code behavior:
{
"planning": { "autoEnter": true },
"extendedThinking": { "enabled": true },
"backgroundTasks": { "maxConcurrentTasks": 5 },
"permissions": { "mode": "unrestricted" },
"checkpoints": { "autoCheckpoint": true }
}
See config-examples.json for complete configurations.
Feature Comparison
| Feature | Invocation | Persistence | Best For |
|---|---|---|---|
| Slash Commands | Manual (/cmd) |
Session only | Quick shortcuts |
| Subagents | Auto-delegated | Isolated context | Task distribution |
| Memory | Auto-loaded | Cross-session | Long-term learning |
| MCP Protocol | Auto-queried | Real-time | Live data access |
| Skills | Auto-invoked | Filesystem | Automated workflows |
| Plugins | One command | All features | Complete solutions |
| Hooks | Event-triggered | Configured | Automation & validation |
| Checkpoints | Manual/Auto | Session-based | Safe experimentation |
| Planning Mode | Manual/Auto | Plan phase | Complex implementations |
| Background Tasks | Manual | Task duration | Long-running operations |
Getting Started
Week 1: Basics
- Copy slash commands to
.claude/commands/ - Try
/optimizeand/prcommands - Create project memory in
CLAUDE.md
Week 2: Real-time Access
- Set up GitHub MCP
- Query PRs and issues
- Try multi-MCP configuration
Week 3: Distribution
- Create first subagent
- Test with complex task
- Delegate work to specialists
Week 4: Automation
- Install a skill
- Let Claude auto-invoke it
- Create custom skill
Week 5: Complete Solution
- Install a plugin
- Use bundled features
- Consider creating your own
Directory Structure
├── 01-slash-commands/
│ ├── optimize.md
│ ├── pr.md
│ ├── generate-api-docs.md
│ └── README.md
├── 02-subagents/
│ ├── code-reviewer.md
│ ├── test-engineer.md
│ ├── documentation-writer.md
│ ├── secure-reviewer.md
│ ├── implementation-agent.md
│ └── README.md
├── 03-memory/
│ ├── project-CLAUDE.md
│ ├── directory-api-CLAUDE.md
│ ├── personal-CLAUDE.md
│ └── README.md
├── 04-mcp/
│ ├── github-mcp.json
│ ├── database-mcp.json
│ ├── filesystem-mcp.json
│ ├── multi-mcp.json
│ └── README.md
├── 05-skills/
│ ├── code-review/
│ │ ├── SKILL.md
│ │ ├── scripts/
│ │ └── templates/
│ ├── brand-voice/
│ │ ├── SKILL.md
│ │ └── templates/
│ ├── doc-generator/
│ │ ├── SKILL.md
│ │ └── generate-docs.py
│ └── README.md
├── 06-plugins/
│ ├── pr-review/
│ ├── devops-automation/
│ ├── documentation/
│ └── README.md
├── 07-hooks/
│ ├── format-code.sh
│ ├── pre-commit.sh
│ ├── security-scan.sh
│ ├── log-bash.sh
│ ├── validate-prompt.sh
│ ├── notify-team.sh
│ └── README.md
├── 08-checkpoints/
│ ├── checkpoint-examples.md
│ └── README.md
├── 09-advanced-features/
│ ├── config-examples.json
│ ├── planning-mode-examples.md
│ └── README.md
└── README.md (this file)
Example Workflows
1. Complete Code Review Workflow
# Uses: Slash Commands + Subagents + Memory + MCP
User: /review-pr
Claude:
1. Loads project memory (coding standards)
2. Fetches PR via GitHub MCP
3. Delegates to code-reviewer subagent
4. Delegates to test-engineer subagent
5. Synthesizes findings
6. Provides comprehensive review
2. Automated Documentation
# Uses: Skills + Subagents + Memory
User: "Generate API documentation for the auth module"
Claude:
1. Loads project memory (doc standards)
2. Detects doc generation request
3. Auto-invokes doc-generator skill
4. Delegates to api-documenter subagent
5. Creates comprehensive docs with examples
3. DevOps Deployment
# Uses: Plugins + MCP + Hooks
User: /deploy production
Claude:
1. Runs pre-deploy hook (validates environment)
2. Delegates to deployment-specialist subagent
3. Executes deployment via Kubernetes MCP
4. Monitors progress
5. Runs post-deploy hook (health checks)
6. Reports status
Installation Quick Reference
# Slash Commands
cp 01-slash-commands/*.md .claude/commands/
# Subagents
cp 02-subagents/*.md .claude/agents/
# Memory
cp 03-memory/project-CLAUDE.md ./CLAUDE.md
# MCP
export GITHUB_TOKEN="token"
cp 04-mcp/github-mcp.json .claude/mcp.json
# Skills
cp -r 05-skills/code-review ~/.claude/skills/
# Plugins
/plugin install pr-review
# Hooks
mkdir -p ~/.claude/hooks
cp 07-hooks/*.sh ~/.claude/hooks/
chmod +x ~/.claude/hooks/*.sh
# Checkpoints (auto-enabled, configure in settings)
# See 08-checkpoints/README.md
# Advanced Features (configure in settings)
# See 09-advanced-features/config-examples.json
Use Case Matrix
| Use Case | Recommended Features |
|---|---|
| Team Onboarding | Memory + Slash Commands + Plugins |
| Code Quality | Subagents + Skills + Memory + Hooks |
| Documentation | Skills + Subagents + Plugins |
| DevOps | Plugins + MCP + Hooks + Background Tasks |
| Security Review | Subagents + Skills + Hooks (read-only mode) |
| API Integration | MCP + Memory |
| Quick Tasks | Slash Commands |
| Complex Projects | All Features + Planning Mode |
| Refactoring | Checkpoints + Planning Mode + Hooks |
| Learning/Experimentation | Checkpoints + Extended Thinking + Permission Mode |
| CI/CD Automation | Headless Mode + Hooks + Background Tasks |
| Performance Optimization | Planning Mode + Checkpoints + Background Tasks |
Best Practices
Do's ✅
- Start simple with slash commands
- Add features incrementally
- Use memory for team standards
- Test configurations locally first
- Document custom implementations
- Version control project configurations
- Share plugins with team
Don'ts ❌
- Don't create redundant features
- Don't hardcode credentials
- Don't skip documentation
- Don't over-complicate simple tasks
- Don't ignore security best practices
- Don't commit sensitive data
Troubleshooting
Feature Not Loading
- Check file location and naming
- Verify YAML frontmatter syntax
- Check file permissions
- Review Claude Code version compatibility
MCP Connection Failed
- Verify environment variables
- Check MCP server installation
- Test credentials
- Review network connectivity
Subagent Not Delegating
- Check tool permissions
- Verify agent description clarity
- Review task complexity
- Test agent independently
Additional Resources
Contributing
Found an issue or want to contribute an example?
- Create an issue describing the example
- Follow existing structure and patterns
- Include comprehensive README
- Test thoroughly
- Submit pull request
License
These examples are provided as-is for educational purposes. Adapt and use them freely in your projects.
Last Updated: November 2025 Claude Code Version: 1.0+ Compatible Models: Sonnet 4.5, Opus 4.1, Haiku 4.5