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

cctoolstats

v0.1.1

Published

Claude Codeのツール呼び出し/サブエージェント実行履歴の統計を分かりやすく表示するCLIツール

Readme

cctoolstats

Claude Codeのツール呼び出し/サブエージェント実行履歴の統計を分かりやすく表示するCLIツール

このプロジェクトは ccusage のリスペクトです

特徴

  • 📊 サブエージェント統計: 各サブエージェントの使用回数と成功率を集計
  • 🔧 ツール使用分析: Bash, Read, Write, Edit等の使用頻度を可視化
  • 📈 タイムライン表示: セッション毎の実行履歴を時系列で確認
  • 🚀 インストール不要: npxで即座に実行可能

インストール

インストールなしで実行(推奨)

npx cctoolstats@latest

グローバルインストール

npm install -g cctoolstats

使い方

基本的な使い方

# 現在のディレクトリの統計を表示(デフォルト)
cctoolstats

# 複数のプロジェクトディレクトリを分析
cctoolstats ~/project1 ~/project2

# 全プロジェクトの統計を表示
cctoolstats --all

# 特定のプロジェクトを分析
cctoolstats --project /path/to/project

# 特定のログファイルを分析(後方互換性)
cctoolstats file.jsonl

出力フォーマット

# テーブル形式で出力(デフォルト)
cctoolstats

# JSON形式で出力
cctoolstats --format json

# CSV形式で出力
cctoolstats --format csv

# ファイルに保存
cctoolstats --output results.json --format json

詳細オプション

# ヘルプを表示
cctoolstats --help

# バージョンを表示
cctoolstats --version

# 数値を千単位区切りで表示
cctoolstats --thousand-separator

# カラー出力を強制
cctoolstats --color

# 詳細モードで表示
cctoolstats --verbose

出力例

デフォルトテーブル形式

Tool Usage Statistics
==================================================
┌───────┬───────┬────────────┐
│ Tool  │ Count │ Percentage │
├───────┼───────┼────────────┤
│ Bash  │ 3     │ 42.86%     │
├───────┼───────┼────────────┤
│ Read  │ 1     │ 14.29%     │
├───────┼───────┼────────────┤
│ Write │ 1     │ 14.29%     │
└───────┴───────┴────────────┘
Total: 7

Subagent Usage Statistics
==================================================
┌───────────────┬───────┬────────────┐
│ Subagent      │ Count │ Percentage │
├───────────────┼───────┼────────────┤
│ code-reviewer │ 2     │ 66.67%     │
├───────────────┼───────┼────────────┤
│ test-writer   │ 1     │ 33.33%     │
└───────────────┴───────┴────────────┘
Total: 3

JSON形式出力

{
  "tools": {
    "totalInvocations": 7,
    "uniqueTools": 5,
    "toolCounts": {
      "Bash": 3,
      "Read": 1,
      "Write": 1
    },
    "toolPercentages": {
      "Bash": 42.86,
      "Read": 14.29,
      "Write": 14.29
    }
  },
  "subagents": {
    "totalInvocations": 3,
    "uniqueAgents": 2,
    "agentCounts": {
      "code-reviewer": 2,
      "test-writer": 1
    }
  }
}

データソース

Claude Codeのトランスクリプトログ(JSONL形式)を解析します:

  • ~/.claude/projects/*.jsonl
  • ~/.config/claude/projects/*.jsonl (v1.0.30以降)

各行には以下の情報が含まれます:

  • タイムスタンプ
  • メッセージ内容
  • ツール呼び出し情報
  • サブエージェント(Task)実行記録
  • トークン使用量
  • モデル情報

開発

セットアップ

# リポジトリをクローン
git clone https://github.com/masashi-fuji/cctoolstats.git
cd cctoolstats

# 依存関係をインストール
npm install

# 開発サーバーを起動
npm run dev

ビルド

# TypeScriptをコンパイル
npm run build

# テストを実行
npm test

# リントを実行
npm run lint

プロジェクト構造

cctoolstats/
├── src/
│   ├── index.ts           # エントリーポイント
│   ├── cli.ts             # CLIインターフェース
│   ├── analyzer/          # ログ解析ロジック
│   ├── parser/            # JSONLパーサー
│   ├── formatters/        # 出力フォーマッター
│   └── types/             # TypeScript型定義
├── docs/
│   ├── research/          # 調査・研究ドキュメント
│   └── design/            # 設計ドキュメント
├── tests/                 # テストファイル
└── package.json

貢献

プルリクエストを歓迎します!以下の手順でご協力ください:

  1. このリポジトリをフォーク
  2. 機能ブランチを作成 (git checkout -b feature/amazing-feature)
  3. 変更をコミット (git commit -m 'Add amazing feature')
  4. ブランチにプッシュ (git push origin feature/amazing-feature)
  5. プルリクエストを作成

サポート

作者

ライセンス

MIT License - 詳細は LICENSE ファイルを参照してください。

謝辞

  • ccusage - インスピレーションとなった素晴らしいプロジェクト
  • Claude Code - 開発を支援してくれたAIペアプログラマー

関連リンク