@lexnguyen/claude-reporter-setup
v1.0.2
Published
Auto-install reporter for Claude Code CLI - Track every session automatically
Maintainers
Readme
🚀 Claude Code Auto Reporter
Tự động track mọi Claude Code session. Cài 1 lần, dùng mãi mãi.
⚡ Quick Start
npx claude-reporter-setupXong! Mở terminal mới, dùng claude như bình thường.
→ Mọi session tự động được lưu. Zero effort. Zero maintenance.
✨ Features
Multiple Storage Options
- 📁 Google Drive - Auto-upload reports to your Google Drive
- 🌐 Webhook/HTTP - Send to any custom endpoint
- 💾 Local Storage - Keep everything on your machine
- 🏢 Enterprise - Contact sales for advanced integrations
Auto-Tracking
- ✅ Mọi
claudecommand được track - ✅ Bắt Ctrl+C, kill, crash
- ✅ Lưu full logs
- ✅ SQLite database
Reporting
- ✅ Multiple destinations (Drive, Webhook, Local)
- ✅ Discord notifications
- ✅ JSON format
- ✅ Realtime streaming
Configuration
- ✅ Interactive setup wizard
- ✅ Multiple storage backends
- ✅ Easy switching between backends
- ✅ Helper scripts
📦 Installation
Cách 1: NPX (Recommended)
npx claude-reporter-setupCách 2: Global Install
npm install -g claude-reporter-setup
claude-reporter-setupCách 3: Manual
git clone https://github.com/yourusername/claude-reporter-setup.git
cd claude-reporter-setup
npm install
node bin/setup.js🐛 Troubleshooting
"command not found: claude"
→ Mở terminal MỚI! (Cmd+T hoặc Ctrl+Shift+T)
Hoặc reload:
source ~/.zshrc # or ~/.bashrcMore issues?
📖 Full guide: TROUBLESHOOTING.md
Common fixes:
- Open NEW terminal window
- Run
source ~/.zshrcorsource ~/.bashrc - Check
which claude - Re-run setup:
npx claude-reporter-setup
🎯 Usage
Dùng Claude bình thường
# Reload shell
source ~/.bashrc # hoặc ~/.zshrc
# Dùng Claude như thường lệ
claude chat
claude code fix-bug.py
claude ask "explain this code"
# Mọi thứ tự động được track!Xem lịch sử sessions
# Xem 20 sessions gần nhất
claude --view
# Xem config
claude --config
# Xem thống kê
claude --statsXem reports
# Mở thư mục reports
cd ~/.claude-reporter/reports
ls -lt
# Hoặc dùng script helper
~/.claude-reporter/view-reports.sh⚙️ Configuration
Storage Options
Claude Reporter hỗ trợ nhiều storage backends:
1. Google Drive (Recommended)
Tự động upload reports lên Google Drive của bạn:
# Chọn Google Drive khi setup
npx claude-reporter-setup
# Hoặc switch sau này
~/.claude-reporter/switch-storage.sh📖 Chi tiết: GDRIVE_SETUP.md
2. Webhook/HTTP
Gửi reports đến custom endpoint:
# Setup webhook
~/.claude-reporter/switch-storage.sh
# Chọn option 2
# Hoặc edit config
nano ~/.claude-reporter/config.jsonTest với webhook.site:
- Truy cập https://webhook.site
- Copy unique URL
- Paste vào config
3. Local Storage
Chỉ lưu local, không gửi đi đâu:
~/.claude-reporter/switch-storage.sh
# Chọn option 3Reports lưu tại: ~/.claude-reporter/reports/
4. Enterprise
Cần custom integration (Slack, Teams, Jira)?
📧 Contact: [email protected]
Setup Webhook
- Truy cập https://webhook.site
- Copy URL duy nhất của bạn
- Update config:
cd ~/.claude-reporter
./update-webhook.shManual Config
Edit file: ~/.claude-reporter/config.json
{
"report_endpoint": "https://webhook.site/your-unique-url",
"discord_webhook": "https://discord.com/api/webhooks/...",
"auto_report": true,
"save_local": true,
"log_commands": true
}Discord Webhook Setup
- Vào Discord Server Settings → Integrations → Webhooks
- Create Webhook
- Copy Webhook URL
- Paste vào
discord_webhooktrong config
📊 Report Format
Reports được gửi dưng dạng JSON:
{
"session_id": "550e8400-e29b-41d4-a716-446655440000",
"started_at": "2025-01-15T10:30:00",
"ended_at": "2025-01-15T10:45:00",
"status": "completed",
"working_dir": "/home/user/project",
"command": "claude chat",
"log_preview": "...",
"exit_code": 0,
"timestamp": "2025-01-15T10:45:00"
}Status values:
completed- Session kết thúc bình thườnginterrupted- User nhấn Ctrl+Cerror- Có lỗi xảy ra
🗂️ File Structure
~/.claude-reporter/
├── config.json # Configuration
├── sessions.db # SQLite database
├── claude-reporter.py # Main script
├── reports/ # JSON reports
├── logs/ # Session logs
├── backups/ # Backups
├── view-reports.sh # Helper script
└── update-webhook.sh # Helper script🔧 Advanced Usage
Custom Webhook Handler
Bạn có thể tự host webhook endpoint:
// Express.js example
app.post('/claude-report', (req, res) => {
const report = req.body;
// Save to database
db.reports.insert(report);
// Send notification
if (report.status === 'error') {
sendSlackAlert(report);
}
res.json({ received: true });
});Query Database
sqlite3 ~/.claude-reporter/sessions.db-- Xem tất cả sessions
SELECT * FROM sessions ORDER BY started_at DESC LIMIT 10;
-- Sessions có lỗi
SELECT * FROM sessions WHERE status = 'error';
-- Thống kê theo ngày
SELECT DATE(started_at), COUNT(*)
FROM sessions
GROUP BY DATE(started_at);🐛 Troubleshooting
"Claude not found"
# Check Claude CLI installation
which claude
# Install Claude CLI
# Visit: https://docs.anthropic.com/claude-codeReports không gửi được
# Check config
claude --config
# Test webhook manually
curl -X POST your-webhook-url \
-H "Content-Type: application/json" \
-d '{"test": true}'Permission denied
chmod +x ~/.claude-reporter/claude-reporter.py
chmod +x ~/.claude-reporter/*.sh📝 Example Workflows
Workflow 1: Track team activity
# Setup webhook pointing to team dashboard
# Everyone on team runs: npx claude-reporter-setup
# All Claude sessions auto-reported to central dashboardWorkflow 2: Personal analytics
# Use webhook.site for quick viewing
# Or setup local server to analyze patterns
# View stats: claude --statsWorkflow 3: CI/CD integration
# In CI pipeline
npx claude-reporter-setup --ci
claude code --review pr-123
# Report sent to build system🤝 Contributing
Contributions welcome! Please:
- Fork repo
- Create feature branch
- Make changes
- Test thoroughly
- Submit PR
📄 License
MIT License - feel free to use anywhere!
🔗 Links
💬 Support
- GitHub Issues: Report bugs
- Discord: Join community
- Email: [email protected]
🎉 Credits
Made with ❤️ for the Claude community
Happy coding with Claude! 🚀
