{"id":48833776,"url":"https://github.com/thedecipherist/claude-code-mastery","last_synced_at":"2026-04-14T22:03:57.230Z","repository":{"id":332638766,"uuid":"1134445014","full_name":"TheDecipherist/claude-code-mastery","owner":"TheDecipherist","description":"The complete guide to Claude Code: CLAUDE.md, hooks, skills, MCP servers, and commands","archived":false,"fork":false,"pushed_at":"2026-02-14T13:51:10.000Z","size":559,"stargazers_count":355,"open_issues_count":1,"forks_count":35,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-02-14T22:00:40.433Z","etag":null,"topics":["ai-agents","anthropic","claude","claude-code","claude-md","coding-assistant","developer-tools","llm","mcp-servers"],"latest_commit_sha":null,"homepage":"https://thedecipherist.com?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=claude-code-mastery\u0026utm_content=about-link    ","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheDecipherist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-14T18:19:47.000Z","updated_at":"2026-02-14T17:35:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/TheDecipherist/claude-code-mastery","commit_stats":null,"previous_names":["thedecipherist/claude-code-mastery"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TheDecipherist/claude-code-mastery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDecipherist%2Fclaude-code-mastery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDecipherist%2Fclaude-code-mastery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDecipherist%2Fclaude-code-mastery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDecipherist%2Fclaude-code-mastery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheDecipherist","download_url":"https://codeload.github.com/TheDecipherist/claude-code-mastery/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDecipherist%2Fclaude-code-mastery/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31817130,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","anthropic","claude","claude-code","claude-md","coding-assistant","developer-tools","llm","mcp-servers"],"created_at":"2026-04-14T22:03:44.517Z","updated_at":"2026-04-14T22:03:57.216Z","avatar_url":"https://github.com/TheDecipherist.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e ## 🚀 NEW 2-14-2026: [Claude Code Mastery Starter Kit](https://thedecipherist.github.io/claude-code-mastery-project-starter-kit/?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=claude-code-mastery\u0026utm_content=starter-kit-banner)\n\u003e\n\u003e 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.**\n\n\n# Claude Code Mastery V2 (Obsolete)\n\nThe complete guide to maximizing Claude Code: Global CLAUDE.md, MCP Servers, Commands, Hooks, Skills, and Why Single-Purpose Chats Matter.\n\n**This version is obsolete by now. Please use the new Claude Code Mastery Starter Kit instead**\n\nPrevious versions:\n\n[V5](https://thedecipherist.com/articles/claude-code-guide-v5/?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=claude-code-v5\u0026utm_content=update)\n\n[V4](https://thedecipherist.com/articles/claude-code-guide-v4/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=claude-code-mastery\u0026utm_content=v4-banner)\n\n[V3](https://thedecipherist.github.io/claude-code-mastery/?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=claude-code-mastery\u0026utm_content=hero-cta)\n\n\n---\n\n\u003e **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**.\n\n---\n\n## 📚 Table of Contents\n\n- [Quick Start](#-quick-start)\n- [The Guide](#-the-guide)\n- [Repository Contents](#-repository-contents)\n- [Installation](#-installation)\n- [Contributing](#-contributing)\n- [Sources](#-sources)\n\n---\n\n## 🚀 Quick Start\n\n```bash\n# Clone this repo\ngit clone https://github.com/TheDecipherist/claude-code-mastery.git\ncd claude-code-mastery\n\n# Copy hooks to your Claude config\nmkdir -p ~/.claude/hooks\ncp hooks/* ~/.claude/hooks/\nchmod +x ~/.claude/hooks/*.sh\n\n# Copy the settings template (review and customize first!)\ncp templates/settings.json ~/.claude/settings.json\n\n# Copy skills\nmkdir -p ~/.claude/skills\ncp -r skills/* ~/.claude/skills/\n```\n\n---\n\n## 📖 The Guide\n\n**[📱 Read V3 on GitHub Pages](https://thedecipherist.github.io/claude-code-mastery/?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=claude-code-mastery\u0026utm_content=guide-section)** | [📄 View GUIDE.md (V3)](./GUIDE.md)\n\n### What's Covered\n\n| Part | Topic | Key Takeaway |\n|------|-------|--------------|\n| 1 | Global CLAUDE.md as Security Gatekeeper | Define once, inherit everywhere |\n| 2 | Project Scaffolding Rules | Every project follows same structure |\n| 3 | MCP Servers | External tool integrations |\n| 4 | Context7 | Live documentation access |\n| 5 | Custom Commands | Workflow automation |\n| 6 | Single-Purpose Chats | 39% degradation from topic mixing |\n| **7** | **Skills \u0026 Hooks** | **Enforcement over suggestion** |\n\n---\n\n## 📁 Repository Contents\n\n```\nclaude-code-mastery/\n├── GUIDE.md                    # The complete guide\n├── templates/\n│   ├── global-claude.md        # ~/.claude/CLAUDE.md template\n│   ├── project-claude.md       # ./CLAUDE.md starter\n│   ├── settings.json           # Hook configuration template\n│   └── .gitignore              # Recommended .gitignore\n├── hooks/\n│   ├── block-secrets.py        # PreToolUse: Block .env access\n│   ├── block-dangerous-commands.sh  # PreToolUse: Block rm -rf, etc.\n│   ├── end-of-turn.sh          # Stop: Quality gates\n│   ├── after-edit.sh           # PostToolUse: Run formatters\n│   └── notify.sh               # Notification: Desktop alerts\n├── skills/\n│   ├── commit-messages/        # Generate conventional commits\n│   │   └── SKILL.md\n│   └── security-audit/         # Security vulnerability checks\n│       └── SKILL.md\n└── commands/\n    ├── new-project.md          # /new-project scaffold\n    ├── security-check.md       # /security-check audit\n    └── pre-commit.md           # /pre-commit quality gates\n```\n\n---\n\n## 🔧 Installation\n\n### Prerequisites\n\n- [Claude Code](https://code.claude.com) installed\n- Python 3.8+ (for Python hooks)\n- `jq` (for JSON parsing in shell hooks)\n\n### Step-by-Step\n\n#### 1. Install Hooks\n\n```bash\n# Create hooks directory\nmkdir -p ~/.claude/hooks\n\n# Copy hook scripts\ncp hooks/block-secrets.py ~/.claude/hooks/\ncp hooks/block-dangerous-commands.sh ~/.claude/hooks/\ncp hooks/end-of-turn.sh ~/.claude/hooks/\n\n# Make shell scripts executable\nchmod +x ~/.claude/hooks/*.sh\n```\n\n#### 2. Configure Settings\n\n```bash\n# If you don't have settings.json yet\ncp templates/settings.json ~/.claude/settings.json\n\n# If you already have settings.json, merge the hooks section manually\n```\n\n#### 3. Install Skills\n\n```bash\n# Create skills directory\nmkdir -p ~/.claude/skills\n\n# Copy skills\ncp -r skills/* ~/.claude/skills/\n```\n\n#### 4. Set Up Global CLAUDE.md\n\n```bash\n# Copy template\ncp templates/global-claude.md ~/.claude/CLAUDE.md\n\n# Customize with your details\n$EDITOR ~/.claude/CLAUDE.md\n```\n\n#### 5. Verify Installation\n\n```bash\n# Start Claude Code\nclaude\n\n# Check hooks are loaded\n/hooks\n\n# Check skills are loaded\n/skills\n```\n\n---\n\n## 🔒 Why Hooks Matter\n\nCLAUDE.md rules are **suggestions**. Hooks are **enforcement**.\n\n```\nCLAUDE.md saying \"don't edit .env\"\n  → Parsed by LLM\n  → Weighed against other context\n  → Maybe followed\n\nPreToolUse hook blocking .env edits\n  → Always runs\n  → Returns exit code 2\n  → Operation blocked. Period.\n```\n\nReal-world example from a community member:\n\n\u003e \"My PreToolUse hook blocks Claude from accessing secrets (.env files) a few times per week. Claude does not respect CLAUDE.md rules very rigorously.\"\n\n### Hook Exit Codes\n\n| Code | Meaning |\n|------|---------|\n| 0 | Success, allow operation |\n| 1 | Error (shown to user only) |\n| **2** | **Block operation, feed stderr to Claude** |\n\n---\n\n## 🧠 Why Single-Purpose Chats\n\nResearch consistently shows topic mixing destroys accuracy:\n\n| Study | Finding |\n|-------|---------|\n| [Multi-turn conversations](https://arxiv.org/pdf/2505.06120) | **39% performance drop** when mixing topics |\n| [Context rot](https://research.trychroma.com/context-rot) | Recall decreases as context grows |\n| [Context pollution](https://kurtiskemple.com/blog/measuring-context-pollution/) | 2% early misalignment → 40% failure rate |\n\n**Golden Rule: One Task, One Chat**\n\n---\n\n## 🤝 Contributing\n\nContributions welcome! Please:\n\n1. Fork the repository\n2. Create a feature branch\n3. Add your hooks, skills, or improvements\n4. Submit a PR with description\n\n### Ideas for Contributions\n\n- [ ] More language-specific hooks (Go, Rust, Ruby)\n- [ ] Additional skills (code review, documentation, testing)\n- [ ] Framework-specific scaffolding templates\n- [ ] MCP server configuration examples\n\n---\n\n## 📚 Sources\n\n### Official Documentation\n- [Claude Code Best Practices](https://www.anthropic.com/engineering/claude-code-best-practices) — Anthropic\n- [Effective Context Engineering](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents) — Anthropic\n- [Agent Skills](https://code.claude.com/docs/en/skills) — Claude Code Docs\n- [Hooks Reference](https://code.claude.com/docs/en/hooks) — Claude Code Docs\n\n### Research\n- [LLMs Get Lost In Multi-Turn Conversation](https://arxiv.org/pdf/2505.06120) — arXiv\n- [Context Rot Research](https://research.trychroma.com/context-rot) — Chroma\n- [Claude Loads Secrets Without Permission](https://www.knostic.ai/blog/claude-loads-secrets-without-permission) — Knostic\n\n### Community\n- [Claude Code Hooks: Guardrails That Actually Work](https://paddo.dev/blog/claude-code-hooks-guardrails/)\n- [Claude Code Hooks Mastery](https://github.com/disler/claude-code-hooks-mastery)\n- [Claude Code Security Best Practices](https://www.backslash.security/blog/claude-code-security-best-practices)\n\n---\n\n## 📄 License\n\nMIT License - See [LICENSE](./LICENSE)\n\n---\n\n*Built with ❤️ by [TheDecipherist](https://thedecipherist.com?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=claude-code-mastery\u0026utm_content=author-link) and the Claude Code community*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthedecipherist%2Fclaude-code-mastery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthedecipherist%2Fclaude-code-mastery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthedecipherist%2Fclaude-code-mastery/lists"}