Skip to content

GitHub Hooks

rUv edited this page Jul 31, 2025 · 2 revisions

🌊 Claude Flow Alpha 80: GitHub-Enhanced Claude Code Hooks

🌟 Star on GitHub 📦 Alpha Release 🐙 GitHub Integration


🚀 Revolutionary Transparency: Full Observable Development Layer

Claude Flow Alpha 80 transforms Claude Flow into a fully observable, versioned development layer that captures the invisible sub-agent logic from your Claude Code agents directly into GitHub. Every hidden operation, task start, memory change, and context update is now tracked and published via GitHub.

📋 Overview

The new github init command introduces deep GitHub integration with:

  • 🔖 Automated checkpointing - Every edit, task, and session
  • Instant rollback - To any tagged state
  • 📊 Full historical logging - Of every sub-agent action
  • 🧠 Complete introspection - Exposing the full execution flow

🎯 Key Benefits

Enhanced Introspection

  • Expose full execution flow - See how agents make decisions
  • Audit all decisions - Complete trail of agent reasoning
  • Trace context shifts - Understand workflow transitions
  • Analyze task sequences - Timestamped, versioned logs

No More Guesswork

Developers get a clear, structured trail of:

  • ✏️ Every edit with full diffs
  • 💾 Memory updates with context
  • 🔧 Tool activity with parameters
  • 📝 Session summaries in .claude/checkpoints/

🚀 Quick Start

Enable GitHub-Enhanced Hooks

# Initialize with full GitHub integration
npx claude-flow@alpha github init --force

This enables:

  • 🔖 GitHub releases for every checkpoint: edits, tasks, sessions
  • Team-wide rollback to any tagged state
  • 🧠 Traceability of what happened, when, and by which agent
  • 🔄 Live syncing across contributors

🎨 What Gets Tracked

1. File Operations

Every file edit creates a GitHub release with:

  • Full file path and timestamp
  • Complete diff of changes
  • Agent that made the change
  • Context and reasoning

2. Task Initialization

When agents start tasks:

  • Task description and ID
  • Assigned agent details
  • Start time and context
  • Related memory state

3. Memory Operations

All memory changes are versioned:

  • Key-value updates
  • Namespace changes
  • Cross-agent communications
  • Decision rationale

4. Session Management

Complete session tracking:

  • Session start/end times
  • All operations performed
  • Agent coordination patterns
  • Comprehensive summary in summary-session.md

💻 Real-World Example

# Initialize GitHub hooks
npx claude-flow@alpha github init --force

# Start development - everything is automatically tracked
claude

# Agent performs operations...
# Each operation creates a GitHub release:
# - checkpoint-20240131-143022 (pre-edit)
# - checkpoint-20240131-143025 (post-edit)
# - task-20240131-143030 (new task)
# - session-20240131-150000 (session end)

# View all checkpoints
gh release list

# Rollback to specific point
gh release download checkpoint-20240131-143022

📁 Enhanced File Structure

.claude/
├── checkpoints/
│   ├── summary-session-20240131-150000.md  # Full session context
│   ├── 1754231422.json                      # Checkpoint metadata
│   └── task-1754231430.json                 # Task metadata
├── helpers/
│   ├── github-checkpoint-hooks.sh           # GitHub integration
│   └── checkpoint-manager.sh                # Management utilities
└── settings.json                            # Auto-configured hooks

🔄 Hook Integration Flow

Pre-Operation Phase

  1. Context Loading - Agent loads previous state
  2. GitHub Checkpoint - Creates pre-operation snapshot
  3. Decision Recording - Logs reasoning and approach

During Operation

  1. Real-time Tracking - Every action is logged
  2. Memory Updates - State changes are versioned
  3. Progress Monitoring - Live status updates

Post-Operation Phase

  1. Result Capture - Final state recorded
  2. GitHub Release - Tagged checkpoint created
  3. Diff Generation - Changes summarized

🤝 Collaborative Benefits

For Teams

  • 👥 Shared Context - Everyone sees the same history
  • 🔍 Debugging - Trace issues to specific operations
  • 📊 Analytics - Understand development patterns
  • 🔄 Coordination - Multi-agent transparency

For Projects

  • 📜 Complete Audit Trail - Every decision recorded
  • 🚀 Reproducible Workflows - Replay any sequence
  • 🛡️ Quality Assurance - Review agent decisions
  • 📈 Performance Analysis - Optimize workflows

🎯 Use Cases

1. Collaborative Debugging

# Team member hits an issue
# Check recent operations
gh release list --limit 20

# Download problematic checkpoint
gh release download checkpoint-20240131-143022

# Analyze the session summary
cat .claude/checkpoints/summary-session-*.md

2. Multi-Agent Transparency

See exactly how agents coordinate:

  • Which agent made each decision
  • How agents share memory
  • Task handoff patterns
  • Coordination efficiency

3. Reproducible Workflows

Perfect for:

  • Training new team members
  • Documenting best practices
  • Creating workflow templates
  • Standardizing procedures

🔧 Advanced Features

Custom Checkpoint Rules

Configure what gets checkpointed:

{
  "checkpoint": {
    "includePatterns": ["*.js", "*.py"],
    "excludePatterns": ["node_modules/**"],
    "minChangeSize": 10,
    "compression": true
  }
}

Integration with CI/CD

Trigger workflows on checkpoints:

on:
  release:
    types: [created]
    tags:
      - 'checkpoint-*'
      - 'session-*'

Analytics Dashboard

Coming soon: Visual analytics of:

  • Agent performance metrics
  • Task completion rates
  • Memory usage patterns
  • Coordination efficiency

📊 Session Summary Example

Every session generates a comprehensive summary:

# Session Summary: 2024-01-31T15:00:00Z

## Overview
- Duration: 2h 15m
- Tasks Completed: 12
- Files Modified: 8
- Agents Active: 5

## Key Decisions
1. Chose REST over GraphQL for API
2. Implemented JWT authentication
3. Added Redis caching layer

## File Changes
- src/api/users.js: +156 -23
- src/auth/jwt.js: +89 -0
- tests/api.test.js: +234 -45

## Memory Updates
- project/architecture: REST API design
- auth/strategy: JWT with refresh tokens
- cache/config: Redis with 1h TTL

## Checkpoints Created
- checkpoint-20240131-143022: Pre-API refactor
- checkpoint-20240131-145512: Post-authentication
- task-20240131-143030: Implement user CRUD

🚀 Getting Started

Requirements

  • Git repository
  • GitHub CLI (gh)
  • Node.js 18+
  • Claude Code

Installation

# Install Claude Flow alpha
npm install -g claude-flow@alpha

# Initialize GitHub hooks
npx claude-flow@alpha github init --force

# Start coding with full observability
claude

🔮 Future Enhancements

  • Real-time dashboard for live monitoring
  • AI-powered checkpoint analysis
  • Cross-repository synchronization
  • Advanced search across checkpoints
  • Team collaboration features
  • Performance optimization recommendations

📚 Related Documentation


💡 Pro Tip: The combination of GitHub hooks and Claude Flow's agent system provides unprecedented visibility into AI-assisted development, making it ideal for teams that need full transparency and auditability.

Latest Version: v2.0.0-alpha.80 | Documentation: claude-flow.wiki | Issues: Report Bug

Clone this wiki locally