mcpbeat Sign in

Cc Analytics Skill for Claude

Use when user asks for Claude Code usage stats, weekly analytics, project activity summary, or wants to see what projects were worked on. Triggers on "аналитика", "статистика claude", "cc stats", "weekly report", "что делал

121k tokens
context cost
the whole folder, loaded on every use
4
files
instructions only
0
copies elsewhere
how many repositories repackaged it
217
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/serejaris/personal-corp-skills --skill cc-analytics

What comes with it

476 135 bytes besides the instruction
README.md
README.ru.md
assets/illustration.png

The instruction itself

8 sections, as written by the author

Claude Code Analytics

Generate HTML report of Claude Code usage from ~/.claude/history.jsonl.

Data Sources

  • History: ~/.claude/history.jsonl — prompts with timestamps and project paths
  • Git: Remote URLs and commit counts per project

Output

Single HTML file with terminal aesthetic:

  • ASCII art header
  • Summary stats (projects, prompts, commits, days)
  • Project table with remote links
  • ASCII bar chart

Generation Script

Run this Python script to generate the report:

import json
import os
import subprocess
from datetime import datetime, timedelta
from collections import defaultdict

def get_git_info(path):
    if not os.path.isdir(path) or not os.path.exists(os.path.join(path, '.git')):
        return None, 0
    try:
        result = subprocess.run(['git', '-C', path, 'remote', 'get-url', 'origin'],
                                capture_output=True, text=True, timeout=5)
        remote = result.stdout.strip() if result.returncode == 0 else None
        if remote:
            remote = remote.replace('[email protected]:', 'github.com/').replace('.git', '').replace('https://', '')

        week_ago = (datetime.now() - timedelta(days=7)).strftime('%Y-%m-%d')
        result = subprocess.run(['git', '-C', path, 'rev-list', '--count', f'--since={week_ago}', 'HEAD'],
                                capture_output=True, text=True, timeout=5)
        commits = int(result.stdout.strip()) if result.returncode == 0 else 0
        return remote, commits
    except:
        return None, 0

# Parse history
history = []
with open(os.path.expanduser('~/.claude/history.jsonl'), 'r') as f:
    for line in f:
        try:
            history.append(json.loads(line))
        except:
            pass

# Filter last N days (default 7)
days = 7
now = datetime.now()
cutoff = (now - timedelta(days=days)).timestamp() * 1000

projects = defaultdict(lambda: {'prompts': [], 'sessions': set()})
for entry in history:
    ts = entry.get('timestamp', 0)
    if ts >= cutoff:
        project = entry.get('project', 'unknown')
        projects[project]['prompts'].append(entry)
        projects[project]['sessions'].add(datetime.fromtimestamp(ts/1000).strftime('%Y-%m-%d'))

# Collect data
results = []
total_commits = 0
for project, data in projects.items():
    remote, commits = get_git_info(project)
    total_commits += commits
    results.append({
        'name': os.path.basename(project) or project.replace('/Users/ris/', '~/'),
        'folder': project.replace('/Users/ris/', '~/'),
        'remote': remote,
        'prompts': len(data['prompts']),
        'sessions': len(data['sessions']),
        'commits': commits
    })

results.sort(key=lambda x: -x['prompts'])
max_prompts = results[0]['prompts'] if results else 1

HTML Template

