Skip to content
Back to search

claude-code-mastery

The complete guide to Claude Code: CLAUDE.md, hooks, skills, MCP servers, and commands

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/thedecipherist--claude-code-mastery/badge.svg)](/listings/thedecipherist--claude-code-mastery)

HTML

<a href="/listings/thedecipherist--claude-code-mastery"><img src="/api/listings/thedecipherist--claude-code-mastery/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

# 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/

---

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 272 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. > ## ✨ MDD — Manual-Driven Development: standalone package
  2. >
  3. > MDD turns Claude Code into a structured development partner: every feature starts with documentation, every fix starts with an audit. **21 modes** covering build, audit, planning, ops runbooks, and more — all via `/mdd` in any Claude Code session.
  4. >
  5. > **Install:** `npm install -g @thedecipherist/mdd && mdd install`
  6. >
  7. > [GitHub →](https://github.com/TheDecipherist/mdd) &nbsp;·&nbsp; [npm →](https://www.npmjs.com/package/@thedecipherist/mdd)
  8. > ## 🚀 NEW 2-14-2026: [Claude Code Mastery Starter Kit](https://thedecipherist.github.io/claude-code-mastery-project-starter-kit/?utm_source=github&utm_medium=readme&utm_campaign=claude-code-mastery&utm_content=starter-kit-banner)
  9. >
  10. > 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.**
  11. # Claude Code Mastery V2 (Obsolete)
  12. The complete guide to maximizing Claude Code: Global CLAUDE.md, MCP Servers, Commands, Hooks, Skills, and Why Single-Purpose Chats Matter.
  13. **This version is obsolete by now. Please use the new Claude Code Mastery Starter Kit instead**
  14. Previous versions:
  15. [V5](https://thedecipherist.com/articles/claude-code-guide-v5/?utm_source=github&utm_medium=readme&utm_campaign=claude-code-v5&utm_content=update)
  16. [V4](https://thedecipherist.com/articles/claude-code-guide-v4/?utm_source=github&utm_medium=repo&utm_campaign=claude-code-mastery&utm_content=v4-banner)
  17. [V3](https://thedecipherist.github.io/claude-code-mastery/?utm_source=github&utm_medium=readme&utm_campaign=claude-code-mastery&utm_content=hero-cta)
  18. ---
  19. > **TL;DR:** Your global `~/.claude/CLAUDE.md` is 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**.
  20. ---
  21. ## 📚 Table of Contents
  22. - [Quick Start](#-quick-start)
  23. - [The Guide](#-the-guide)
  24. - [Repository Contents](#-repository-contents)
  25. - [Installation](#-installation)
  26. - [Contributing](#-contributing)
  27. - [Sources](#-sources)
  28. ---
  29. ## 🚀 Quick Start
  30. ```bash
  31. # Clone this repo
  32. git clone https://github.com/TheDecipherist/claude-code-mastery.git
  33. cd claude-code-mastery
  34. # Copy hooks to your Claude config
  35. mkdir -p ~/.claude/hooks
  36. cp hooks/* ~/.claude/hooks/
  37. chmod +x ~/.claude/hooks/*.sh
  38. # Copy the settings template (review and customize first!)
  39. cp templates/settings.json ~/.claude/settings.json
  40. # Copy skills
  41. mkdir -p ~/.claude/skills
  42. cp -r skills/* ~/.claude/skills/
  43. ```
  44. ---
  45. ## 📖 The Guide
  46. **[📱 Read V3 on GitHub Pages](https://thedecipherist.github.io/claude-code-mastery/?utm_source=github&utm_medium=readme&utm_campaign=claude-code-mastery&utm_content=guide-section)** | [📄 View GUIDE.md (V3)](./GUIDE.md)
  47. ### What's Covered
  48. | Part | Topic | Key Takeaway |
  49. |------|-------|--------------|
  50. | 1 | Global CLAUDE.md as Security Gatekeeper | Define once, inherit everywhere |
  51. | 2 | Project Scaffolding Rules | Every project follows same structure |
  52. | 3 | MCP Servers | External tool integrations |
  53. | 4 | Context7 | Live documentation access |
  54. | 5 | Custom Commands | Workflow automation |
  55. | 6 | Single-Purpose Chats | 39% degradation from topic mixing |
  56. | **7** | **Skills & Hooks** | **Enforcement over suggestion** |
  57. ---
  58. ## 📁 Repository Contents
  59. ```
  60. claude-code-mastery/
  61. ├── GUIDE.md # The complete guide
  62. ├── templates/
  63. │ ├── global-claude.md # ~/.claude/CLAUDE.md template
  64. │ ├── project-claude.md # ./CLAUDE.md starter
  65. │ ├── settings.json # Hook configuration template
  66. │ └── .gitignore # Recommended .gitignore
  67. ├── hooks/
  68. │ ├── block-secrets.py # PreToolUse: Block .env access
  69. │ ├── block-dangerous-commands.sh # PreToolUse: Block rm -rf, etc.
  70. │ ├── end-of-turn.sh # Stop: Quality gates
  71. │ ├── after-edit.sh # PostToolUse: Run formatters
  72. │ └── notify.sh # Notification: Desktop alerts
  73. ├── skills/
  74. │ ├── commit-messages/ # Generate conventional commits
  75. │ │ └── SKILL.md
  76. │ └── security-audit/ # Security vulnerability checks
  77. │ └── SKILL.md
  78. └── commands/
  79. ├── new-project.md # /new-project scaffold
  80. ├── security-check.md # /security-check audit
  81. └── pre-commit.md # /pre-commit quality gates
  82. ```
  83. ---
  84. ## 🔧 Installation
  85. ### Prerequisites
  86. - [Claude Code](https://code.claude.com) installed
  87. - Python 3.8+ (for Python hooks)
  88. - `jq` (for JSON parsing in shell hooks)
  89. ### Step-by-Step
  90. #### 1. Install Hooks
  91. ```bash
  92. # Create hooks directory
  93. mkdir -p ~/.claude/hooks
  94. # Copy hook scripts
  95. cp hooks/block-secrets.py ~/.claude/hooks/
  96. cp hooks/block-dangerous-commands.sh ~/.claude/hooks/
  97. cp hooks/end-of-turn.sh ~/.claude/hooks/
  98. # Make shell scripts executable
  99. chmod +x ~/.claude/hooks/*.sh
  100. ```
  101. #### 2. Configure Settings
  102. ```bash
  103. # If you don't have settings.json yet
  104. cp templates/settings.json ~/.claude/settings.json
  105. # If you already have settings.json, merge the hooks section manually
  106. ```
  107. #### 3. Install Skills
  108. ```bash
  109. # Create skills directory
  110. mkdir -p ~/.claude/skills
  111. # Copy skills
  112. cp -r skills/* ~/.claude/skills/
  113. ```
  114. #### 4. Set Up Global CLAUDE.md
  115. ```bash
  116. # Copy template
  117. cp templates/global-claude.md ~/.claude/CLAUDE.md
  118. # Customize with your details
  119. $EDITOR ~/.claude/CLAUDE.md
  120. ```
  121. #### 5. Verify Installation
  122. ```bash
  123. # Start Claude Code
  124. claude
  125. # Check hooks are loaded
  126. /hooks
  127. # Check skills are loaded
  128. /skills
  129. ```
  130. ---
  131. ## 🔒 Why Hooks Matter
  132. CLAUDE.md rules are **suggestions**. Hooks are **enforcement**.
  133. ```
  134. CLAUDE.md saying "don't edit .env"
  135. → Parsed by LLM
  136. → Weighed against other context
  137. → Maybe followed
  138. PreToolUse hook blocking .env edits
  139. → Always runs
  140. → Returns exit code 2
  141. → Operation blocked. Period.
  142. ```
  143. Real-world example from a community member:
  144. > "My PreToolUse hook blocks Claude from accessing secrets (.env files) a few times per week. Claude does not respect CLAUDE.md rules very rigorously."
  145. ### Hook Exit Codes
  146. | Code | Meaning |
  147. |------|---------|
  148. | 0 | Success, allow operation |
  149. | 1 | Error (shown to user only) |
  150. | **2** | **Block operation, feed stderr to Claude** |
  151. ---
  152. ## 🧠 Why Single-Purpose Chats
  153. Research consistently shows topic mixing destroys accuracy:
  154. | Study | Finding |
  155. |-------|---------|
  156. | [Multi-turn conversations](https://arxiv.org/pdf/2505.06120) | **39% performance drop** when mixing topics |
  157. | [Context rot](https://research.trychroma.com/context-rot) | Recall decreases as context grows |
  158. | [Context pollution](https://kurtiskemple.com/blog/measuring-context-pollution/) | 2% early misalignment → 40% failure rate |
  159. **Golden Rule: One Task, One Chat**
  160. ---
  161. ## 🤝 Contributing
  162. Contributions welcome! Please:
  163. 1. Fork the repository
  164. 2. Create a feature branch
  165. 3. Add your hooks, skills, or improvements
  166. 4. Submit a PR with description
  167. ### Ideas for Contributions
  168. - [ ] More language-specific hooks (Go, Rust, Ruby)
  169. - [ ] Additional skills (code review, documentation, testing)
  170. - [ ] Framework-specific scaffolding templates
  171. - [ ] MCP server configuration examples
  172. ---
  173. ## 📚 Sources
  174. ### Official Documentation
  175. - [Claude Code Best Practices](https://www.anthropic.com/engineering/claude-code-best-practices) — Anthropic
  176. - [Effective Context Engineering](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents) — Anthropic
  177. - [Agent Skills](https://code.claude.com/docs/en/skills) — Claude Code Docs
  178. - [Hooks Reference](https://code.claude.com/docs/en/hooks) — Claude Code Docs
  179. ### Research
  180. - [LLMs Get Lost In Multi-Turn Conversation](https://arxiv.org/pdf/2505.06120) — arXiv
  181. - [Context Rot Research](https://research.trychroma.com/context-rot) — Chroma
  182. - [Claude Loads Secrets Without Permission](https://www.knostic.ai/blog/claude-loads-secrets-without-permission) — Knostic
  183. ### Community
  184. - [Claude Code Hooks: Guardrails That Actually Work](https://paddo.dev/blog/claude-code-hooks-guardrails/)
  185. - [Claude Code Hooks Mastery](https://github.com/disler/claude-code-hooks-mastery)
  186. - [Claude Code Security Best Practices](https://www.backslash.security/blog/claude-code-security-best-practices)
  187. ---
  188. ## 📄 License
  189. MIT License - See [LICENSE](./LICENSE)
  190. ---
  191. *Built with ❤️ by [TheDecipherist](https://thedecipherist.com?utm_source=github&utm_medium=readme&utm_campaign=claude-code-mastery&utm_content=author-link) and the Claude Code community*

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.