acommons
複数のAIコーディングツールのトークン利用状況を横断的に分析し、利用状況の確認やデータ同期、自動追跡設定を行うSkill。
📜 元の英語説明(参考)
AI coding tool usage analytics. Tracks token usage across Claude Code, Codex CLI, OpenCode, Gemini CLI, and external tools. Use when user wants to view AI usage stats, sync usage data, or set up automatic usage tracking.
🇯🇵 日本人クリエイター向け解説
複数のAIコーディングツールのトークン利用状況を横断的に分析し、利用状況の確認やデータ同期、自動追跡設定を行うSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o acommons.zip https://jpskill.com/download/7001.zip && unzip -o acommons.zip && rm acommons.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/7001.zip -OutFile "$d\acommons.zip"; Expand-Archive "$d\acommons.zip" -DestinationPath $d -Force; ri "$d\acommons.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
acommons.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
acommonsフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-17
- 取得日時
- 2026-05-17
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
acommons — AI利用状況分析スキル
あなたは、ローカルAIツールの利用状況データにアクセスできるAIエージェントです。ユーザーが/acommonsを呼び出した際、$ARGUMENTSを解析し、以下の該当するサブコマンドにルーティングしてください。
デフォルトのサブコマンド: stats (引数がない場合)
環境
DATA_DIR = ~/.agentic-commons
CLAUDE_STATS = ~/.claude/stats-cache.json
CLAUDE_LEDGER = ~/.agentic-commons/claude-ledger.json
CODEX_SESSIONS = ~/.codex/sessions/
CODEX_LEDGER = ~/.agentic-commons/codex-ledger.json
OPENCODE_DB = ~/.local/share/opencode/opencode.db
GEMINI_SESSIONS = ~/.gemini/tmp/*/chats/session-*.json
EXTERNAL_USAGE = ~/.agentic-commons/external-usage/
Windowsの場合: ~/.opencode → ~/AppData/Roaming/opencode
サブコマンド: stats (デフォルト)
今日のAIツール利用状況を表形式で表示します。
手順:
~/.claude/stats-cache.jsonを読み込みます →dailyActivity(メッセージ、セッション、ツール呼び出し)とdailyModelTokens(tokensByModelの合計)から今日の日付を抽出します。~/.agentic-commons/claude-ledger.jsonを確認します → 今日のエントリがある場合、より正確なトークン数のためにすべてのモデルのtotalIOを合計します。~/.codex/sessions/を確認します →.jsonlファイルをセッションとしてカウントします。トークン合計については、~/.agentic-commons/codex-ledger.jsonが存在すればそちらを優先し、なければファイルをカウントします。~/.local/share/opencode/opencode.dbを確認します → 存在する場合、「検出済み」と報告します(SQLiteの読み取りには収集スクリプトが必要です)。~/.gemini/tmp/を確認します →session-*.jsonファイルをカウントします。~/.agentic-commons/external-usage/を確認します →.jsonlファイルをカウントします。
出力形式:
AI Tool Usage — Today (YYYY-MM-DD)
Tool Sessions Messages IO Tokens Tool Calls
──────────── ──────── ──────── ────────── ──────────
Claude Code 3 42 130.0K 120
Codex CLI 5 -- 89.2K --
OpenCode 2 -- 45.1K --
Gemini CLI 1 -- 12.3K --
──────────── ──────── ──────── ────────── ──────────
Total 11 42 276.6K 120
数値の書式設定: 小さい数値は1,234、千単位は12.3K、百万単位は1.5Mです。
サブコマンド: daily
過去14日間の日別内訳を表示します。
手順:
~/.claude/stats-cache.jsonを読み込みます →dailyActivity配列(それぞれ日付、messageCount、sessionCountを持つ)~/.claude/stats-cache.jsonを読み込みます →dailyModelTokens配列(それぞれ日付、tokensByModelを持つ)- 利用可能な場合は、より正確な日別合計のためにClaudeの台帳も読み込みます。
- その他のツールについては、それぞれのデータソースを読み込み、日付でグループ化します。
出力形式:
Daily Usage — Last 14 Days
Date Claude Codex OpenCode Gemini Total
────────── ──────── ─────── ──────── ─────── ────────
2025-01-15 130.0K 89.2K 45.1K 12.3K 276.6K
2025-01-14 95.0K 72.1K 38.0K 8.1K 213.2K
...
サブコマンド: models
全期間にわたって集計されたモデルごとのトークン使用量を表示します。
手順:
~/.claude/stats-cache.jsonを読み込みます →modelUsageオブジェクト(モデル名でキー付けされ、それぞれinputTokens、outputTokens、cacheReadInputTokens、cacheCreationInputTokensを持つ)- Claudeの台帳を読み込みます →
dailyByModel→ モデルごとにすべての日付を集計します。 - Codexの台帳を読み込みます → [プロバイダー、モデル]ごとに集計します。
- 利用可能なその他のソースを読み込みます。
出力形式:
Token Usage by Model
Source Model Input Output Cached Total IO
─────────── ───────────────────────────── ──────── ──────── ───────── ────────
Claude claude-sonnet-4-20250514 80.0K 50.0K 230.0K 130.0K
Claude claude-haiku-4-5-20251001 20.0K 10.0K 50.0K 30.0K
Codex gpt-4o 60.0K 29.2K 15.0K 89.2K
OpenCode claude-sonnet-4-20250514 30.0K 15.1K 40.0K 45.1K
Gemini gemini-2.5-pro 8.0K 4.3K 6.0K 12.3K
サブコマンド: total
全期間の集計サマリーを表示します。
手順:
- すべてのデータソースを集計します。
- ソース(claude、codex、opencode、gemini、external)ごとに合計します。
出力:
All-Time Usage Summary
Source Days Sessions IO Tokens Cached Tokens
─────────── ───── ───────── ─────────── ─────────────
Claude 45 150 4.5M 12.3M
Codex 30 89 2.1M 0.3M
OpenCode 20 45 0.9M 0.4M
Gemini 10 25 0.3M 0.1M
External 5 -- 0.1M 0
─────────── ───── ───────── ─────────── ─────────────
Total 45 309 7.9M 13.1M
サブコマンド: sync
完全な収集 + アップロードパイプラインを実行します。
アクション: 収集スクリプトを実行します。
node ~/.agentic-commons/collect.mjs
~/.agentic-commons/collect.mjsが存在しない場合、ユーザーにまず/acommons setupを実行するよう伝えてください。
スクリプトの出力をユーザーに表示します。
サブコマンド: setup
初回セットアップ: フック、スケジューラをインストールし、スクリプトをコピーします。
アクション: セットアップスクリプトを実行します。
bash <skill_dir>/scripts/setup.sh
ここで、<skill_dir>はこのSKILL.mdファイルを含むディレクトリです。
Windowsでbashが利用できない場合は、以下の手順を手動で実行してください。
~/.agentic-commons/ディレクトリを作成します。<skill_dir>/scripts/hook.mjsを~/.agentic-commons/hook.mjsにコピーします。<skill_dir>/scripts/collect.mjsを~/.agentic-commons/collect.mjsにコピーします。~/.claude/settings.jsonを修正してClaude Code Stop Hookをインストールします。{ "hooks": { "Stop": [ { "hooks": [{ "type": "command", "command": "node ~/.agentic-commons/hook.mjs" }] } ] } }(既存のフックとマージし、上書きしないでください)
- 1時間ごとのスケジューラをインストールします。
- Windows:
schtasks /create /tn "AgenticCommons" /tr "wscript.exe <vbs_path>" /sc hourly /f - macOS:
~/Library/LaunchAgents/com.agentic-commons.plistにLaunchAgent plistを作成します。 - Linux: crontabエントリ
0 * * * * node ~/.agentic-commons/collect.mjsを追加します。
- Windows:
セットアップ後、ユーザーに/acommons linkを実行して連携するよう提案します。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
acommons — AI Usage Analytics Skill
You are an AI agent with access to local AI tool usage data. When the user invokes /acommons, parse $ARGUMENTS and route to the matching subcommand below.
Default subcommand: stats (when no argument given)
Environment
DATA_DIR = ~/.agentic-commons
CLAUDE_STATS = ~/.claude/stats-cache.json
CLAUDE_LEDGER = ~/.agentic-commons/claude-ledger.json
CODEX_SESSIONS = ~/.codex/sessions/
CODEX_LEDGER = ~/.agentic-commons/codex-ledger.json
OPENCODE_DB = ~/.local/share/opencode/opencode.db
GEMINI_SESSIONS = ~/.gemini/tmp/*/chats/session-*.json
EXTERNAL_USAGE = ~/.agentic-commons/external-usage/
On Windows: ~/.opencode → ~/AppData/Roaming/opencode
Subcommand: stats (default)
Show today's AI tool usage in a table.
Steps:
- Read
~/.claude/stats-cache.json→ extract today fromdailyActivity(messages, sessions, toolCalls) anddailyModelTokens(tokensByModel sum) - Check
~/.agentic-commons/claude-ledger.json→ if it has today's entry, sum all models'totalIOfor a more accurate token count - Check
~/.codex/sessions/→ count.jsonlfiles as sessions. For token total: prefer~/.agentic-commons/codex-ledger.jsonif exists, otherwise count files - Check
~/.local/share/opencode/opencode.db→ if exists, report "detected" (reading SQLite requires the collect script) - Check
~/.gemini/tmp/→ countsession-*.jsonfiles - Check
~/.agentic-commons/external-usage/→ count.jsonlfiles
Output format:
AI Tool Usage — Today (YYYY-MM-DD)
Tool Sessions Messages IO Tokens Tool Calls
──────────── ──────── ──────── ────────── ──────────
Claude Code 3 42 130.0K 120
Codex CLI 5 -- 89.2K --
OpenCode 2 -- 45.1K --
Gemini CLI 1 -- 12.3K --
──────────── ──────── ──────── ────────── ──────────
Total 11 42 276.6K 120
Format numbers: 1,234 for small, 12.3K for thousands, 1.5M for millions.
Subcommand: daily
Show 14-day daily breakdown.
Steps:
- Read
~/.claude/stats-cache.json→dailyActivityarray (each has date, messageCount, sessionCount) - Read
~/.claude/stats-cache.json→dailyModelTokensarray (each has date, tokensByModel) - Also read Claude ledger for more accurate daily totals if available
- For other tools: read their respective data sources and group by date
Output format:
Daily Usage — Last 14 Days
Date Claude Codex OpenCode Gemini Total
────────── ──────── ─────── ──────── ─────── ────────
2025-01-15 130.0K 89.2K 45.1K 12.3K 276.6K
2025-01-14 95.0K 72.1K 38.0K 8.1K 213.2K
...
Subcommand: models
Show per-model token usage aggregated across all time.
Steps:
- Read
~/.claude/stats-cache.json→modelUsageobject (keyed by model name, each has inputTokens, outputTokens, cacheReadInputTokens, cacheCreationInputTokens) - Read Claude ledger →
dailyByModel→ aggregate all dates per model - Read Codex ledger → aggregate per [provider, model]
- Read other sources as available
Output format:
Token Usage by Model
Source Model Input Output Cached Total IO
─────────── ───────────────────────────── ──────── ──────── ───────── ────────
Claude claude-sonnet-4-20250514 80.0K 50.0K 230.0K 130.0K
Claude claude-haiku-4-5-20251001 20.0K 10.0K 50.0K 30.0K
Codex gpt-4o 60.0K 29.2K 15.0K 89.2K
OpenCode claude-sonnet-4-20250514 30.0K 15.1K 40.0K 45.1K
Gemini gemini-2.5-pro 8.0K 4.3K 6.0K 12.3K
Subcommand: total
Show all-time aggregated summary.
Steps:
- Aggregate all data sources
- Sum by source (claude, codex, opencode, gemini, external)
Output:
All-Time Usage Summary
Source Days Sessions IO Tokens Cached Tokens
─────────── ───── ───────── ─────────── ─────────────
Claude 45 150 4.5M 12.3M
Codex 30 89 2.1M 0.3M
OpenCode 20 45 0.9M 0.4M
Gemini 10 25 0.3M 0.1M
External 5 -- 0.1M 0
─────────── ───── ───────── ─────────── ─────────────
Total 45 309 7.9M 13.1M
Subcommand: sync
Run the full collect + upload pipeline.
Action: Execute the collect script:
node ~/.agentic-commons/collect.mjs
If ~/.agentic-commons/collect.mjs does not exist, tell the user to run /acommons setup first.
Show the script output to the user.
Subcommand: setup
First-time setup: install hook, scheduler, and copy scripts.
Action: Execute the setup script:
bash <skill_dir>/scripts/setup.sh
Where <skill_dir> is the directory containing this SKILL.md file.
If on Windows and bash is not available, run the steps manually:
- Create
~/.agentic-commons/directory - Copy
<skill_dir>/scripts/hook.mjs→~/.agentic-commons/hook.mjs - Copy
<skill_dir>/scripts/collect.mjs→~/.agentic-commons/collect.mjs - Install Claude Code Stop Hook by modifying
~/.claude/settings.json:{ "hooks": { "Stop": [ { "hooks": [{ "type": "command", "command": "node ~/.agentic-commons/hook.mjs" }] } ] } }(Merge with existing hooks, don't overwrite)
- Install hourly scheduler:
- Windows:
schtasks /create /tn "AgenticCommons" /tr "wscript.exe <vbs_path>" /sc hourly /f - macOS: Create LaunchAgent plist at
~/Library/LaunchAgents/com.agentic-commons.plist - Linux: Add crontab entry
0 * * * * node ~/.agentic-commons/collect.mjs
- Windows:
After setup, suggest the user run /acommons link to connect their account.
Subcommand: link
Device OAuth authentication flow.
Steps:
- Read or create device secret from
~/.agentic-commons/device-secret.key(64-char hex) - Build device identity (hostname, platform, arch, cpu/memory info)
- POST to
https://api.agenticcommons.xyz/v1/auth/device/start:{ "device_label": "<hostname>", "device_secret": "<hex>", "device_profile": {...} } - Show the user: verification URL and user code
- Open browser to
verification_uri_complete - Poll
POST /v1/auth/device/pollwith{ "device_code": "..." }every N seconds - On
"authorized": saveaccess_tokento~/.agentic-commons/api-token.secret - Update
~/.agentic-commons/config.jsonwithlinkedAtanddeviceLabel
Note: On Windows, the token is encrypted with PowerShell SecureString before saving.
Subcommand: doctor
Health check and diagnostics.
Check each item and report status:
~/.agentic-commons/directory exists and permissions are 700~/.agentic-commons/config.jsonexists, showlastSetupdate~/.agentic-commons/api-token.secretexists (linked status)~/.claude/settings.jsonhas acommons Stop hook configured- Scheduler installed (check schtasks/launchd/crontab)
~/.claude/stats-cache.jsonreadable (Claude Code detected)~/.codex/sessions/exists (Codex CLI detected)~/.local/share/opencode/opencode.dbexists (OpenCode detected)~/.gemini/tmp/exists (Gemini CLI detected)~/.agentic-commons/upload-tracker.json— last upload info
Output format:
acommons Doctor
✓ Data directory exists (~/.agentic-commons/)
✓ Config found (last setup: 2025-01-10)
✓ Device linked (api-token.secret present)
✓ Claude Code Stop hook installed
✓ Scheduler: schtasks (Windows)
✓ Claude Code detected (stats-cache.json readable)
✗ Codex CLI not found
✓ OpenCode detected (opencode.db readable)
✗ Gemini CLI not found
✓ Last upload: 2025-01-15 (42 payloads)
Subcommand: probe
Detect all installed AI coding tools (not just data sources).
Scan for these tools:
| Tool | Config Dir | Binary | Provider |
|---|---|---|---|
| Claude Code | ~/.claude | claude | anthropic |
| Codex CLI | ~/.codex | codex | openai |
| Gemini CLI | ~/.gemini | gemini | |
| Kimi CLI | ~/.kimi | kimi | moonshot |
| OpenCode | ~/.opencode | opencode | various |
| Cursor | ~/.cursor | cursor | various |
| Windsurf | ~/.codeium | windsurf | codeium |
| Aider | ~/.aider | aider | various |
| Goose | ~/.config/goose | goose | various |
| Amp | ~/.config/amp | amp | sourcegraph |
| Droid | ~/.factory | droid | factory |
| Kiro | ~/.kiro | kiro-cli | aws |
| Copilot CLI | ~/.copilot | copilot | github |
| Cody | ~/.config/sourcegraph | cody | sourcegraph |
For each: check if config directory exists AND/OR if binary is on PATH (use which/where).
Output:
AI Tool Probe
Tool Binary Config Provider
───────────── ────── ────── ──────────
Claude Code yes yes anthropic
Codex CLI yes yes openai
OpenCode yes yes various
Gemini CLI yes yes google
Cursor yes no various
5 detected, 9 not found
Subcommand: report
Generate an HTML usage report.
Steps:
- Collect all available data (same as
stats+daily+models) - Generate a self-contained HTML file at
~/.agentic-commons/report.html - Include: daily chart, model breakdown table, source summary
- Open in browser
Notes for AI Agents
- All data is LOCAL. No API calls needed for
stats,daily,models,total,probe,doctor. - Only
sync,link, andsetupperform network/system operations. - Token formatting: use
Kfor thousands,Mfor millions (e.g.,130.0K,1.5M). - The
total_iofield equalsinput_uncached + output— it does NOT include cached tokens. - When reading JSON files, always handle missing/malformed files gracefully.
- Refer to
references/data-sources.mdfor detailed data format documentation.