A comprehensive Java application that analyzes Claude CLI code generation sessions and produces detailed Excel reports. This tool helps developers track their productivity, understand their coding patterns, and generate professional reports from Claude CLI transcript data.
- Comprehensive Analysis: Analyzes Claude CLI session transcripts (.jsonl files)
- Multi-format Output: Generates detailed Excel reports with 5 different sheets
- Language Detection: Supports 40+ programming languages with intelligent detection
- Flexible Date Filtering: Analyze specific dates, date ranges, or all sessions
- Professional Console Output: Colored terminal output with progress indicators
- Code Metrics: Line counting, language distribution, and productivity statistics
- Standalone JAR: No external dependencies required for execution
- Java 17 or higher
- Maven 3.6+ (for building from source)
This application is fully cross-platform and supports:
- Windows (Windows 10/11, Windows Server)
- macOS (Intel and Apple Silicon)
- Linux (Ubuntu, Fedora, CentOS, Debian, etc.)
- Smart color detection: Automatically detects terminal color support
- Unicode symbols: Falls back to ASCII symbols on legacy systems
- Path handling: Uses Java NIO for platform-independent file operations
- Build scripts: Includes both
build.sh(Unix/Linux/macOS) andbuild.bat(Windows)
- Download the latest
claude-analyzer-1.0.0.jarfrom releases - Run with default settings:
java -jar claude-analyzer-1.0.0.jar
Windows:
build.batUnix/Linux/macOS:
./build.sh# Clone the repository
git clone <repository-url>
cd claude-analyzer
# Build the project
mvn clean package
# Run the application
java -jar target/claude-analyzer-1.0.0.jarUsage: java -jar claude-analyzer.jar [options] [date]
Options:
--help, -h Show help message and exit
--version, -v Show version information and exit
--yesterday Analyze yesterday's sessions
--week Analyze this week's sessions (Monday to today)
--month Analyze this month's sessions (1st to today)
--all Analyze all available sessions
--projects-dir DIR Path to Claude projects directory
(default: ~/.claude/projects)
--output FILE, -o Output Excel file path
(default: ~/claude_analysis_report_YYYYMMDD_HHMMSS.xlsx)
--no-color Disable colored console output
Arguments:
[DATE] Analyze specific date in YYYY-MM-DD format
(default: today)
# Analyze today's sessions (default behavior)
java -jar claude-analyzer.jar
# Show help information
java -jar claude-analyzer.jar --help
# Show version information
java -jar claude-analyzer.jar --version# Analyze a specific date
java -jar claude-analyzer.jar 2025-08-18
# Analyze yesterday's sessions
java -jar claude-analyzer.jar --yesterday
# Analyze this week's sessions (Monday to today)
java -jar claude-analyzer.jar --week
# Analyze this month's sessions (1st of month to today)
java -jar claude-analyzer.jar --month
# Analyze all available sessions (complete history)
java -jar claude-analyzer.jar --all# Save report with custom filename
java -jar claude-analyzer.jar --output my_analysis.xlsx
# Weekly report with custom name
java -jar claude-analyzer.jar --week --output weekly_report.xlsx
# All-time analysis with descriptive filename
java -jar claude-analyzer.jar --all --output complete_history_analysis.xlsx
# Daily report in specific directory
java -jar claude-analyzer.jar --output /path/to/reports/daily_$(date +%Y%m%d).xlsx# Analyze from custom Claude projects directory
java -jar claude-analyzer.jar --projects-dir /custom/path/to/projects
# Combine with other options
java -jar claude-analyzer.jar --all --projects-dir /backup/claude/projects --output backup_analysis.xlsx
# Analyze different user's projects (if accessible)
java -jar claude-analyzer.jar --projects-dir /Users/otheruser/.claude/projects# Disable colored output (for scripts or legacy terminals)
java -jar claude-analyzer.jar --no-color
# Combine with file output
java -jar claude-analyzer.jar --all --no-color --output plain_report.xlsx
# Redirect console output to file
java -jar claude-analyzer.jar --no-color > console_output.txt# Weekly analysis with custom directory and output
java -jar claude-analyzer.jar --week \
--projects-dir /path/to/projects \
--output reports/week_$(date +%Y%U).xlsx \
--no-color
# Specific date with custom settings
java -jar claude-analyzer.jar 2025-08-15 \
--output analysis_20250815.xlsx \
--projects-dir ~/.claude/projects
# All-time analysis for reporting
java -jar claude-analyzer.jar --all \
--output "Complete_Analysis_$(date +%Y%m%d_%H%M%S).xlsx" \
--no-color# Daily automated report (cron job example)
java -jar claude-analyzer.jar --output daily_$(date +%Y%m%d).xlsx
# Weekly report every Monday
java -jar claude-analyzer.jar --week --output weekly_$(date +%Y_W%U).xlsx
# Monthly report on 1st of each month
java -jar claude-analyzer.jar --month --output monthly_$(date +%Y%m).xlsx
# Check specific date with error handling
java -jar claude-analyzer.jar 2025-08-18 || echo "Analysis failed for 2025-08-18"Windows (Command Prompt):
java -jar claude-analyzer.jar --all --output "C:\Reports\analysis.xlsx"
java -jar claude-analyzer.jar --projects-dir "C:\Users\%USERNAME%\.claude\projects"Windows (PowerShell):
java -jar claude-analyzer.jar --output "analysis_$(Get-Date -Format 'yyyyMMdd').xlsx"
java -jar claude-analyzer.jar --week --no-color | Tee-Object weekly_log.txtmacOS/Linux:
java -jar claude-analyzer.jar --output ~/Desktop/analysis_$(date +%Y%m%d).xlsx
java -jar claude-analyzer.jar --all --projects-dir ~/.claude/projectsThe application provides real-time colored console output showing:
π Scanning projects directory: ~/.claude/projects
π Scanning project: my-web-app
β
Session abc123: 45 lines, 3 created, 2 modified
π Scanning project: data-analysis
β
Session def456: 23 lines, 1 created, 0 modified
π EXECUTIVE SUMMARY
ββββββββββββββββββββββββββββββββββββββββββββββββββ
Total Sessions: 2
Total Lines: 68
Total Files: 6
Files Created: 4
Files Modified: 2
Projects Worked On: 2
Avg Session Time: 12.5 minutes
Lines per Session: 34.0
Files per Session: 3.0
Created per Session: 2.0
Modified per Session: 1.0
π€ LANGUAGE BREAKDOWN
ββββββββββββββββββββββββββββββββββββββββββββββββββ
Language Files % of Total
ββββββββββββββββββββββββββββββββββββββββ
Python 2 50.0%
JavaScript 1 25.0%
HTML 1 25.0%
β
Analysis complete! Excel report saved to: claude_analysis_report_20250818_143501.xlsx
The generated Excel workbook contains 5 comprehensive sheets with enhanced file operation tracking:
- Report Type: Daily Analysis, Weekly Analysis, All-Time Analysis, etc.
- Date Range: Specific dates or ranges analyzed
- Executive Metrics:
- Total Sessions, Lines, Files (Created + Modified)
- Files Created vs Files Modified breakdown
- Projects Worked On
- Average session duration and productivity metrics
- Per-session averages for all metrics
Complete session-by-session breakdown with columns:
- Date, Project, Session ID, Duration (minutes)
- Total Lines, Code Lines, Comment Lines, Blank Lines
- Files Created, Files Modified (separate tracking)
- Primary Language, All Languages
Day-by-day activity tracking with columns:
- Date, Sessions, Lines Generated
- Files Created, Files Modified (separate tracking)
Project-level aggregated data with columns:
- Project Name, Sessions, Total Lines, Total Files
- Files Created, Files Modified (separate tracking)
- Top Language, All Languages
Programming language statistics with columns:
- Language, Files, Percentage, Estimated Lines
Default Behavior (Timestamped):
claude_analysis_report_20250818_143501.xlsx- Format:
claude_analysis_report_YYYYMMDD_HHMMSS.xlsx - Prevents overwriting previous reports
Custom Output:
- Use
--output filename.xlsxfor specific names - Supports full paths:
--output /path/to/reports/analysis.xlsx
Report Type Examples:
- Daily:
claude_analysis_report_20250818_143501.xlsx - Weekly: Custom naming recommended:
weekly_2025_W33.xlsx - Monthly: Custom naming recommended:
monthly_202508.xlsx - All-time: Custom naming recommended:
complete_history.xlsx
The analyzer detects 40+ programming languages including:
Web Technologies: JavaScript, TypeScript, React JSX/TSX, Vue.js, Svelte, HTML, CSS, SCSS
Backend Languages: Java, Python, C++, C, C#, PHP, Ruby, Go, Rust, Swift, Kotlin, Scala
Mobile Development: Dart, Objective-C, Swift, Kotlin
Scripting: Shell, Bash, PowerShell, Perl, Lua
Data Formats: JSON, XML, YAML, SQL, CSV
Documentation: Markdown, reStructuredText
Scientific: R, MATLAB
And many more...
================================================================================
Claude CLI Code Generation Analyzer v1.0.0
================================================================================
π Scanning projects directory: /Users/user/.claude/projects
π Scanning project: my-web-app
β
Session abc123: 45 lines, 3 files
π Scanning project: data-analysis
β
Session def456: 23 lines, 1 files
================================================================================
Claude CLI Analysis - Today (2025-08-18)
================================================================================
π EXECUTIVE SUMMARY
ββββββββββββββββββββββββββββββββββββββββββββββββββ
Total Sessions: 2
Total Lines: 68
Total Files: 4
Projects Worked On: 2
Avg Session Time: 12.5 minutes
Lines per Session: 34.0
Files per Session: 2.0
π€ LANGUAGE BREAKDOWN
ββββββββββββββββββββββββββββββββββββββββββββββββββ
Language Files % of Total
ββββββββββββββββββββββββββββββββββββββββ
Python 2 50.0%
JavaScript 1 25.0%
HTML 1 25.0%
β
Analysis complete! Excel report saved to: ~/claude_analysis_report.xlsx
claude-analyzer/
βββ pom.xml # Maven configuration
βββ README.md # This file
βββ src/
β βββ main/
β βββ java/
β β βββ com/claude/analyzer/
β β βββ ClaudeAnalyzer.java # Main class
β β βββ model/ # Data models
β β βββ service/ # Core services
β β βββ util/ # Utility classes
β β βββ export/ # Excel export
β βββ resources/
β βββ META-INF/
β βββ MANIFEST.MF # JAR manifest
βββ target/
βββ claude-analyzer-1.0.0.jar # Built executable
- ClaudeAnalyzer: Main entry point and CLI argument parsing
- ClaudeProjectScanner: Scans and parses Claude CLI transcript files
- LanguageDetector: Intelligent language detection based on file extensions and content
- CodeAnalyzer: Analyzes code content for line counting and metrics
- ExcelExporter: Generates comprehensive Excel reports
- ReportGenerator: Creates formatted console output
- Input: Claude CLI transcript files (.jsonl format)
- Parsing: Extract Write/Edit operations from JSON transcripts
- Analysis: Language detection, line counting, session metrics
- Aggregation: Calculate summaries by date, project, and language
- Output: Console report + Excel workbook
- Projects Directory:
~/.claude/projects - Output File:
~/claude_analysis_report.xlsx
The application respects standard Java system properties and can be configured using JVM arguments:
java -Duser.home=/custom/path -jar claude-analyzer.jarThe application gracefully handles:
- Missing or inaccessible project directories
- Corrupted or malformed JSON transcript files
- Network or file system permissions issues
- Invalid command-line arguments
Warning messages are displayed for skipped files, while the analysis continues with available data.
- Memory Efficient: Streaming JSON parsing for large transcript files
- Fast Processing: Optimized for projects with 1000+ session files
- Large File Support: Handles transcript files up to 100MB+
- Concurrent Processing: Parallel project scanning where possible
Error: "Projects directory does not exist"
- Verify the path to your Claude projects directory
- Use
--projects-dirto specify a custom path
Error: "No sessions found"
- Check that .jsonl transcript files exist in the projects directory
- Verify the date filter matches your session dates
Excel file not generated
- Ensure write permissions in the output directory
- Check available disk space
Enable verbose output by running with debug flags:
java -Xdebug -jar claude-analyzer.jar- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature - Commit changes:
git commit -am 'Add new feature' - Push to the branch:
git push origin feature/new-feature - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Initial release
- Complete Claude CLI transcript analysis
- Excel report generation with 5 sheets
- Support for 40+ programming languages
- Command-line interface with flexible date filtering
- Colored console output
- Standalone JAR distribution
For issues, questions, or feature requests, please open an issue on the GitHub repository.
Built with β€οΈ for the Claude CLI community