cc-analytics

cc-analytics is a skill for Claude Code, Codex from OXI-717/ai-native-toolkit. It costs 59 tokens per session (2,473 once invoked), scanned A, a copy of cc-analytics, MIT.

An HTML report generator for Claude Code usage. It reads command history and Git repository information to summarize projects, prompts, commits, and activity days.

In plain words
What is it for?
Use it to create a weekly usage report, review project activity, and see repository links and commit counts.
Why use it?
It removes the need to manually review session history and repositories to find out what work was done.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths; mentions Claude Code.

Good fit Use it to create a weekly usage report, review project activity, and see repository links and commit counts.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/oxi-717/ai-native-toolkit/cc-analytics
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add OXI-717/ai-native-toolkit --skill cc-analytics
Clone the repo
git clone --depth 1 https://github.com/OXI-717/ai-native-toolkit

Made for: Claude Code, Codex.

Its marketplace also offers this one on its own, as the plugin cc-analytics — /plugin install cc-analytics after adding the marketplace above.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cc-analytics

README.md
[![agentmods](https://agentmods.dev/badge/skills/oxi-717/ai-native-toolkit/cc-analytics/github.svg)](https://agentmods.dev/skills/oxi-717/ai-native-toolkit/cc-analytics)
Your own site
<a href="https://agentmods.dev/skills/oxi-717/ai-native-toolkit/cc-analytics"><img src="https://agentmods.dev/badge/skills/oxi-717/ai-native-toolkit/cc-analytics/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cc-analytics

Your own site · 80×15
<a href="https://agentmods.dev/skills/oxi-717/ai-native-toolkit/cc-analytics"><img src="https://agentmods.dev/badge/skills/oxi-717/ai-native-toolkit/cc-analytics.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,473 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00059 $0.02473
Opus 5.5 $0.00024 $0.00989
Sonnet 5.5 $0.00012 $0.00495
Haiku 4.5 $0.00006 $0.00247

Measured 1mo ago against content hash e0649abd95b1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cc-analytics scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

result = subprocess.run(['git', '-C', path, 'remote', 'get-url', 'origin'],
Origin

This is a copy

100% identical to cc-analytics — 101 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

plugins/cc-analytics/skills/cc-analytics/SKILL.md · 270 lines

How it starts

The opening of the file, as written. The whole thing — 270 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 concurrent.futures import ThreadPoolExecutor
from datetime import datetime, timedelta
from collections import defaultdict

SKIP_DIRS = {'node_modules', '.venv', 'venv', '.worktrees', 'dist', 'build', '__pycache__'}

def _repo_stats(path, week_ago):
    """remote + commit count for a single git repo."""
    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://', '')

        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 Exception:
        return None, 0

def _nested_repos(path, depth=2):
    """Git repos below a container directory (the project dir itself is not a repo)."""
    found = []
    def walk(cur, level):
        if level > depth:
            return
        try:
            entries = os.listdir(cur)
        except OSError:
            return
        for name in entries:
            if name.startswith('.') or name in SKIP_DIRS:
                continue
            sub = os.path.join(cur, name)
            if not os.path.isdir(sub) or os.path.islink(sub):
                continue
            if os.path.exists(os.path.join(sub, '.git')):
                found.append(sub)      # a repo's own subdirs are not scanned further
            else:
                walk(sub, level + 1)
    walk(path, 1)
    return found

def assign_repos(projects):
    """Map each container project to the repos it alone accounts for.

    Containers nest (a work root holds a per-client folder, which holds the repos), so the same
    repo is reachable from several projects and its commits would be counted once per
    project. A repo belongs to the deepest container that sees it, and to no one if it is
    a project in its own right — that project reports it directly.
    """
    own_repos = {os.path.realpath(p) for p in projects
                 if os.path.exists(os.path.join(p, '.git'))}
    owner = {}                             # repo realpath -> owning container
    for project in projects:
        if os.path.realpath(project) in own_repos:
            continue
        for repo in _nested_repos(project):
            key = os.path.realpath(repo)
            if key in own_repos:
                continue
            current = owner.get(key)
            if current is None or len(project) > len(current):
                owner[key] = project
    assigned = defaultdict(list)
    for repo, project in owner.items():
        assigned[project].append(repo)
    return assigned

def get_git_info(path, container_repos=()):
    """Commit stats for a project dir.

    A project dir is often a container (several repos side by side) rather than a repo
    itself — working from it used to report zero commits and hide the week's real work.
    For containers, sum the commits of the repos assigned to it by `assign_repos`.
    """
    if not os.path.isdir(path):
        return None, 0
    week_ago = (datetime.now() - timedelta(days=7)).strftime('%Y-%m-%d')

    if os.path.exists(os.path.join(path, '.git')):
        return _repo_stats(path, week_ago)

    repos = list(container_repos)
    if not repos:
        return None, 0
    # Two git calls per repo, all I/O-bound: sequential scanning of a large container
    # takes minutes, threads bring it back to seconds.
    total = 0
    busiest = (None, -1)               # remote of the repo with the most commits
    with ThreadPoolExecutor(max_workers=16) as pool:
        for remote, commits in pool.map(lambda r: _repo_stats(r, week_ago), repos):
            total += commits
            if commits > busiest[1]:
                busiest = (remote, commits)
    return busiest[0], total

# 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
home = os.path.expanduser('~')

def short_path(path):
    """Render an absolute project path relative to the current user's home."""
    return '~' + path[len(home):] if path == home or path.startswith(home + os.sep) else path

results = []
total_commits = 0
container_repos = assign_repos(projects)
for project, data in projects.items():
    remote, commits = get_git_info(project, container_repos.get(project, ()))
    total_commits += commits
    results.append({
        'name': os.path.basename(project) or short_path(project),
        'folder': short_path(project),
        '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

Read the full file on GitHub · 270 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 270 lines · 59 tokens per session scan A e0649abd95b1

Subscribe to this mod's changes

cc-analytics is a skill published in the GitHub repository OXI-717/ai-native-toolkit (9 stars, last pushed 21d ago), licensed MIT. It adds 59 tokens to every session and 2,473 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). It is 100% identical to cc-analytics, differing in 101 lines, and is treated as a copy.

Related

Other skills, from other repositories

autoreview

Structured code review through the shared OpenClaw agent-skills installation.

openclaw/clawhub · 17 tokens

omh-code-review

This is an OMH code-review workflow skill, projected for Agent Skills hosts (Claude Code, Codex, Cursor, opencode, OpenClaw, pi).

rlaope/oh-my-hermes · 48 tokens

revdiff-plan

Review the last Codex assistant message (plan, analysis, or proposal) with inline annotations in a TUI overlay. Extracts the most recent response from Codex rollout files and opens it in revdiff for review and annotation. Activates on "revdiff-plan", "review plan with revdiff", "annotate plan", "review last response"…

umputun/revdiff · 84 tokens

re0-merge

Review and land an external contribution the way this suite does: gate it against the thesis, land it with the author's credit intact, complete a new skill rather than merging it raw, then approve, credit, and explain before closing. Use when reviewing a pull request, as any collaborator or maintainer, not only the…

LilMGenius/paperthin · 70 tokens

explore-unknowns

Guide the user through a quadrant walk that maps the unknowns of a task — open by listing the known knowns, then work through known unknowns, unknown knowns, and unknown unknowns one stage at a time, ending with a complete four-quadrant map in the user's hands. Use when a request is ambiguous or underspecified, the…

dzhng/skills · 162 tokens

asplos-writing-style

Use when drafting or revising ASPLOS prose — engineering the first two pages that rapid review actually reads, stating the cross-layer insight as one quotable sentence, structuring per-layer mechanism sections, writing bounded claims, and fitting everything into 11 self-contained pages that include figures and…

brycewang-stanford/Awesome-Journal-Skills · 65 tokens