Hook orchestration system for AI agents with SQLite logging and powerful analytics
Project description
๐ Eyelet - Hook Orchestration for AI Agents
"Thread through the eyelet!" - A sophisticated hook management system for AI agent workflows
๐ New in v0.3.0: SQLite Logging!
Eyelet now supports SQLite database logging! Choose between JSON files, SQLite database, or both:
# Enable SQLite logging
uvx eyelet configure logging --format sqlite
# Use both JSON and SQLite
uvx eyelet configure logging --format json,sqlite
# Query your hook data
uvx eyelet query search --text "error"
uvx eyelet query summary --last 24h
๐ฆ About
Eyelet provides comprehensive management, templating, and execution handling for AI agent hooks. Like an eyelet that securely connects hooks to fabric, Eyelet connects and orchestrates your AI agent's behavior through a reliable workflow system.
โจ Features
- ๐ช Universal Hook Support - Captures all Claude Code hook types โ
- ๐พ Flexible Logging - JSON files, SQLite database, or both โ
- ๐ Powerful Queries - Search, filter, and analyze your hook data โ
- ๐ฅ Health Monitoring -
eyelet doctorchecks your configuration โ - ๐ Zero Config -
eyelet configure install-allsets up everything โ - ๐ Rich Analytics - Session summaries, error analysis, and more โ
- ๐ง Git Integration - Automatic Git metadata enrichment โ
- โก High Performance - SQLite with WAL mode for concurrent access โ
๐ Quick Start
# Install universal logging for ALL hooks (one command!)
uvx eyelet configure install-all
# Enable SQLite logging for better performance
uvx eyelet configure logging --format sqlite
# Check your configuration health
uvx eyelet doctor
# Query your hook data
uvx eyelet query summary # Session overview
uvx eyelet query search --help # Search options
uvx eyelet query errors # Debug issues
๐ฏ Universal Hook Handler
Eyelet includes a powerful universal hook handler that logs EVERY Claude Code hook to a structured directory:
# Install logging for all hooks with one command
uvx eyelet configure install-all
# Your hooks will be logged to:
./eyelet-hooks/
โโโ PreToolUse/
โ โโโ Bash/2025-07-28/
โ โโโ 20250728_133300_236408_PreToolUse_Bash.json
โโโ PostToolUse/
โ โโโ Read/2025-07-28/
โโโ UserPromptSubmit/2025-07-28/
โโโ Stop/2025-07-28/
โโโ PreCompact/manual/2025-07-28/
Each log contains:
- Complete input data from Claude Code
- Environment variables and context
- Timestamps (ISO and Unix)
- Session information
- Tool inputs/outputs
- Python version and platform details
๐ฏ Features
- Dynamic Hook Discovery - Automatically detects new tools and generates all valid hook combinations โ
- Beautiful TUI - Navigate with a Textual-powered interface for reliable connections โ
- Template System - Deploy pre-configured hook patterns with a single command โ
- Workflow Engine - Chain complex behaviors with conditional logic โ (Not implemented - raises NotImplementedError)
- Comprehensive Logging - Track every hook execution in SQLite or filesystem โ
- AI Integration - Native Claude Code SDK support for intelligent workflows โ
- Real-time Monitoring - Watch hook executions as they happen โ
(via
eyelet logs --follow)
๐ Documentation
๐ ๏ธ Commands
# Core Operations
uvx eyelet configure # Configure hooks โ
uvx eyelet configure logging # Manage logging settings (JSON/SQLite) โ
uvx eyelet execute # Run as hook endpoint โ
uvx eyelet logs # View JSON execution logs โ
uvx eyelet doctor # Health check and diagnostics โ
# Query & Analytics (SQLite)
uvx eyelet query search # Full-text search with filters โ
uvx eyelet query summary # Session and hook statistics โ
uvx eyelet query errors # Error analysis and debugging โ
uvx eyelet query session # View specific session logs โ
uvx eyelet query grep # Pattern matching across logs โ
# Discovery & Templates
uvx eyelet discover # Find available hooks โ
uvx eyelet template list # Browse templates โ
uvx eyelet template install # Deploy a template โ
๐พ SQLite Logging
Eyelet's SQLite logging provides powerful analytics and querying capabilities:
# Enable SQLite logging
uvx eyelet configure logging --format sqlite
# Search for specific patterns
uvx eyelet query search --text "error" --tool Bash --last 1h
# Get session summary
uvx eyelet query summary --format json
# Analyze errors
uvx eyelet query errors --last 24h
# Export specific session
uvx eyelet query session <session-id> --format json > session.json
Why SQLite?
- โก Fast queries across millions of hooks
- ๐ Full-text search with advanced filters
- ๐ Analytics without external dependencies
- ๐ Concurrent access with WAL mode
- ๐พ Compact storage compared to JSON files
๐จ Example Hook Configuration
{
"hooks": [{
"type": "PreToolUse",
"matcher": "Bash",
"handler": {
"type": "command",
"command": "uvx eyelet execute --log-only"
}
}]
}
๐ JSON Validation & Linting
Eyelet provides built-in validation for Claude settings files and VS Code integration:
# Validate your Claude settings
uvx eyelet validate settings
# Validate a specific file
uvx eyelet validate settings ~/.claude/settings.json
VS Code Integration
The project includes a JSON schema for Claude settings files. VS Code users get:
- โ IntelliSense/autocomplete for hook configurations โ ๏ธ (Schema exists but no .vscode/settings.json in project)
- โ Real-time error detection โ ๏ธ (Schema exists but VS Code config not set up)
- โ Hover documentation โ ๏ธ (Schema exists but VS Code config not set up)
See docs/vscode-json-linting.md for setup instructions.
๐ Connection Philosophy
Eyelet embraces hardware connection terminology for reliable, secure attachment:
- "Thread through the eyelet!" - Launch the TUI
- "Secure the connection!" - Deploy templates
- "Check the connection log" - View logs
- "Scan for connection points" - Discover new hooks
- "Hold fast!" - Maintain current configuration
๐งช Testing
Eyelet includes comprehensive testing tools to ensure your hooks are working correctly:
Testing Hook Integration
# Run the interactive hook test
mise run test-hooks
# This will generate a unique test ID and guide you through testing all tools
# After running the test commands, verify with:
mise run test-hooks-verify zebra-1234-flamingo-5678
# View hook statistics
mise run hook-stats
# Generate a coverage report
mise run hook-coverage
# Clean old logs (older than 7 days)
mise run hook-clean
Development Testing
# Run all tests
mise run test
# Run linting
mise run lint
# Run type checking
mise run typecheck
# Run all CI checks
mise run ci
Manual Hook Testing
The test_all_hooks.py script provides comprehensive hook testing:
- Generates unique test identifiers for tracking
- Tests all Claude Code tools (Bash, Read, Write, Edit, etc.)
- Verifies hook logs contain expected data
- Provides coverage reports
๐ค Contributing
We welcome contributions! Please open issues and pull requests on GitHub.
๐ Documentation
- Quickstart Guide - Get up and running quickly
- Design Documents - Architecture and design decisions
- Setup Guides - GitHub Actions and deployment setup
๐ License
MIT License - see LICENSE for details.
๐ Acknowledgments
Built with love for the AI development community. Special thanks to the Anthropic team for Claude Code and its powerful hook system.
"The strongest connections are forged under pressure." - Connect with Eyelet and explore the possibilities of AI agent orchestration.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eyelet-0.3.2.tar.gz.
File metadata
- Download URL: eyelet-0.3.2.tar.gz
- Upload date:
- Size: 120.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
153b3a3441b513128b73e4797409ef2c82d8c0df335f9439b96c936b9f27bad7
|
|
| MD5 |
23898589765928f633127550dd9ecdaa
|
|
| BLAKE2b-256 |
678d26b504cd88a726017899925d621a4edff817aa5a719b7b668a18e31bb8de
|
File details
Details for the file eyelet-0.3.2-py3-none-any.whl.
File metadata
- Download URL: eyelet-0.3.2-py3-none-any.whl
- Upload date:
- Size: 79.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2ec44feaa467d0e165a1fd05e2d1b935341ee17ee238c6edfb1337c6e4d1006
|
|
| MD5 |
ae533e61761ab9dfe72fedb79f26aaa1
|
|
| BLAKE2b-256 |
d0ad7f0830c520f08588fc3168e011a64961c99829d674d2f19db928d4978cdf
|