The Claude Code Hackathon Winner's Setup
"How Affaan Mustafa's 'Everything Claude Code' system works, and how to install and use the battle-tested configs that won the Anthropic x Forum Ventures hackathon. Agents, skills, hooks, rules, commands, MCPs, token optimization, and memory persistence."
Version 1.0.0 • Updated 03/01/2026, 12:00 PM EST
Part 0: Intro
Want a production-ready Claude Code setup instead of building one from scratch? This is it.
In September 2025, Affaan Mustafa (@affaanmustafa) and his teammate won the Anthropic x Forum Ventures hackathon in NYC, building zenith.chat entirely with Claude Code in 8 hours. The configs they used were refined over 10+ months of daily use. In January 2026, Affaan open-sourced everything as Everything Claude Code. The repo hit 35K+ stars and 900K+ views on X in days.
This tutorial breaks down what's in the repo, how the system works, how to install it, and how to adapt it for your own workflow.
What this tutorial will show you is:
- ✅ Understand the full architecture: agents, skills, hooks, rules, commands, MCPs
- ✅ Install the plugin in under 2 minutes
- ✅ Use token optimization settings to cut costs without sacrificing quality
- ✅ Run subagents for delegated tasks (planning, review, testing, security)
- ✅ Set up memory persistence so context survives between sessions
- ✅ Chain commands and skills for complex workflows
- ✅ Manage your context window so MCPs don't eat your tokens
- ✅ Use the continuous learning system to auto-extract patterns from sessions
What to expect: This is an intermediate tutorial. It assumes you already have Claude Code installed and have basic familiarity with slash commands and skills. If you haven't read those tutorials yet, start with How Slash Commands Work and How Agent Skills Work.
Tutorial Path
- Part 1: What Is Everything Claude Code? (5 min)
- Part 2: The Architecture Overview (10 min)
- Part 3: Installation (5 min)
- Part 4: Token Optimization (10 min)
- Part 5: Agents and Subagent Delegation (15 min)
- Part 6: Skills and Workflows (10 min)
- Part 7: Commands for Quick Execution (10 min)
- Part 8: Hooks and Automation (10 min)
- Part 9: Rules as Always-On Guardrails (5 min)
- Part 10: Memory Persistence Across Sessions (10 min)
- Part 11: Continuous Learning (10 min)
- Part 12: MCP Configuration and Context Budget (10 min)
- Part 13: Adapting It for Your Workflow (10 min)
- Part 14: Quick Reference (5 min)
- Part 15: What to Do Next (5 min)
Requirements
- Claude Code CLI v2.1.0 or later: https://docs.anthropic.com/en/docs/claude-code
- Git installed
- Familiarity with slash commands and skills (see prerequisites above)
- Node.js (for hooks and scripts)
Part 1: What Is Everything Claude Code? (5 min)
The Short Version
Everything Claude Code is a Claude Code plugin that contains a complete, battle-tested configuration system: agents, skills, hooks, commands, rules, and MCP configs. It's the actual setup used to win a hackathon, refined over 10+ months, and packaged for anyone to install.
What Makes It Different
Most Claude Code setups are one-off configs. This is a system. The components are designed to work together:
- Agents handle delegated work (planning, reviewing, testing, security audits)
- Skills define multi-step workflows (TDD, deployment, refactoring)
- Commands are quick shortcuts that invoke agents and skills
- Hooks fire automatically on tool events (lint on save, warn on console.log, save session state)
- Rules enforce standards on every interaction (security, style, testing, git workflow)
- MCPs connect external tools (GitHub, Supabase, Vercel, Railway)
The components chain together. Running /tdd invokes the TDD skill, which may delegate to the tdd-guide agent, which follows the testing rules. The hooks fire before and after tool use. The rules apply to everything.
The Two Guides
Affaan published two companion guides alongside the repo:
- The Shorthand Guide - Setup, foundations, philosophy. Start here.
- The Longform Guide - Token optimization, memory persistence, verification loops, parallelization. Advanced patterns.
This tutorial covers the practical content from both, focused on getting you set up and productive.
Part 2: The Architecture Overview (10 min)
The Directory Structure
everything-claude-code/
├── agents/ # Specialized subagents for delegation
├── skills/ # Workflow definitions and domain knowledge
├── commands/ # Slash commands for quick execution
├── hooks/ # Trigger-based automations
├── rules/ # Always-follow guidelines
├── scripts/ # Cross-platform Node.js hook implementations
├── contexts/ # Dynamic system prompt injection modes
├── mcp-configs/ # MCP server configurations
├── examples/ # Example CLAUDE.md configs
└── .claude-plugin/ # Plugin metadata for installation
Click to copy
How the Pieces Fit Together
Think of it in layers:
Layer 1: Rules (always active)
Rules load into every session. They enforce security, coding style, testing standards, and git workflow. You don't invoke them. They're always on.
Layer 2: Skills (activated by context)
Skills load when Claude recognizes a relevant task. TDD workflow activates when you mention testing. Security review activates when you mention vulnerabilities. They provide the detailed playbook.
Layer 3: Agents (delegated by Claude)
When a task is complex enough, Claude delegates to a specialized subagent. The code-reviewer agent handles code review. The architect agent handles system design. Each agent has its own tools, model preference, and instructions.
Layer 4: Commands (invoked by you)
Commands are your shortcuts. /tdd kicks off test-driven development. /plan starts implementation planning. /e2e generates end-to-end tests. Commands often trigger skills and agents under the hood.
Layer 5: Hooks (fire on events)
Hooks run automatically when specific tool events happen. Before Claude edits a file, a hook can lint it. After a session ends, a hook saves the context. Before compaction, a hook preserves important state.
Layer 6: MCPs (external connections)
MCP servers connect Claude Code to external services: GitHub for PRs, Supabase for databases, Vercel for deployments. Each MCP consumes tokens from your context window, which is why management matters.
Part 3: Installation (5 min)
Option 1: Install as Plugin (Recommended)
This is the fastest path. Two commands:
/plugin marketplace add affaan-m/everything-claude-code
/plugin install everything-claude-code@everything-claude-code
Click to copy
This gives you instant access to all commands, agents, skills, and hooks.
One exception: The Claude Code plugin system does not support distributing rules via plugins. You need to install rules manually:
# Clone the repo
git clone https://github.com/affaan-m/everything-claude-code.git
# Copy rules to your user-level config (applies to all projects)
cp -r everything-claude-code/rules/* ~/.claude/rules/
# Or copy to project-level (applies to current project only)
mkdir -p .claude/rules
cp -r everything-claude-code/rules/* .claude/rules/
Click to copy
Option 2: Manual Installation (Selective)
If you want to cherry-pick components:
git clone https://github.com/affaan-m/everything-claude-code.git
# Pick what you want
cp everything-claude-code/agents/*.md ~/.claude/agents/
cp everything-claude-code/rules/*.md ~/.claude/rules/
cp everything-claude-code/commands/*.md ~/.claude/commands/
cp -r everything-claude-code/skills/* ~/.claude/skills/
Click to copy
For hooks, copy the relevant entries from hooks/hooks.json into your ~/.claude/settings.json.
For MCPs, copy desired server configs from mcp-configs/mcp-servers.json into your ~/.claude.json. Replace YOUR_*_HERE placeholders with your actual API keys.
Verify Installation
After installing, run:
/help
Click to copy
You should see the new commands listed: /tdd, /plan, /e2e, /code-review, /build-fix, /refactor-clean, and others.
Part 4: Token Optimization (10 min)
Why This Matters
Claude Code usage gets expensive fast if you don't manage tokens. The default settings are not optimized for cost. This repo includes settings that significantly reduce consumption without sacrificing quality.
The Key Settings
Add these to your ~/.claude/settings.json:
{
"model": "sonnet",
"env": {
"MAX_THINKING_TOKENS": "10000",
"CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "50"
}
}
Click to copy
What each does:
"model": "sonnet" - Default to Sonnet for routine work. It's faster and cheaper. You can override to Opus for complex reasoning tasks via command frontmatter or by typing /model.
MAX_THINKING_TOKENS: 10000 - Caps the extended thinking budget. Without this, Opus can burn 30K+ tokens just thinking. 10K is enough for most tasks.
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE: 50 - Triggers auto-compaction at 50% context usage instead of the default 95%. This prevents the degraded output quality that happens when the context window is nearly full.
Strategic Compaction
The repo includes a strategic-compact skill that suggests /compact at logical breakpoints instead of relying on auto-compaction. This is better than auto-compaction because:
- Auto-compaction fires at a percentage threshold, which might be mid-task
- Strategic compaction fires at natural transition points (after finishing a feature, before starting a new module)
- You preserve the important context and discard the noise
Model Selection Strategy
Not every task needs Opus. The general guideline from the repo:
- Haiku - Simple file operations, formatting, basic generation
- Sonnet - Day-to-day coding, standard reviews, documentation
- Opus - Complex architecture decisions, security analysis, multi-file refactors, debugging subtle issues
Subagents can specify their own model. The code-reviewer agent uses Opus because reasoning quality matters. A doc-updater agent can use Sonnet because the task is straightforward.
Part 5: Agents and Subagent Delegation (15 min)
What Agents Do
Agents are specialized Claude instances with their own context window, tools, and instructions. When the main Claude Code session needs to do something complex, it delegates to an agent. The agent does the work and returns a summary.
Why Agents Save Context
Here's the key insight: subagents run in their own context window. They do their work, then return a summary to the main session. The main session only receives the summary, not the full working context. This means a code review that would consume 50K tokens in your main window only costs the summary (maybe 2-3K tokens).
Included Agents
| Agent | Purpose | Model |
|---|---|---|
planner | Feature implementation planning | Opus |
architect | System design decisions | Opus |
tdd-guide | Test-driven development workflow | Opus |
code-reviewer | Quality and security review | Opus |
security-reviewer | Vulnerability analysis | Opus |
build-error-resolver | Fix build/compile errors | Sonnet |
e2e-runner | Playwright E2E testing | Sonnet |
refactor-cleaner | Dead code cleanup | Sonnet |
doc-updater | Documentation sync | Sonnet |
go-reviewer | Go-specific code review | Opus |
go-build-resolver | Go build error resolution | Sonnet |
Agent Structure
Each agent is a Markdown file in the agents/ directory with frontmatter:
---
name: code-reviewer
description: Reviews code for quality, security, and maintainability
tools: ["Read", "Grep", "Glob", "Bash"]
model: opus
---
You are a senior code reviewer...
Click to copy
The tools field restricts what the agent can do. The model field sets the model. The body contains the agent's instructions and persona.
The Context Problem with Subagents
This is a key concept from the Longform Guide. Subagents only know the literal query, not the implicit reasoning behind the request. The main session has semantic context that the subagent lacks.
The analogy from the guide: your boss sends you to a meeting and asks for a summary. You come back and give the rundown. Nine times out of ten, the boss has follow-up questions because your summary didn't include everything they needed. You didn't have their implicit context.
The solution is the iterative retrieval pattern: instead of one round-trip to the subagent, use multiple rounds where the main session reviews the summary and asks follow-up questions. The iterative-retrieval skill implements this pattern.
Part 6: Skills and Workflows (10 min)
Included Skills
| Skill | Purpose |
|---|---|
coding-standards | Language best practices |
backend-patterns | API, database, caching patterns |
frontend-patterns | React, Next.js patterns |
tdd-workflow | Full TDD methodology (RED/GREEN/IMPROVE) |
security-review | Security checklist and analysis |
strategic-compact | Manual compaction suggestions at logical breakpoints |
continuous-learning | Auto-extract patterns from sessions |
continuous-learning-v2 | Instinct-based learning with confidence scoring |
iterative-retrieval | Progressive context refinement for subagents |
eval-harness | Verification loop evaluation |
verification-loop | Continuous verification patterns |
golang-patterns | Go idioms and best practices |
golang-testing | Go testing patterns, TDD, benchmarks |
How Skills Chain with Commands
Skills and commands are designed to work together. When you run /tdd, it:
- Loads the
tdd-workflowskill - May delegate to the
tdd-guideagent - Follows the testing rules (80% coverage requirement)
- Uses the coding-standards skill for language-specific patterns
This chaining is what makes the system more than the sum of its parts. A single command can orchestrate multiple skills and agents.
Chaining Commands in a Single Prompt
You can invoke multiple commands in sequence:
/plan the new auth module, then /tdd the core functions
Click to copy
Or chain them with context:
/code-review the changes, then /refactor-clean anything flagged
Click to copy
The Codemap Pattern
One of the more powerful ideas from the repo: create a skill that updates codemaps at checkpoints. A codemap is a structured overview of your codebase that Claude can read to navigate without burning context on file exploration.
Instead of Claude running find and grep across your repo to understand the structure (which costs tokens), it reads a pre-built codemap that tells it what's where. The codemap gets updated at logical breakpoints via a hook or command.
Part 7: Commands for Quick Execution (10 min)
Included Commands
| Command | What It Does |
|---|---|
/tdd | Start test-driven development workflow |
/plan | Implementation planning for a feature |
/e2e | Generate end-to-end tests (Playwright) |
/code-review | Quality and security review |
/build-fix | Fix build/compile errors |
/refactor-clean | Remove dead code and loose files |
/learn | Extract patterns from current session |
/checkpoint | Save verification state |
/verify | Run verification loop |
/go-review | Go-specific code review |
/go-test | Go TDD workflow |
/go-build | Fix Go build errors |
/skill-create | Generate skills from git history |
/instinct-status | View learned instincts with confidence |
/instinct-import | Import instincts from others |
/instinct-export | Export your instincts for sharing |
/evolve | Cluster related instincts into skills |
/setup-pm | Configure package manager |
The Most Useful Commands Day-to-Day
/plan before starting any feature. It invokes the planner agent to break the work into steps before writing code. This prevents the common problem of Claude diving into implementation without a coherent plan.
/tdd for anything that needs tests. Follows the RED/GREEN/IMPROVE cycle: write failing tests first, implement minimal code to pass, then refactor. Enforces 80% coverage.
/code-review after completing a feature. Delegates to the code-reviewer agent (Opus) for a thorough review focused on logic errors, security, and maintainability.
/refactor-clean at the end of a long coding session. Cleans up dead code, unused imports, orphaned files, and loose .md files that accumulated during development.
/learn mid-session to extract useful patterns. This feeds the continuous learning system (covered in Part 11).
Part 8: Hooks and Automation (10 min)
What Hooks Do
Hooks fire automatically when specific events happen in Claude Code. They run before or after tool use, on session start, on session end, and before compaction.
Hook Types
| Hook Type | When It Fires |
|---|---|
PreToolUse | Before Claude uses a tool (edit, bash, etc.) |
PostToolUse | After Claude uses a tool |
Stop | When Claude finishes a response |
SessionStart | When a Claude Code session begins |
SessionEnd | When a session ends |
PreCompact | Before context compaction |
Included Hooks
The repo includes hooks for:
Console.log warnings - When Claude edits a .ts, .tsx, .js, or .jsx file, the hook checks for console.log statements and warns if found.
Memory persistence - On session start, loads saved context from the previous session. On session end, saves current context. Before compaction, preserves important state. (More on this in Part 10.)
Strategic compaction - Suggests /compact at logical breakpoints instead of relying on auto-compaction.
Session evaluation - On session end, extracts patterns and learnings from the session for the continuous learning system.
Hook Configuration
Hooks live in hooks/hooks.json. The structure uses matchers to determine when hooks fire:
{
"matcher": "tool == \"Edit\" && tool_input.file_path matches \"\\.(ts|tsx|js|jsx)$\"",
"hooks": [{
"type": "command",
"command": "node scripts/hooks/lint-check.js"
}]
}
Click to copy
This hook fires when Claude edits a TypeScript or JavaScript file, running a lint check before the edit is applied.
Cross-Platform Scripts
All hook scripts in this repo are written in Node.js (not bash) for Windows/macOS/Linux compatibility. They live in the scripts/ directory.
Part 9: Rules as Always-On Guardrails (5 min)
What Rules Do
Rules are always-follow guidelines that load into every session. They're the closest thing to "permanent instructions" in Claude Code.
Included Rules
| Rule File | What It Enforces |
|---|---|
security.md | No hardcoded secrets, input validation, auth checks |
coding-style.md | Immutability, file organization, naming conventions |
testing.md | TDD, 80% coverage requirement, test isolation |
git-workflow.md | Commit format, PR process, branch naming |
agents.md | When and how to delegate to subagents |
performance.md | Model selection, context management, token efficiency |
How Rules Differ from Skills
Skills activate when relevant. Rules are always active. Think of it this way:
- Rule: "Never hardcode secrets. Always use environment variables." (applies to every interaction)
- Skill: "Here's the full security audit playbook." (activates when doing a security review)
Rules are short and absolute. Skills are detailed and conditional.
Installing Rules
Rules don't install via the plugin system (upstream limitation). Copy them manually:
# User-level (all projects)
cp -r everything-claude-code/rules/* ~/.claude/rules/
# Project-level (one project)
mkdir -p .claude/rules
cp -r everything-claude-code/rules/* .claude/rules/
Click to copy
Part 10: Memory Persistence Across Sessions (10 min)
The Problem
By default, every Claude Code session starts cold. Your previous session's context, decisions, and progress are gone. You spend the first 10 minutes re-establishing what you were working on.
The Solution: Session Lifecycle Hooks
The repo includes hooks that save and load context automatically:
- SessionStart hook - Loads saved context from the previous session's state file
- PreCompact hook - Before compaction wipes context, saves the important parts
- SessionEnd hook - Saves the current session's state (what was worked on, decisions made, next steps)
How It Works
On session end, the hook extracts:
- What files were modified
- What decisions were made
- What's left to do
- Key context that should carry forward
This gets saved to a state file. On the next session start, the hook loads that file, giving Claude immediate awareness of where things left off.
The Result
Instead of:
Session 1: Build auth module (context lost)
Session 2: "What was I working on again?" (re-explain everything)
Click to copy
You get:
Session 1: Build auth module (state saved automatically)
Session 2: Claude loads state → "Continuing auth module. Last session you
completed the JWT middleware and started the refresh token flow. The
remaining work is..."
Click to copy
Part 11: Continuous Learning (10 min)
The Concept
Every coding session contains patterns worth extracting: what worked, what failed, what approaches were effective for your specific codebase. The continuous learning system captures these automatically.
How It Works
- Mid-session: Run
/learnto extract patterns from the current conversation - Session end: The
evaluate-sessionhook runs automatically, pulling out reusable insights - Over time: Patterns accumulate into instincts with confidence scores
Continuous Learning v2: Instincts
The v2 system introduces instincts, which are patterns with metadata:
- Confidence score - How well-validated this pattern is
- Evidence - What sessions/situations confirmed it
- Action - What Claude should do when this pattern applies
Commands for managing instincts:
/instinct-status # View learned instincts with confidence scores
/instinct-import <file> # Import instincts from a teammate
/instinct-export # Export your instincts for sharing
/evolve # Cluster related instincts into formal skills
Click to copy
The /evolve Command
This is the most interesting part. When you have enough instincts in a domain, /evolve clusters them into a formal skill. Individual observations graduate into structured capability.
Example: After 20 sessions of React work, your instincts might include patterns about state management, component structure, and performance optimization. /evolve clusters these into a react-patterns skill with organized instructions.
Generating Skills from Git History
The /skill-create command analyzes your repository's git history and generates skills based on actual patterns in your commits:
/skill-create # Analyze current repo
/skill-create --instincts # Also generate instincts
Click to copy
This is powerful for established codebases. Instead of writing skills from scratch, you generate them from the real patterns in your code.
Part 12: MCP Configuration and Context Budget (10 min)
The Token Cost of MCPs
This is the most overlooked cost in Claude Code setups. Every MCP server you enable injects its tool descriptions into your context window. These descriptions consume tokens before you even send your first message.
The numbers from the repo:
- Your context window is 200K tokens
- With too many MCPs enabled, it can shrink to ~70K tokens
- That's a 65% reduction before you've done any work
The Rule of Thumb
From Affaan's guide:
- Configure 20-30 MCPs total
- Keep under 10 enabled per project
- Keep under 80 tools active
Managing MCPs Per Project
Use disabledMcpServers in your project-level config to disable MCPs you don't need for that specific project:
{
"disabledMcpServers": ["supabase", "vercel", "railway"]
}
Click to copy
This keeps the server configured but not consuming tokens until you need it.
Included MCP Configs
The repo includes configs for:
- GitHub
- Supabase
- Vercel
- Railway
- And others
Located in mcp-configs/mcp-servers.json. Copy the ones you need to ~/.claude.json and add your API keys.
Part 13: Adapting It for Your Workflow (10 min)
Don't Use Everything
The repo is a buffet, not a fixed menu. Affaan says it directly: these configs work for his workflow. You should:
- Start with what resonates
- Modify for your stack
- Remove what you don't use
- Add your own patterns
What to Adopt First
Start with these regardless of your stack:
- Token optimization settings (Part 4)
- The
/plancommand (never start a feature without a plan) - The
/code-reviewcommand (catch issues before they ship) - Security rules (always have guardrails)
- Memory persistence hooks (stop re-explaining every session)
Add these based on your stack:
- TDD commands and skills (if you practice TDD)
- Go-specific agents and skills (if you write Go)
- Frontend patterns (if you build React/Next.js)
- E2E testing (if you use Playwright)
Skip or modify these:
- Language-specific skills that don't match your stack
- MCP configs for services you don't use
- Hooks for workflows that don't match your process
Building Your Own Additions
The repo's structure is a template. Use the same patterns to build your own:
- Need a Django agent? Copy
agents/code-reviewer.md, change the persona and instructions - Need a SQL optimization skill? Create
skills/sql-optimization/SKILL.mdfollowing the existing skill structure - Need a deployment command? Create
commands/deploy.mdfollowing the existing command format
Contributing Back
The repo accepts contributions. If you build something useful (language-specific skills, framework configs, DevOps agents), submit a PR. The community benefits from shared patterns.
Part 14: Quick Reference (5 min)
Installation Cheat Sheet
# Plugin install (recommended)
/plugin marketplace add affaan-m/everything-claude-code
/plugin install everything-claude-code@everything-claude-code
# Manual rules install (required either way)
git clone https://github.com/affaan-m/everything-claude-code.git
cp -r everything-claude-code/rules/* ~/.claude/rules/
Click to copy
Token Optimization Settings
{
"model": "sonnet",
"env": {
"MAX_THINKING_TOKENS": "10000",
"CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "50"
}
}
Click to copy
Most Used Commands
| Command | When to Use |
|---|---|
/plan | Before starting any feature |
/tdd | When writing tests |
/code-review | After completing a feature |
/refactor-clean | End of a long coding session |
/build-fix | When CI breaks |
/learn | Mid-session to capture patterns |
/instinct-status | Check what patterns have been learned |
/evolve | Graduate instincts into formal skills |
Architecture Layers
Rules (always on)
└── Skills (activated by context)
└── Agents (delegated by Claude)
└── Commands (invoked by you)
└── Hooks (fire on events)
└── MCPs (external connections)
Click to copy
Part 15: What to Do Next (5 min)
Week 1: Install and Baseline
- Install the plugin
- Copy rules manually
- Apply token optimization settings
- Use
/planand/code-reviewin your daily workflow - Monitor your token usage with
/cost
Week 2: Hooks and Memory
- Enable memory persistence hooks
- Test that context carries between sessions
- Run
/learnat the end of each session - Enable strategic compaction
Week 3: Subagents and Skills
- Use
/tddfor a real feature - Watch how the planner agent breaks down work
- Try chaining commands:
/planthen/tddthen/code-review - Check which skills auto-activate and refine descriptions if needed
Week 4+: Customize and Contribute
- Add agents and skills for your specific stack
- Prune MCPs you don't use
- Run
/instinct-statusand/evolveto generate custom skills - Consider contributing patterns back to the repo
Resources
- GitHub Repo: https://github.com/affaan-m/everything-claude-code
- Shorthand Guide (Start Here): https://x.com/affaanmustafa/status/2012378465664745795
- Longform Guide (Advanced): https://x.com/affaanmustafa/status/2014040193557471352
- Affaan's X: @affaanmustafa
- Slash Commands Tutorial: /tutorials/claude-code-slash-commands
- Agent Skills Tutorial: /tutorials/claude-code-agent-skills