codelens-claude-hooks
v1.1.1
Published
Claude Code hooks for automatic conversation capture and team coordination analytics
Maintainers
Readme
CodeLens: Claude Code Analytics Mirror
This repository contains the Claude Code hook configuration for the CodeLens team coordination analytics system. These hooks automatically capture Claude Code conversations and send them to a Supabase database for real-time team analysis.
🎯 What This Does
CodeLens transforms isolated Claude Code conversations into objective team coordination insights by:
- Capturing every Claude interaction through automated hooks
- Analyzing conversation patterns to detect developer flow states
- Identifying file collisions when multiple developers work on the same code
- Providing real-time team status without subjective scoring
🏗️ System Architecture
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Claude Code │ │ Supabase │ │ React Frontend │
│ + This Config │───►│ Database │◄───│ (CodeLens UI) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
Hooks capture Stores chat Real-time team
conversations conversations coordination view📁 Repository Contents
.claude/settings.local.json
Hook configuration that triggers Python scripts on:
- UserPromptSubmit: When you send a prompt to Claude
- Stop: When Claude finishes responding
.claude/hooks/user-prompt-submit.py
Captures user prompts and:
- ✅ Creates anonymous user tracking (UUID-based)
- ✅ Extracts project name from working directory
- ✅ Initiates conversation logging in Supabase
- ✅ Sets up session tracking for response correlation
.claude/hooks/claude-response-submit.py
Captures Claude responses and:
- ✅ Reads Claude's response from conversation transcripts
- ✅ Updates the conversation record with the complete interaction
- ✅ Maintains conversation threading
- ✅ Includes comprehensive error logging and debugging
🚀 How It Works
1. Automatic Capture
Every time you use Claude Code in this directory:
You: "Fix the authentication bug in auth.js"
Claude: "I'll help you fix that. Let me examine the code..."→ Both sides automatically logged to Supabase
2. Team Analysis
The backend analyzes patterns across all team conversations:
- Flow Detection: Quick solutions indicate smooth progress
- Collision Detection: Multiple devs working on same files
- Stuck Detection: Extended back-and-forth on single issues
3. Real-Time Coordination
The frontend provides live team status:
- 🟢 Flow: Developer making steady progress
- 🟡 Slow: Multiple iterations, debugging mode
- 🔴 Stuck: Extended time on single issue
- ⚠️ Collision: Multiple devs on same file
🔧 Configuration Details
Data Collection
- Anonymous: Uses generated UUIDs, no personal data
- Project-Based: Extracts project name from
$(pwd) - Session-Linked: Correlates prompts with responses
- Remote Storage: Logs sent to
agfvdbmbebuawvhapmyi.supabase.co
Privacy & Security
- No code content is logged, only conversation metadata
- Anonymous user identification
- Temporary session files cleaned up automatically
- Local debug logging for troubleshooting
Dependencies
# Required Python packages
pip install requests uuid json pathlib📊 What Gets Analyzed
From your Claude conversations, the system extracts:
- File mentions → Collision detection
- Success/error indicators → Flow state analysis
- Question patterns → Learning opportunity identification
- Time between interactions → Productivity insights
- Problem resolution patterns → Team knowledge mapping
🎯 Integration with CodeLens
This hook configuration is part 1 of the complete CodeLens system:
- This Repository: Captures Claude conversations
- Backend Service: Analyzes patterns and provides API
- React Frontend: Displays real-time team coordination
What makes this incredible is the literally zero setup experience - just clone this repository into your project directory and start using Claude Code. The hooks activate automatically and begin capturing your conversations immediately, providing instant team coordination insights without any manual configuration, server setup, or additional tooling required!
🚀 Getting Started
npm install codelens-claude-hooksThat's it! The hooks automatically activate and start capturing Claude conversations with zero configuration.
The hooks will start capturing your Claude conversations immediately, feeding data to the CodeLens analytics system for team coordination insights.
🔍 Debugging
- Debug logs:
stop_hook_debug.logshows hook execution - Error logs:
stop_hook_error.logcaptures failures - Session files:
/tmp/claude_session_*for conversation linking - Config file:
~/.claude-code-logger/config.jsonstores user ID
CodeLens transforms individual Claude conversations into team coordination intelligence - no manual tracking required! 🚀
