claude-code-tracker/README.md

117 lines
3.1 KiB
Markdown
Raw Normal View History

# Claude Code Hook Configurations
This directory contains various pre-configured hook setups for different use cases:
## Available Configurations
### basic.json
Essential hooks for basic session and tool tracking.
- Session management
- Tool calls
- File modifications
- Conversations
### comprehensive.json
Complete hook setup with all available hook types.
- All performance monitoring
- Code quality tracking
- Learning analytics
- Collaboration insights
- Project intelligence
### essential.json
Minimal setup for core functionality.
### developer.json
Focused on development workflow and code quality.
- Essential hooks
- Performance monitoring
- Code quality checks
### power_user.json
Advanced setup for productivity optimization.
- Essential hooks
- Performance tracking
- Workflow analysis
- Project intelligence
### research.json
Optimized for learning and exploration.
- Essential hooks
- Learning tracking
- External resource usage
- Knowledge gap analysis
### team.json
Team-focused configuration for collaboration.
- Essential hooks
- Collaboration tracking
- Testing workflows
- Project intelligence
## Installation
1. Choose the configuration that matches your needs
2. Copy the JSON content to your Claude Code settings file:
- macOS/Linux: `~/.config/claude/settings.json`
- Windows: `%APPDATA%\claude\settings.json`
3. Ensure Claude Code Tracker is running on port 8000
4. Start using Claude Code - hooks will automatically track your activity!
## Available Hook Variables
Each hook can use these variables that Claude Code provides:
### Session Variables
- `$SESSION_ID` - Current session identifier
- `$TIMESTAMP` - Current timestamp (ISO format)
- `$PWD` - Current working directory
- `$USER` - System username
### Tool Variables
- `$TOOL_NAME` - Name of tool being called
- `$TOOL_PARAMS` - Tool parameters (JSON)
- `$RESULT_STATUS` - Success/error status
- `$EXECUTION_TIME` - Tool execution time (ms)
- `$ERROR_TYPE` - Type of error
- `$ERROR_MESSAGE` - Error message
- `$STACK_TRACE` - Error stack trace
### File Variables
- `$FILE_PATH` - Path to modified file
- `$ACTION` - File action (created/modified/deleted)
- `$FILE_SIZE_MB` - File size in megabytes
### Context Variables
- `$CONTENT` - Conversation content
- `$CONTEXT` - Current context description
- `$SEARCH_QUERY` - What you're searching for
- `$NEW_PROJECT` - Project being switched to
- `$OLD_PROJECT` - Project being switched from
### Performance Variables
- `$MEMORY_MB` - Memory usage in MB
- `$DURATION_MS` - Duration in milliseconds
- `$THRESHOLD_EXCEEDED` - Boolean for threshold alerts
And many more! Each hook type has specific variables available.
## Customization
You can modify any configuration by:
1. Adding/removing specific hooks
2. Changing API endpoints or ports
3. Adjusting timeout and retry settings
4. Adding custom metadata to hook calls
## Troubleshooting
If hooks aren't working:
1. Ensure Claude Code Tracker server is running
2. Check that curl is installed
3. Verify the API endpoints are accessible
4. Check Claude Code logs for hook execution errors
5. Test individual hooks manually with curl
For more help, see the documentation at `/dashboard/docs/hook-setup`.