Skip to content

Instantly share code, notes, and snippets.

@enachb
Last active January 26, 2026 19:58
Show Gist options
  • Select an option

  • Save enachb/1339d73740ccff44918c66386695cefb to your computer and use it in GitHub Desktop.

Select an option

Save enachb/1339d73740ccff44918c66386695cefb to your computer and use it in GitHub Desktop.
Claude Code Extension Points - Team Presentation

Claude Code Extension Points

A Team Presentation (30-45 min)


Agenda

  1. Prerequisites & Setup (5 min)
  2. What is Claude Code? (5 min)
  3. Extension Points Overview (5 min)
  4. Our Implementation (15 min)
  5. Live Demo (5 min)
  6. Happy & Remote Access (5 min)
  7. Q&A (5 min)

0. Prerequisites & Installation

Required Tools

Before using our Claude Code setup, install these tools:

# 1. GitHub CLI (for gists, PRs, issues)
brew install gh
gh auth login  # Follow prompts to authenticate

# 2. Happy CLI (Claude Code wrapper with web UI)
npm install -g @anthropic-ai/claude-code
npm install -g @anthropic-ai/happy  # or via https://happy.engineering

# 3. Gemini CLI (for code reviews)
# Install Google Cloud CLI first: https://cloud.google.com/sdk/docs/install
brew install --cask google-cloud-sdk

# Then install Gemini CLI
gcloud components install gemini

# 4. Go tools (for our Go projects)
brew install go
go install golang.org/x/tools/gopls@latest

0.1 First-Time Gemini Setup

Important: Run Gemini once in your source folder to grant permissions and login.

# Navigate to your project
cd ~/src/skydaddy

# Run gemini to trigger login flow
gemini "Hello, confirm you're working"

# This will:
# 1. Open browser for Google OAuth
# 2. Grant Gemini access to your account
# 3. Cache credentials for future use

Verify it works:

echo "What is 2+2?" | gemini -m gemini-3-flash-preview -y "test"
# Should output: 4

0.2 First-Time Happy Setup

Happy wraps Claude Code with additional features.

# Install Happy
npm install -g @anthropic-ai/happy

# Or download from https://happy.engineering

# First run - will prompt for Anthropic API key
cd ~/src/skydaddy
happy

# Happy stores config in ~/.happy/

Verify installation:

which happy
# /usr/local/bin/happy (or similar)

happy --version

0.3 GitHub CLI Setup

# Install
brew install gh

# Authenticate (opens browser)
gh auth login

# Verify
gh auth status
# Should show: Logged in to github.com as <username>

# Test it works
gh repo view

Required for:

  • Creating gists (gh gist create)
  • PR workflows (gh pr create)
  • Issue management (gh issue)

1. What is Claude Code?

Anthropic's official CLI for Claude - an agentic coding assistant that:

  • Reads and writes files directly
  • Runs shell commands
  • Uses tools autonomously
  • Maintains conversation context
  • Works in any terminal (iTerm, tmux, VS Code)
# Run via Happy (recommended)
cd your-project && happy

# Or run Claude Code directly
cd your-project && claude

Key insight: Claude Code is extensible through the .claude/ directory.


1.1 What is Happy?

Happy is a Claude Code enhancement layer that provides:

Feature Description
Web UI Access Claude Code from any browser
Session Sync Continue conversations across devices
Mobile Access Check on long-running tasks from phone
Team Sharing Share sessions with colleagues
History Searchable conversation history
Notifications Get alerts when Claude needs input

Why use happy instead of claude?

  • Same Claude Code underneath
  • Adds web dashboard at https://happy.engineering
  • Sessions persist even if terminal closes
  • Access from laptop, phone, or tablet
# Start a session
happy

# Your session is now accessible at:
# https://happy.engineering/sessions/<session-id>

2. Extension Points Overview

.claude/
├── settings.json      # Permissions, hooks config
├── agents/            # Custom sub-agents
├── commands/          # Slash commands (/improvements)
├── skills/            # Complex workflows (/tdd)
├── hooks/             # Shell scripts triggered on events
├── templates/         # Reusable code snippets
└── docs/              # Context documents

Six main extension points:

  1. Rules (CLAUDE.md)
  2. Permissions (settings.json)
  3. Hooks (PreToolUse, PostToolUse, etc.)
  4. Skills (guided workflows)
  5. Agents (specialized sub-agents)
  6. Commands (slash commands)

