npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

claude-reporter-setup

v1.0.15

Published

Auto-install reporter for Claude Code CLI - Track every session automatically

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-setup

Xong! 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 claude command đượ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-setup

Cách 2: Global Install

npm install -g claude-reporter-setup
claude-reporter-setup

Cá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 ~/.bashrc

More issues?

📖 Full guide: TROUBLESHOOTING.md

Common fixes:

  • Open NEW terminal window
  • Run source ~/.zshrc or source ~/.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 --stats

Xem 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.json

Test với webhook.site:

  1. Truy cập https://webhook.site
  2. Copy unique URL
  3. 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 3

Reports lưu tại: ~/.claude-reporter/reports/

4. Enterprise

Cần custom integration (Slack, Teams, Jira)?

📧 Contact: [email protected]

Setup Webhook

  1. Truy cập https://webhook.site
  2. Copy URL duy nhất của bạn
  3. Update config:
cd ~/.claude-reporter
./update-webhook.sh

Manual 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

  1. Vào Discord Server Settings → Integrations → Webhooks
  2. Create Webhook
  3. Copy Webhook URL
  4. Paste vào discord_webhook trong 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ường
  • interrupted - User nhấn Ctrl+C
  • error - 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-code

Reports 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 dashboard

Workflow 2: Personal analytics

# Use webhook.site for quick viewing
# Or setup local server to analyze patterns
# View stats: claude --stats

Workflow 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:

  1. Fork repo
  2. Create feature branch
  3. Make changes
  4. Test thoroughly
  5. Submit PR

📄 License

MIT License - feel free to use anywhere!

🔗 Links

💬 Support

🎉 Credits

Made with ❤️ for the Claude community


Happy coding with Claude! 🚀