Commit Graph

1243 Commits

Author SHA1 Message Date
Dani cff33ed130 v1.8.1 - Restore prepublishOnly script
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 19:08:04 -04:00
Dani c20a09cfe8 fix: Implement comprehensive memory management and session tracking improvements
- Add automatic DataCache cleanup with 30-second intervals
- Implement size limit enforcement to prevent memory buildup
- Increase memory threshold to 300MB for realistic analytics usage
- Add Claude session tracking integration throughout dashboard
- Fix message counting to respect actual Claude session windows
- Stabilize conversation state transitions with extended time intervals
- Add comprehensive token breakdown with cache tokens
- Implement Claude session popover with hover functionality
- Fix table layout stability with fixed column widths
- Reduce cache size limits from 1000 to 100 entries
- Add proper cleanup methods for graceful shutdown

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 19:04:01 -04:00
Dani c33b61bb18 feat: Enhance analytics dashboard with comprehensive token tracking and improved conversation history
- Fix token calculation discrepancy by including cache tokens in main dashboard
- Add detailed token breakdown popover with hover functionality
- Improve conversation history loading with comprehensive message metadata
- Fix message coloring logic using JSON metadata instead of content parsing
- Add version number integration to dashboard
- Enhance SessionTimer with info icon and message calculation tooltip
- Move notifications button to filter row for better UX
- Add comprehensive token usage tracking (input, output, cache creation, cache read)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 19:04:01 -04:00
Dani 8e23f08d6d Add unit tests for StateCalculator, StateService, and WebSocketServer
- Implement comprehensive unit tests for StateCalculator to validate conversation status detection and state management.
- Create unit tests for StateService covering state management, subscriber notifications, and error handling.
- Develop unit tests for WebSocketServer to ensure proper handling of WebSocket connections, message broadcasting, and heartbeat mechanisms.
- Include edge case handling and validation for all components to enhance robustness and reliability.
2025-07-15 19:04:01 -04:00
Dani 72bcfe441f feat: Implement complete modular architecture (Phases 1-3)
## Phase 1: Backend Modularization ✅
- Extract StateCalculator class with conversation state logic
- Extract ProcessDetector class for Claude process detection
- Extract ConversationAnalyzer class for data analysis
- Extract FileWatcher class for file system monitoring
- Create DataCache class with multi-level caching strategy
- Integrate dependency injection throughout backend

## Phase 2: Frontend Modularization ✅
- Create modular component architecture:
  - Dashboard: Main orchestrator component
  - ConversationTable: Interactive table with filters/pagination
  - Charts: Chart.js integration and management
- Implement service layer:
  - DataService: API communication with intelligent caching
  - StateService: Reactive state management with subscriptions
  - WebSocketService: Real-time communication client
- Replace monolithic 2000+ line HTML with clean modular structure
- Add main.js application bootstrap with error handling

## Phase 3: WebSocket Integration ✅
- Create WebSocketServer for real-time server communication
- Implement NotificationManager for coordinated notifications
- Add real-time conversation state change detection
- Replace polling with WebSocket updates + fallback mechanisms
- Add automatic reconnection and heartbeat mechanisms

## Key Improvements:
- **Maintainability**: 3000+ line monolith → ~20 focused modules (100-200 lines each)
- **Performance**: Smart caching, real-time updates, optimized data flow
- **Scalability**: Clean separation of concerns, dependency injection
- **Developer Experience**: Hot-reloadable modules, clear APIs, error boundaries
- **User Experience**: Real-time updates, offline fallback, loading states