2.1 Rules: CLAUDE.md

Project-specific instructions loaded into every session.

# CLAUDE.md (project root)

## Code Style
- Use Go 1.21+ features
- Proto-first API design
- Table-driven tests

## Commands
- `make test` - Run all tests
- `make build` - Build everything

## Architecture
- Services in /internal
- Protos in /proto

Where rules can live:

  • Project root: CLAUDE.md
  • User level: ~/.claude/CLAUDE.md
  • Workspace: .claude/rules/*.md

2.2 Permissions: settings.json

Control what Claude can and cannot do.

{
  "permissions": {
    "allow": [
      "Bash(make :*)",
      "Bash(git :*)",
      "Bash(go :*)",
      "Write(**/*.go)",
      "mcp__linear__*"
    ],
    "deny": [
      "Read(.env)",
      "Read(**/*.pem)",
      "Bash(rm -rf /)",
      "Bash(curl :*)"
    ]
  }
}

Pattern types:

  • Bash(pattern) - Shell commands
  • Read/Write(glob) - File access
  • mcp__server__* - MCP tool access

2.3 Hooks: Event-Driven Automation

Shell scripts triggered at specific lifecycle events.

Hook When it runs
PreToolUse Before any tool executes
PostToolUse After tool completes
PostToolUseFailure After tool fails
UserPromptSubmit When user sends message
Notification On any notification
PermissionRequest When permission needed
Stop When Claude stops

2.3 Hooks: Configuration

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [{
          "type": "command",
          "command": ".claude/hooks/build-on-edit.sh",
          "timeout": 120
        }]
      }
    ],
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [{
          "type": "command",
          "command": ".claude/hooks/protect-git-clean.sh"
        }]
      }
    ]
  }
}

Hook can:

  • Exit 0 → Allow
  • Exit 2 → Block with message
  • Output feedback to Claude

2.4 Skills: Guided Workflows

Multi-step interactive workflows invoked via slash commands.

.claude/skills/
└── tdd/
    └── SKILL.md
---
name: tdd
description: Guide TDD cycles for Go projects
---

# TDD Skill

When invoked with `/tdd <feature>`:

1. RED: Write failing test first
2. GREEN: Minimal implementation
3. REFACTOR: Clean up code

Skills are:

  • User-invoked (/tdd, /workflow-optimizer)
  • Stateful across the conversation
  • Can have specific model preferences (Haiku for speed)

2.5 Agents: Specialized Sub-Agents

Background workers with specific expertise.

.claude/agents/
└── code-simplifier.md
---
name: code-simplifier
description: "Refactor code for readability"
tools: Edit, Write
model: haiku
---

You are an expert code simplification specialist...
- Remove dead code
- Flatten nested conditionals
- Reduce complexity

Agents are:

  • System-invoked (Claude decides when to use)
  • Run as background Task tool
  • Can use subset of tools
  • Can use cheaper models (Haiku)

2.6 Commands: Simple Slash Commands

Quick actions without full skill complexity.

.claude/commands/
└── improvements.md
---
description: Analyze session and propose improvements
model: haiku
---

Review the session for:
- Code quality improvements
- Workflow efficiency
- Error prevention

Commands vs Skills:

  • Commands: One-shot analysis
  • Skills: Multi-step interactive workflows

3. Our Implementation

What we've built in .claude/

.claude/
├── settings.json          # 200+ lines of config
├── agents/
│   └── code-simplifier.md # Auto-refactoring
├── commands/
│   └── improvements.md    # Session analysis
├── skills/
│   ├── tdd/SKILL.md      # Test-Driven Development
│   └── workflow-optimizer/SKILL.md
├── hooks/
│   ├── go-build-check.sh # Auto build/fmt/vet
│   ├── gemini-review.sh  # Gemini code reviews
│   ├── protect-git-clean.sh
│   ├── discord-notify.sh # Mobile notifications
│   └── build-on-edit.sh
├── templates/
│   └── null-safety-test.go
└── docs/
    └── *.md              # Context documents

3.1 Our Permissions Model

Allowed (auto-approved):

make, git, go, npm, docker, psql, gemini
Edit, Write for code files
MCP servers: linear, zen, gopls

Denied (blocked):

.env files, secrets, credentials
*.pem, *.key, *_rsa files
curl, wget (no arbitrary downloads)
System directories (/etc, /usr, /bin)