Use terminal aesthetic with:

  • Monospace system fonts: 'SF Mono', 'Monaco', 'Inconsolata', monospace
  • Dark background: #0d0d0d
  • Muted colors: #b0b0b0 (text), #555 (dim), #4ec9b0 (cyan), #ce9178 (orange)
  • ASCII box-drawing for header
  • $ command --flags style section headers
  • ASCII bar chart using █ characters
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>claude-analytics</title>
  <style>
    body {
      font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
      background: #0d0d0d;
      color: #b0b0b0;
      font-size: 14px;
      line-height: 1.6;
      padding: 24px;
    }
    .container { max-width: 900px; margin: 0 auto; }
    .header { color: #6a9955; margin-bottom: 24px; }
    .dim { color: #555; }
    .bright { color: #e0e0e0; }
    .cyan { color: #4ec9b0; }
    .orange { color: #ce9178; }
    .row {
      display: grid;
      grid-template-columns: 24px 200px 1fr 80px 80px 60px;
      gap: 8px;
      padding: 6px 0;
      border-bottom: 1px solid #1a1a1a;
    }
    .row:hover { background: #141414; }
    a { color: #555; text-decoration: none; }
    a:hover { color: #888; }
    .stat-box { display: inline-block; margin-right: 32px; }
    .stat-value { font-size: 28px; color: #e0e0e0; }
    .stat-label { color: #555; font-size: 12px; }
  </style>
</head>
<body>
  <div class="container">
    <pre class="header">
┌─────────────────────────────────────────────────────────────────┐
│   ██████╗██╗      █████╗ ██╗   ██╗██████╗ ███████╗              │
│  ██╔════╝██║     ██╔══██╗██║   ██║██╔══██╗██╔════╝              │
│  ██║     ██║     ███████║██║   ██║██║  ██║█████╗                │
│  ██║     ██║     ██╔══██║██║   ██║██║  ██║██╔══╝                │
│  ╚██████╗███████╗██║  ██║╚██████╔╝██████╔╝███████╗              │
│   ╚═════╝╚══════╝╚═╝  ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝              │
│   Weekly Analytics Report                                       │
│   {start_date} .. {end_date}                                    │
└─────────────────────────────────────────────────────────────────┘
</pre>
    <!-- Stats, table, chart sections -->
  </div>
</body>
</html>

Bar Chart Generation

def make_bar(value, max_val, width=40):
    filled = int((value / max_val) * width)
    return '█' * filled

# Example output:
# cohorts          ████████████████████████████████████████ 194
# ai-whisper       █████████████████████████████████████▋ 183

Usage

  • User asks for analytics: "покажи статистику cc", "weekly report", "что делал за неделю"
  • Run Python script to collect data
  • Generate HTML with template
  • Save to ~/claude-analytics.html
  • Open in browser: open ~/claude-analytics.html

Customization

  • Period: Change days = 7 to desired range
  • Output path: Change save location
  • Colors: Adjust CSS variables
  • Columns: Add/remove metrics in grid

Other skills for the same job

different authors, same section of the catalogue
XLSX
by anthropics
vendor ×15

Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas

5k tokens scripts
XLSX
by w95
×7

Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like \"the xlsx in my downloads\") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.

3k tokens
Raffle Winner Picker
by frostant
×5

Picks random winners from lists, spreadsheets, or Google Sheets for giveaways, raffles, and contests. Ensures fair, unbiased selection with transparency.

949 tokens
Fda Database
by christophacham
×4

Query openFDA API for drugs, devices, adverse events, recalls, regulatory submissions (510k, PMA), substance identification (UNII), for FDA regulatory data analysis and safety research.

32k tokens scripts
Matlab
by christophacham
×4

MATLAB and GNU Octave numerical computing for matrix operations, data analysis, visualization, and scientific computing. Use when writing MATLAB/Octave scripts for linear algebra, signal processing, image processing, differential equations, optimization, statistics, or creating scientific visualizations. Also use when the user needs help with MATLAB syntax, functions, or wants to convert between MATLAB and Python code. Scripts can be executed with MATLAB or the open-source GNU Octave interpreter.

25k tokens
Umap Learn
by ComeOnOliver
×4

UMAP dimensionality reduction. Fast nonlinear manifold learning for 2D/3D visualization, clustering preprocessing (HDBSCAN), supervised/parametric UMAP, for high-dimensional data.

14k tokens
D3 Viz
by chrisvoncsefalvay
×3

Creating interactive data visualisations using d3.js. This skill should be used when creating custom charts, graphs, network diagrams, geographic visualisations, or any complex SVG-based data visualisation that requires fine-grained control over visual elements, transitions, or interactions. Use this for bespoke visualisations beyond standard charting libraries, whether in React, Vue, Svelte, vanilla JavaScript, or any other environment.

20k tokens
Alphafold Database
by christophacham
×3

Access AlphaFold 200M+ AI-predicted protein structures. Retrieve structures by UniProt ID, download PDB/mmCIF files, analyze confidence metrics (pLDDT, PAE), for drug discovery and structural biology.

7k tokens

How to use it

Copy the folder

Take serejaris/cc-analytics from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.