## Architecture:
```
Backend: analytics/
├── core/ (StateCalculator, ProcessDetector, ConversationAnalyzer, FileWatcher)
├── data/ (DataCache)
└── notifications/ (WebSocketServer, NotificationManager)

Frontend: analytics-web/
├── components/ (Dashboard, ConversationTable, Charts)
├── services/ (DataService, StateService, WebSocketService)
└── assets/js/ (main.js bootstrap)
```

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 19:04:01 -04:00
Dani d51a565a2a perf: Optimize conversation state detection with ultra-fast refresh and improved logic
- Implement 500ms refresh rate for near real-time updates
- Add 250ms fast refresh for first 30 seconds for instant state changes
- Prioritize conversation flow over file timestamps for immediate response detection
- Improve "Claude Code working..." detection to trigger instantly when user sends message
- Extend file activity detection window to 15 seconds for better accuracy
- Create dedicated npm README for better package discoverability
- Update root README to highlight new notification and state detection features
- Remove debug console logs for cleaner production experience

Performance improvements result in near-instantaneous state change detection.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 19:04:01 -04:00
Daniel Avila 8d77b3abb6 Update README.md 2025-07-14 21:48:26 -04:00
Dani 3dbeaec2e0 feat: Enhance analytics dashboard with real-time conversation state detection
- Implement real-time conversation state updates with 1-second refresh
- Add precise state detection: "Claude Code working...", "User typing...", "Awaiting user input..."
- Separate refresh logic: manual for charts, automatic for conversation data
- Integrate active process detection for accurate state determination
- Improve notification system for awaiting user input states
- Remove emojis from notification titles and refresh buttons for cleaner interface
- Optimize performance by only refreshing conversation data, not charts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-11 21:42:29 -04:00
Dani 96be4c8603 feat: Update version numbers and implement notification system for conversation state changes 2025-07-11 21:15:37 -04:00
Dani 68314d0558 style: Remove emojis from dashboard buttons for cleaner interface
- Remove emojis from notification and refresh buttons
- Clean, professional button text appearance
- Maintain all functionality while improving visual clarity
- Better accessibility and readability

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-11 20:31:44 -04:00
Dani 966fddcd28 feat: Add browser notifications for Claude Code analytics dashboard
- Implement browser notification API integration
- Add notification button to enable/disable alerts
- Detect conversation state changes (Awaiting user input...)
- Send notifications when Claude is waiting for user response
- Include clickable notifications that focus the conversation
- Auto-close notifications after 10 seconds
- Visual button states (enabled/disabled/denied)
- Test notification on first enable
- Improve productivity by alerting users when Claude needs input

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-11 20:27:46 -04:00
Dani 05c4307cf7 fix: Update CodeGPT API key and increment package version to 1.6.3 2025-07-11 12:42:04 -04:00
Dani 9b459fab35 docs: Update README to reflect new interactive welcome screen
- Update Quick Start section to show interactive welcome screen
- Explain that Analytics Dashboard is now the default option
- Show clear visual example of the selection interface
- Update Analytics Dashboard section to highlight default status
- Improve user onboarding documentation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-11 12:36:32 -04:00
Dani 713135545d feat: Set Analytics Dashboard as default selection in welcome screen
- Change default selection from 'setup' to 'analytics'
- Promote analytics dashboard usage as primary feature
- Users can still easily select Project Setup if needed
- Improves discoverability of monitoring capabilities

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-11 12:29:26 -04:00
Dani a93a86634f fix: Remove automatic help display that interfered with interactive welcome
- Remove automatic help output when no arguments provided
- Allow interactive welcome screen to show cleanly
- Users can still access help with --help flag
- Fixes clean onboarding experience

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-11 12:26:55 -04:00
Dani c1299c7570 feat: Add interactive welcome screen with choice between analytics and setup
- Add initial prompt to choose between Analytics Dashboard or Project Setup
- Show clear descriptions for each option with emojis
- Only show prompt when no specific CLI flags are provided
- Maintain existing behavior for users with flags (--yes, --language, etc.)
- Improve onboarding experience for new users

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-11 12:23:03 -04:00
Dani ab05eb5cc2 fix: Correct image placement in Quick Start section of README 2025-07-11 10:22:50 -04:00
Dani 1310a9203a Merge remote-tracking branch 'origin/main' 2025-07-11 10:21:41 -04:00
Dani 22483bccc9 docs: Update README with quick start instructions for analytics dashboard and refine setup section 2025-07-11 10:08:44 -04:00
Daniel Avila 71b24b0feb Update README.md 2025-07-11 10:01:42 -04:00
Dani a08d617b27 feat: Add GitHub stars badge and star history chart to README
- Add GitHub stars badge with social style to main badges section
- Add star history chart with dark/light theme support at end of README
- Improve project visibility and community engagement
- Reorder badges for better visual flow

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-11 09:57:05 -04:00
Dani 4bde102a69 docs: Enhance README and analytics dashboard with chart controls and date filtering 2025-07-11 09:44:49 -04:00
Dani 83868f8ccb docs: Update README to refine core features section and enhance command usage instructions 2025-07-10 22:25:20 -04:00
Dani 3bac9f53d4 docs: Enhance README with detailed quick start instructions and core features overview 2025-07-10 22:22:17 -04:00
Dani 897bc750ee docs: Update README to enhance quick start instructions and clarify analytics dashboard usage 2025-07-10 22:13:44 -04:00
Dani 8a470e4cea docs: Enhance README with detailed features and real-time analytics dashboard information 2025-07-10 22:06:19 -04:00
Daniel Avila d0c1f0799e Update README.md 2025-07-10 21:57:54 -04:00
Dani d7c1191c02 chore: Update version to 1.5.18 and sync web dashboard
- Bump version to 1.5.18
- Sync web dashboard HTML with latest analytics improvements
- Add process indicators and orphan process handling UI elements

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 21:55:52 -04:00
Dani 2c6cac07d1 fix: Improve analytics dashboard conversation detection and filtering
- Refine conversation status detection to reduce false positives
- Filter out system processes and orphan process noise
- Balance active conversation detection for better accuracy
- Only show truly active conversations in dashboard
- Remove orphan process detection to reduce UI clutter

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 21:55:04 -04:00
Dani 8abb8d5a4b Refactor analytics module: rename totalSessions to totalConversations, enhance token usage calculations, and improve project and conversation handling. Add model info extraction and update web dashboard to reflect changes in terminology and data structure. 2025-07-10 20:31:41 -04:00
Dani 0974d13b23 chore: update version to 1.5.14 and enhance web dashboard styling and functionality
- Bump version in package.json from 1.5.12 to 1.5.14.
- Add CSS styles for improved layout and status indicators in the web dashboard.
- Introduce a new message type indicator for user and assistant messages with tooltips.
- Implement logic to determine message types (success, error, tool execution, pending) based on message content.
- Refactor message rendering to include message type indicators.
2025-07-10 16:58:29 -04:00
Dani b5123393ee feat: Add analytics option to onboarding prompts and handle dashboard launch
- Updated onboarding prompts to include an option for launching the Claude Code Analytics Dashboard.
- Modified the createClaudeConfig function to handle the analytics option and initiate the dashboard if selected by the user.
2025-07-10 16:41:38 -04:00
Dani d6a8d25b5a feat: Add real-time analytics dashboard for monitoring Claude Code usage 2025-07-10 15:13:55 -04:00
Dani 1e583c9a07 feat: Add short command aliases for easier CLI usage 2025-07-10 14:39:42 -04:00
Dani 48aa5ccb53 feat: Support singular and plural options for command, hook, and MCP stats analysis 2025-07-10 14:28:43 -04:00
Dani b1caacf39d feat: Add MCP server analysis functionality with --mcp-stats command 2025-07-10 14:19:58 -04:00
Dani 96becc83b6 feat: Add security policy document and reporting guidelines for vulnerabilities 2025-07-10 14:08:40 -04:00
Dani fb665bb4f5 feat: Add Code of Conduct and update contributing guidelines to ensure a respectful community 2025-07-10 13:09:48 -04:00
Dani ca922ebbdf feat: Add hook analysis functionality with --hook-stats command and update settings 2025-07-10 13:01:26 -04:00
Dani 3bcc595287 chore: remove README.md and update package versions to 1.4.3 2025-07-09 19:34:41 -04:00
Dani c2d53ebd01 feat: Improve table formatting in --command-stats with dynamic columns and separators
- Added dynamic column width calculation based on actual command names
- Implemented visual separators (│) between columns for better readability
- Command names are capped at 25 characters with ellipsis truncation
- Responsive table width that adapts to content
- Better alignment and spacing for all columns
- Cleaner, more professional table appearance
- Fixes deformed tables when command names are long