Why this matters:

  • Claude runs autonomously for hours
  • Can't accidentally leak secrets
  • Can't make network requests without approval

3.2 Our Hooks in Action

go-build-check.sh (PostToolUse)

# After ANY tool use
make go-fmt     # Format code
make go-vet     # Static analysis
make go-build   # Verify compilation
make go-tidy    # Clean dependencies

Result: Code always compiles, never commit broken code.

protect-git-clean.sh (PreToolUse)

# Before Bash commands with 'git clean'
# Check for uncommitted changes
# BLOCK with exit 2 if dangerous

Result: Can't accidentally delete untracked files.


3.3 Enforced Gemini Code Reviews

Every code change gets a second opinion from Gemini.

{
  "PostToolUse": [{
    "matcher": "Edit|Write",
    "hooks": [
      { "command": "go fmt ./..." },
      { "command": "go vet ./..." },
      { "command": "make build" },
      { "command": "go test -short ./internal/..." },
      { "command": "./.claude/gemini-review.sh" }  // ← Gemini reviews!
    ]
  }]
}

After EVERY Edit/Write:

  1. Format code
  2. Run static analysis
  3. Build to verify compilation
  4. Run unit tests
  5. Send diff to Gemini for independent review

3.4 Dual-Model Agreement

Claude writes code. Gemini reviews it. Both must agree.

┌─────────────┐     writes      ┌─────────────┐
│   Claude    │ ───────────────►│   Code      │
│  (Opus 4)   │                 │  Changes    │
└─────────────┘                 └──────┬──────┘
                                       │
                                       ▼ PostToolUse hook
                               ┌───────────────┐
                               │ gemini-review │
                               │    .sh        │
                               └───────┬───────┘
                                       │
                                       ▼
┌─────────────┐    reviews     ┌─────────────┐
│   Gemini    │ ◄──────────────│   Diff      │
│ (Flash 3)   │                │  Output     │
└──────┬──────┘                └─────────────┘
       │
       ▼
   Feedback shown to Claude
   (bugs, best practices, security)

Why two models?

  • Different training data catches different bugs
  • Independent verification of logic
  • Security vulnerabilities from fresh perspective

3.5 Gemini Review Script

gemini-review.sh - what it does:

# Extract unified diff of Go changes
DIFF=$(git diff --unified=3 -- '*.go')

# Send to Gemini with focused prompt
echo "$PROMPT" | gemini -m gemini-3-flash-preview

# Review criteria:
# 1. Potential bugs or logic errors
# 2. Go best practices violations
# 3. Error handling issues
# 4. Security vulnerabilities
# 5. Race conditions
# 6. Nil pointer dereferences
# 7. Testability gaps

Output: Severity-grouped feedback (Critical/High/Medium/Low)

If clean: Returns LGTM (Looks Good To Me)


3.6 Design Document Reviews

Not just code - also review design docs:

# gemini-review.sh design
DIFF=$(git diff --unified=3 -- '*.md' 'docs/**')

# Design review focuses on:
# 1. Clarity and completeness
# 2. Technical accuracy
# 3. Missing edge cases
# 4. Consistency with architecture
# 5. Actionability - can this be implemented?

When it runs:

  • Pre-commit hook (before you commit)
  • Post-commit hook (reference for next time)
  • Manual: ./scripts/gemini-code-review.sh main..HEAD

3.7 Discord Notifications

Get notified on your phone when Claude needs you.

# discord-notify.sh
# Sends webhook notifications for:
- Permission requests
- Claude stopping
- Questions (AskUserQuestion)
- Errors

Notification includes:

  • Event type with emoji
  • Context/message
  • Project name
  • Muxile link for remote access

3.8 TDD Skill (/tdd)

Enforces Test-Driven Development discipline.

/tdd implement sweep detection for NY open

Phase 1: RED

  • Write failing test first
  • Run make test-unit
  • Verify it fails for RIGHT reason

Phase 2: GREEN

  • Minimal implementation
  • Just enough to pass

Phase 3: REFACTOR

  • Clean up code
  • Keep tests green

Includes: Null safety testing requirements for all public functions.


3.9 Workflow Optimizer (/workflow-optimizer)

Analyzes session for efficiency improvements.

Uses Haiku model for fast analysis:

model: claude-haiku-4-5-20251001

Identifies:

  • Token waste (repeated context)
  • Sequential operations that could parallelize
  • Verbose confirmations
  • Missing template opportunities

