The complete guide to Claude Code setup. 100+ hours saved. 370x optimization. Production-tested patterns for skills, hooks, and MCP integration.
Goal: Working Claude Code with immediate productivity gains Time: 30 minutes Prerequisites: Claude Code installed, Git configured, Node.js + npx available Outcome: Pattern-aware Claude with persistent memory and troubleshooting skills
After this 30-minute setup:
✅ Claude knows your project patterns - References CORE-PATTERNS.md automatically ✅ Session continuity - Picks up where you left off across sessions ✅ Troubleshooting support - Decision tree routes to solutions fast ✅ GitHub integration - PR reviews, issue management via MCP ✅ Validation tools - Scripts verify setup is correct
Value: Consistent responses, safe git operations, faster debugging
# Option A: Use setup wizard (recommended)
cd ~/my-new-project
bash ../claude-code-guide/scripts/setup-wizard.sh
# Option B: Manual setup
cd ~/my-new-project
cp -r ../claude-code-guide/template/.claude .
cp -r ../claude-code-guide/template/memory-bank .
Validation:
# Check structure was created
ls -la .claude/
ls -la memory-bank/always/
# Expected output:
# .claude/
# ├── CLAUDE.md
# ├── mcp_servers.json.template
# └── skills/
#
# memory-bank/always/
# ├── CORE-PATTERNS.md.template
# ├── CONTEXT-ROUTER.md.template
# └── system-status.json.template
✅ Success: Directories and templates exist
# Navigate to project
cd ~/my-new-project
# Rename memory bank templates
mv memory-bank/always/CORE-PATTERNS.md.template \
memory-bank/always/CORE-PATTERNS.md
mv memory-bank/always/system-status.json.template \
memory-bank/always/system-status.json
mv memory-bank/always/CONTEXT-ROUTER.md.template \
memory-bank/always/CONTEXT-ROUTER.md
Validation:
# Check files exist
ls memory-bank/always/
# Expected output:
# CORE-PATTERNS.md
# CONTEXT-ROUTER.md
# system-status.json
✅ Success: No .template extensions remaining
Edit: memory-bank/always/CORE-PATTERNS.md
Replace placeholders:
[YOUR_PROJECT_NAME] → Your actual project name[DATE] → Current date (YYYY-MM-DD)[your_dev_db_name] → Your database names (if applicable)Add your first pattern:
### Pattern 1: Database Safety (Example)
```yaml
DATABASE_SAFETY:
Rule: "Always verify database environment before operations"
Pattern: "SELECT current_database() before operations"
Environments:
Development: "my_project_dev"
Production: "my_project_prod"
Validation: |
SELECT current_database();
**Validation**:
```bash
# Check no placeholders remain
grep '\[YOUR_' memory-bank/always/CORE-PATTERNS.md
# Should return nothing (no matches)
# If matches found, replace them
✅ Success: No placeholders, patterns are customized
Edit: memory-bank/always/system-status.json
Update:
{
"last_updated": "2025-12-14", // Today's date
"current_sprint": "Initial setup",
"branch": "main", // Your branch
"features": [
{
"name": "Core_Setup",
"status": "implementing",
"passes": false,
"description": "Basic Claude Code configuration"
}
]
}
Validation:
# Validate JSON syntax
jq empty memory-bank/always/system-status.json
# If no output, JSON is valid ✅
# If error shown, fix JSON syntax
✅ Success: Valid JSON with your project info
Why GitHub MCP:
Setup:
# 1. Create MCP config from template
cp .claude/mcp_servers.json.template .claude/mcp_servers.json
# 2. Get GitHub token
# Go to: https://github.com/settings/tokens
# Generate new token (classic) with 'repo' scope
# Copy the token
# 3. Add token to config
# Edit .claude/mcp_servers.json
# Replace ${GITHUB_TOKEN} with your actual token
# OR set environment variable:
export GITHUB_PERSONAL_ACCESS_TOKEN="ghp_your_token_here"
Example MCP config (minimal):
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
}
}
}
}
Validation:
# Check JSON is valid
jq empty .claude/mcp_servers.json
# Check no placeholders remain
grep '${' .claude/mcp_servers.json
# Should return nothing (no placeholders)
✅ Success: MCP config has your token, valid JSON
Copy to user directory (shared across all your projects):
# Create skills directory if needed
mkdir -p ~/.claude/skills
# Copy all 3 starter skills
cp .claude/skills/starter/*.md ~/.claude/skills/
# Verify installation
ls ~/.claude/skills/
# Expected output:
# troubleshooting-decision-tree-skill.md
# session-start-protocol-skill.md
# project-patterns-skill.md
Check skill structure:
# View first skill
head -20 ~/.claude/skills/troubleshooting-decision-tree-skill.md
# Should see YAML frontmatter:
# ---
# name: troubleshooting-decision-tree-skill
# description: "..."
# ---
Validation:
# Count skills
find ~/.claude/skills/ -name "*.md" | wc -l
# Should be >= 3
✅ Success: 3+ skills in ~/.claude/skills/
Run master validator:
# From claude-code-guide directory
./scripts/validate-setup.sh ~/my-new-project
# OR if in your project directory
../claude-code-guide/scripts/validate-setup.sh .
Expected output:
🔍 Claude Code Setup Validation
================================
📁 Checking directory structure...
✅ .claude
✅ memory-bank
✅ memory-bank/always
⚠️ Optional: .claude/hooks (not created)
📄 Checking core files...
✅ .claude/CLAUDE.md
✓ Auto-load references found
✅ memory-bank/always/CORE-PATTERNS.md
✅ memory-bank/always/system-status.json
✓ Valid JSON
🔌 Checking MCP configuration...
✅ MCP config is valid JSON
✓ 1 MCP server(s) configured
- github
🎯 Checking skills system...
✅ Found 3 skill(s)
✓ 3 skill(s) have YAML frontmatter
⚠️ Skills hook not configured (optional but recommended)
🔧 Checking for unconfigured placeholders...
✅ No unconfigured placeholders found
================================
Validation Summary
================================
✅ Passed: 12
⚠️ Warnings: 2
❌ Errors: 0
✅ Setup is functional!
✅ Success: Validation passes with 0 errors
Start Claude Code:
cd ~/my-new-project
claude-code
Test commands in Claude Code chat:
1. Test pattern awareness:
"What are my core patterns?"
→ Should reference CORE-PATTERNS.md
2. Test system status:
"What features are incomplete?"
→ Should read system-status.json
3. Test MCP:
"List my GitHub repositories"
→ Should use GitHub MCP
4. Test skill activation (if hook enabled):
"I'm getting a connection error"
→ Should reference troubleshooting-decision-tree-skill
✅ Success: Claude responds with your project context
You now have:
Time invested: 30 minutes Immediate value: Consistent responses, pattern compliance, basic automation
Add these enhancements (2-3 hours):
→ See Chapter 13: Claude Code Hooks and Chapter 06: MCP Integration
Add specialized capabilities (4-6 hours):
→ See Chapter 12: Memory Bank Hierarchy and Chapter 16: Skills Activation
Build full ecosystem (organic growth):
→ See Chapter 36: Agents and Subagents and Chapter 29: Branch Context System
Check:
# 1. File exists?
ls memory-bank/always/CORE-PATTERNS.md
# 2. Referenced in CLAUDE.md?
grep "@memory-bank/always/CORE-PATTERNS.md" .claude/CLAUDE.md
# 3. No .template extension?
ls memory-bank/always/*.template
# Should return nothing
Fix: Add to .claude/CLAUDE.md:
## Auto-Load Context
@memory-bank/always/CORE-PATTERNS.md
@memory-bank/always/system-status.json
Check:
# 1. Run MCP validator
./scripts/check-mcp.sh
# 2. Check for placeholders
grep '${' .claude/mcp_servers.json
# 3. Validate JSON
jq empty .claude/mcp_servers.json
Fix:
${VARIABLE} with actual valuesrepo scopeCheck:
# 1. Skills in correct location?
ls ~/.claude/skills/
# 2. YAML frontmatter valid?
head -5 ~/.claude/skills/troubleshooting-decision-tree-skill.md
# Should start with:
# ---
# name: troubleshooting-decision-tree-skill
# description: "..."
# ---
Fix:
~/.claude/skills/ (user-level, not project)Check:
# 1. Script is executable?
ls -l scripts/validate-setup.sh
# 2. jq installed?
which jq
# 3. Run with explicit path
bash scripts/validate-setup.sh
Fix:
chmod +x scripts/validate-setup.shbrew install jq or apt-get install jqUse this to verify your setup:
./scripts/validate-setup.sh passes with 0 errorsAll checked? You’re ready to use Claude Code! 🎉
Every time you start Claude Code (< 2 min):
# Quick status check
git status
cat memory-bank/always/system-status.json | jq '.features[] | select(.passes == false)'
# Or use the skill
# In Claude Code: "Use session-start-protocol-skill"
Before ending session:
# Update status
# Edit memory-bank/always/system-status.json
# Commit progress
git add -A
git commit -m "checkpoint: [what you accomplished]"
Minimal setup succeeds when:
Time to value: Immediate (Claude respects your patterns from first message)
Minimal Setup Guide: 30-minute path to productive Claude Code Next: Chapter 04: Task Tracking System