Example improvement:
Before: command-name-is-very-long1.2KB  25    180   350    7/9/2025
After:  command-name-is-very-l... │ 1.2KB  │ 25    │ 180   │ 350           │ 7/9/2025

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 17:18:15 -04:00
Dani c0f7b921c8 feat: Improve --command-stats with 'Tokens (aprox)' and setup prompt when no commands
- Changed 'Tokens' column header to 'Tokens (aprox)' for clarity
- Added promptSetupWhenNoCommands() function to offer setup when no commands exist
- Updated table width to accommodate longer header (97 characters)
- When no .claude/commands directory is found, offers to start Claude Code Templates setup
- Improved user experience by providing clear next steps
- Returns appropriate boolean values from displayCommandStats for flow control
- Seamless integration between command analysis and initial setup

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 17:09:37 -04:00
Dani 10eb5ef7f4 feat: Add token count column to --command-stats table
- Added estimateTokens() function for token estimation based on content analysis
- Considers markdown formatting, code blocks, and text complexity
- New 'Tokens' column in command analysis table with magenta color
- Updated table width and formatting to accommodate token data
- Shows total token count in summary (e.g., '~3,833 tokens total')
- Helps users understand command complexity in terms of Claude token usage
- Essential for managing prompt lengths and optimization decisions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 16:47:17 -04:00
Dani 91edf25760 feat: Add --command-stats functionality for command analysis and optimization
- Added --command-stats CLI option to analyze existing Claude Code commands
- Created command-stats.js module with comprehensive analysis functions
- Displays command statistics in formatted table (name, size, lines, words, last modified)
- Calculates totals and provides project overview
- Interactive prompt for command optimization using Claude Code
- Generates intelligent optimization prompts based on project structure
- Integrates with existing CLI workflow and error handling
- Helps users optimize their .claude/commands for their specific project setup

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 16:43:21 -04:00
Dani 3edd714383 chore: Bump version to 1.3.10 2025-07-09 16:30:24 -04:00
Dani cabf65d513 cleanup: Remove all duplicate language directories and fix nested structure
- Removed duplicate language directories from repository root (common/, go/, javascript-typescript/, python/, rust/)
- Fixed nested cli-tool/cli-tool/ directory structure
- All templates now centralized in cli-tool/templates/ (single source of truth)
- Clean repository structure with no duplication
- CLI functionality verified and working correctly

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 16:19:40 -04:00
Dani 14109069b2 refactor: Unify templates directory structure to eliminate duplication
- Removed duplicate /templates/ directory from repository root
- All templates now centralized in /cli-tool/templates/
- Updated README.md to reflect new structure
- Updated manual installation instructions
- Eliminates code duplication and sync issues
- Maintains full functionality while reducing maintenance overhead

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 14:53:54 -04:00
Dani 8e9bbbfa25 fix: Update version to 1.3.8 in package.json and package-lock.json 2025-07-08 19:03:57 -04:00
Dani 837651c033 feat: Enhance post-installation validation to analyze current project structure
- Updated validation prompt to include project structure analysis
- Claude now examines package.json, src/, and other project files
- Provides project-specific recommendations based on actual dependencies
- Compares installed configuration with real project setup
- Makes more targeted suggestions for improvement

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-08 12:39:28 -04:00
Dani e1aec514cd fix: Resolve post-installation validation command execution issue
- Fixed spawn command to properly execute 'claude "prompt"' format
- Changed from spawn('claude', [prompt]) to spawn('sh', ['-c', claudeCommand])
- Now correctly passes validation prompt to Claude Code CLI
- Post-installation validation now works as intended

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-08 11:04:09 -04:00