Output:

  • Efficiency score (0-100)
  • Top inefficiencies with token cost
  • Quick wins to implement
  • Automation opportunities

3.10 Code Simplifier Agent

Auto-triggered after writing complex code.

# Triggers when:
- Nested if-then-else statements
- Large feature implementations
- Complex validation logic

Actions:

  • Remove dead code
  • Flatten with early returns
  • Extract helper functions
  • Simplify boolean logic

Key: Runs on Haiku (cheap, fast) - no approval needed.


4. Live Demo

Demo Flow

  1. Start Happy

    cd ~/src/skydaddy && happy
  2. Show settings.json - permissions, hooks

  3. Trigger a hook

    Edit a .go file → watch go-build-check + gemini-review run
    
  4. Use /tdd skill

    /tdd add validation for empty mission name
    
  5. Show Discord notification

  6. Open Happy web UI - https://happy.engineering


5. Happy & Remote Access

Continue your Claude Code session from anywhere.

Feature Benefit
Web Dashboard See all active sessions
Session Persistence Terminal closes? Session continues
Mobile Responsive Check progress from phone
Team Sharing Pair program with colleagues
Searchable History Find past conversations
Webhook Integration Connect to Slack/Discord

Our commit messages include:

Generated with Claude Code
via Happy

Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Happy <[email protected]>

5.1 Remote Access with tmux + Muxile

For long-running sessions:

# Start persistent session
tmux new-session -s claude

# Run Happy
happy

# Detach and go mobile
Ctrl+b, d

Muxile: Share tmux via QR code

  • View session on phone
  • Send commands remotely
  • No app needed (web-based)

See: .claude/docs/remote-access.md


6. Summary

Installation Checklist

# 1. GitHub CLI
brew install gh && gh auth login

# 2. Happy (Claude Code wrapper)
npm install -g @anthropic-ai/happy

# 3. Gemini CLI
brew install --cask google-cloud-sdk
gcloud components install gemini
cd ~/src/skydaddy && gemini "test"  # Login

# 4. Go tools
brew install go
go install golang.org/x/tools/gopls@latest

6.1 Extension Points Recap

Type Location Invocation Use Case
Rules CLAUDE.md Auto-loaded Project conventions
Permissions settings.json Auto-enforced Security boundaries
Hooks hooks/*.sh Event-triggered Automation, validation, Gemini reviews
Skills skills/*/SKILL.md /skill-name Guided workflows
Agents agents/*.md Auto by Claude Specialized tasks
Commands commands/*.md /command Quick analysis

Dual-Model Review Flow

Claude (Opus) writes → Hook triggers → Gemini (Flash) reviews → Feedback to Claude

Every code change is independently verified by a second AI model.


6.2 Claude Knows Its Own Config

Claude is fully aware of its extension system.

Just ask Claude to create what you need:

"Add a hook that runs ESLint after every file edit"
"Create a skill for database migrations"
"Write a pre-commit hook that blocks commits without tests"
"Add a permission rule to deny access to production configs"

Claude will:

  • Create the hook script in .claude/hooks/
  • Update settings.json with the hook config
  • Write the SKILL.md for new skills
  • Set up proper permissions

You dream it, Claude implements it.


6.3 Key Takeaways

  1. Claude Code is extensible - customize to your workflow
  2. Claude knows its config - ask it to create skills, hooks, rules
  3. Hooks prevent mistakes - auto-build, protect files
  4. Dual-model reviews - Claude writes, Gemini reviews (both must agree)
  5. Skills enforce discipline - TDD, consistent patterns
  6. Agents save tokens - use Haiku for simple tasks
  7. Discord + Muxile - stay connected remotely
  8. Happy - continue from anywhere via web UI

Our .claude/ is version controlled - share improvements!


Q&A

Questions?

Resources:

Try it:

cd ~/src/skydaddy && happy
/tdd
/workflow-optimizer
/improvements

Appendix: Quick Reference

Start a Session

cd ~/src/skydaddy && happy

Useful Skills

/tdd <feature>           # Test-Driven Development
/workflow-optimizer      # Analyze token efficiency
/improvements            # Session improvement suggestions

Manual Gemini Review

./scripts/gemini-code-review.sh           # Review current changes
./scripts/gemini-code-review.sh main..HEAD # Review branch vs main

Discord Webhook

Configure in .claude/hooks/discord-notify.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment