š NEW 2-14-2026: Claude Code Mastery Starter Kit
Everything from V1āV5 baked into a production-ready project template. 16 slash commands, deterministic hook enforcement, a battle-tested MongoDB wrapper, live AI monitoring, and three-layer security ā all wired up and ready to clone. Stop configuring, start building.
Claude Code Mastery V2 (Obsolete)
The complete guide to maximizing Claude Code: Global CLAUDE.md, MCP Servers, Commands, Hooks, Skills, and Why Single-Purpose Chats Matter.
This version is obsolete by now. Please use the new Claude Code Mastery Starter Kit instead
Previous versions:
TL;DR: Your global
~/.claude/CLAUDE.mdis a security gatekeeper AND project scaffolding blueprint. MCP servers extend Claude's capabilities. Custom commands automate workflows. Hooks enforce rules deterministically (where CLAUDE.md can fail). Skills package reusable expertise. And research shows mixing topics in a single chat causes 39% performance degradation.
š Table of Contents
š Quick Start
# Clone this repo
git clone https://github.com/TheDecipherist/claude-code-mastery.git
cd claude-code-mastery
# Copy hooks to your Claude config
mkdir -p ~/.claude/hooks
cp hooks/* ~/.claude/hooks/
chmod +x ~/.claude/hooks/*.sh
# Copy the settings template (review and customize first!)
cp templates/settings.json ~/.claude/settings.json
# Copy skills
mkdir -p ~/.claude/skills
cp -r skills/* ~/.claude/skills/
š The Guide
š± Read V3 on GitHub Pages | š View GUIDE.md (V3)
What's Covered
| Part | Topic | Key Takeaway |
|---|---|---|
| 1 | Global CLAUDE.md as Security Gatekeeper | Define once, inherit everywhere |
| 2 | Project Scaffolding Rules | Every project follows same structure |
| 3 | MCP Servers | External tool integrations |
| 4 | Context7 | Live documentation access |
| 5 | Custom Commands | Workflow automation |
| 6 | Single-Purpose Chats | 39% degradation from topic mixing |
| 7 | Skills & Hooks | Enforcement over suggestion |
š Repository Contents
claude-code-mastery/
āāā GUIDE.md # The complete guide
āāā templates/
ā āāā global-claude.md # ~/.claude/CLAUDE.md template
ā āāā project-claude.md # ./CLAUDE.md starter
ā āāā settings.json # Hook configuration template
ā āāā .gitignore # Recommended .gitignore
āāā hooks/
ā āāā block-secrets.py # PreToolUse: Block .env access
ā āāā block-dangerous-commands.sh # PreToolUse: Block rm -rf, etc.
ā āāā end-of-turn.sh # Stop: Quality gates
ā āāā after-edit.sh # PostToolUse: Run formatters
ā āāā notify.sh # Notification: Desktop alerts
āāā skills/
ā āāā commit-messages/ # Generate conventional commits
ā ā āāā SKILL.md
ā āāā security-audit/ # Security vulnerability checks
ā āāā SKILL.md
āāā commands/
āāā new-project.md # /new-project scaffold
āāā security-check.md # /security-check audit
āāā pre-commit.md # /pre-commit quality gates
š§ Installation
Prerequisites
- Claude Code installed
- Python 3.8+ (for Python hooks)
jq(for JSON parsing in shell hooks)
Step-by-Step
1. Install Hooks
# Create hooks directory
mkdir -p ~/.claude/hooks
# Copy hook scripts
cp hooks/block-secrets.py ~/.claude/hooks/
cp hooks/block-dangerous-commands.sh ~/.claude/hooks/
cp hooks/end-of-turn.sh ~/.claude/hooks/
# Make shell scripts executable
chmod +x ~/.claude/hooks/*.sh
2. Configure Settings
# If you don't have settings.json yet
cp templates/settings.json ~/.claude/settings.json
# If you already have settings.json, merge the hooks section manually
3. Install Skills
# Create skills directory
mkdir -p ~/.claude/skills
# Copy skills
cp -r skills/* ~/.claude/skills/
4. Set Up Global CLAUDE.md
# Copy template
cp templates/global-claude.md ~/.claude/CLAUDE.md
# Customize with your details
$EDITOR ~/.claude/CLAUDE.md
5. Verify Installation
# Start Claude Code
claude
# Check hooks are loaded
/hooks
# Check skills are loaded
/skills
š Why Hooks Matter
CLAUDE.md rules are suggestions. Hooks are enforcement.
CLAUDE.md saying "don't edit .env"
ā Parsed by LLM
ā Weighed against other context
ā Maybe followed
PreToolUse hook blocking .env edits
ā Always runs
ā Returns exit code 2
ā Operation blocked. Period.
Real-world example from a community member:
"My PreToolUse hook blocks Claude from accessing secrets (.env files) a few times per week. Claude does not respect CLAUDE.md rules very rigorously."
Hook Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success, allow operation |
| 1 | Error (shown to user only) |
| 2 | Block operation, feed stderr to Claude |
š§ Why Single-Purpose Chats
Research consistently shows topic mixing destroys accuracy:
| Study | Finding |
|---|---|
| Multi-turn conversations | 39% performance drop when mixing topics |
| Context rot | Recall decreases as context grows |
| Context pollution | 2% early misalignment ā 40% failure rate |
Golden Rule: One Task, One Chat
š¤ Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Add your hooks, skills, or improvements
- Submit a PR with description
Ideas for Contributions
- More language-specific hooks (Go, Rust, Ruby)
- Additional skills (code review, documentation, testing)
- Framework-specific scaffolding templates
- MCP server configuration examples
š Sources
Official Documentation
- Claude Code Best Practices ā Anthropic
- Effective Context Engineering ā Anthropic
- Agent Skills ā Claude Code Docs
- Hooks Reference ā Claude Code Docs
Research
- LLMs Get Lost In Multi-Turn Conversation ā arXiv
- Context Rot Research ā Chroma
- Claude Loads Secrets Without Permission ā Knostic
Community
- Claude Code Hooks: Guardrails That Actually Work
- Claude Code Hooks Mastery
- Claude Code Security Best Practices
š License
MIT License - See LICENSE
Built with ā¤ļø by TheDecipherist and the Claude Code community