jpskill.com
🛠️ 開発・MCP コミュニティ

session-report

Generate an explorable HTML report of Claude Code session usage (tokens, cache, subagents, skills, expensive prompts) from ~/.claude/projects transcripts.

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o session-report.zip https://jpskill.com/download/22491.zip && unzip -o session-report.zip && rm session-report.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/22491.zip -OutFile "$d\session-report.zip"; Expand-Archive "$d\session-report.zip" -DestinationPath $d -Force; ri "$d\session-report.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して session-report.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → session-report フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[スキル名] session-report

セッションレポート

Claude Code の使用状況に関する自己完結型の HTML レポートを作成し、現在の作業ディレクトリに保存してください。

手順

  1. データを取得します。 バンドルされているアナライザーを実行します(デフォルトの期間は過去7日間ですが、ユーザーが 24h30dall などの異なる期間を渡した場合はそれを尊重します)。analyze-sessions.mjs スクリプトはこの SKILL.md と同じディレクトリにあります。その絶対パスを使用してください。

    node <skill-dir>/analyze-sessions.mjs --json --since 7d > /tmp/session-report.json

    全期間の場合は、--since を省略してください。

  2. /tmp/session-report.json読み込みますoverallby_projectby_subagent_typeby_skillcache_breakstop_prompts をざっと確認してください。

  3. テンプレート(この SKILL.md と一緒にバンドルされています)を現在の作業ディレクトリの出力パスにコピーします。

    cp <skill-dir>/template.html ./session-report-$(date +%Y%m%d-%H%M).html
  4. 出力ファイルを編集します(Write ではなく Edit を使用してください。テンプレートの JS/CSS は保持してください)。

    • <script id="report-data" type="application/json"> の内容を、ステップ1で取得した完全な JSON に置き換えてください。ページの JS は、このブロブからヒーローの合計、すべてのテーブル、バー、ドリルダウンを自動的にレンダリングします。
    • <!-- AGENT: anomalies --> ブロックを3〜5行の簡潔な所見で埋めてください。可能な限り、数値を総トークン数に対する割合として表現してください(合計 = overall.input_tokens.total + overall.output_tokens)。所見は1行につき1つ、正確なマークアップは以下の通りです。
      <div class="take bad"><div class="fig">41.2%</div><div class="txt"><b>cc-monitor</b> は、わずか3回のセッションで週の41%を消費しました</div></div>

      クラス: 無駄や異常には .take bad(赤)、健全なシグナルには .take good(緑)、中立的な事実には .take info(青)を使用します。.fig は短い数値(パーセンテージ、カウント、または 12× のような乗数)です。.txt はプロジェクト/スキル/プロンプトの名前を挙げる平易な英語の文です。主題を <b> で囲んでください。以下のような点を探してください: プロジェクトまたはスキルが不釣り合いな割合を占めている、キャッシュヒット率が85%未満、単一のプロンプトが合計の2%を超えている、サブエージェントタイプが呼び出しあたり平均1Mトークンを超えている、キャッシュブレイクが集中している。

    • <!-- AGENT: optimizations --> ブロック(ページの下部)を、特定の行に関連付けられた1〜4個の <div class="callout"> 提案で埋めてください(例: "/weekly-status は7つのサブエージェントを生成し、合計の8.1%を占めました — 並列エージェントの数を減らすようにスコープを絞ってください")。
    • 既存のセクションを再構築しないでください。
  5. 保存されたファイルパスをユーザーに報告します。ファイルを開いたり、レンダリングしたりしないでください。

注意事項

  • テンプレートはインタラクティブ性(ソート、展開/折りたたみ、ブロック文字バー)の源です。あなたの仕事はデータとナラティブであり、マークアップではありません。
  • コメントは簡潔かつ具体的にし、JSON から実際のプロジェクト名、数値、タイムスタンプを参照してください。
  • top_prompts にはすでにサブエージェントのトークンが含まれており、タスク通知の継続は元のプロンプトにロールアップされています。
  • JSON が2MBを超える場合は、埋め込む前に top_prompts を100エントリに、cache_breaks を100エントリにトリミングしてください(これらはすでに上限が設定されているはずです)。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Session Report

Produce a self-contained HTML report of Claude Code usage and save it to the current working directory.

Steps

  1. Get data. Run the bundled analyzer (default window: last 7 days; honor a different range if the user passed one, e.g. 24h, 30d, or all). The script analyze-sessions.mjs lives in the same directory as this SKILL.md — use its absolute path:

    node <skill-dir>/analyze-sessions.mjs --json --since 7d > /tmp/session-report.json

    For all-time, omit --since.

  2. Read /tmp/session-report.json. Skim overall, by_project, by_subagent_type, by_skill, cache_breaks, top_prompts.

  3. Copy the template (also bundled alongside this SKILL.md) to the output path in the current working directory:

    cp <skill-dir>/template.html ./session-report-$(date +%Y%m%d-%H%M).html
  4. Edit the output file (use Edit, not Write — preserve the template's JS/CSS):

    • Replace the contents of <script id="report-data" type="application/json"> with the full JSON from step 1. The page's JS renders the hero total, all tables, bars, and drill-downs from this blob automatically.
    • Fill the <!-- AGENT: anomalies --> block with 3–5 one-line findings. Express figures as a % of total tokens wherever possible (total = overall.input_tokens.total + overall.output_tokens). One line per finding, exact markup:
      <div class="take bad"><div class="fig">41.2%</div><div class="txt"><b>cc-monitor</b> consumed 41% of the week across just 3 sessions</div></div>

      Classes: .take bad for waste/anomalies (red), .take good for healthy signals (green), .take info for neutral facts (blue). The .fig is one short number (a %, a count, or a multiplier like 12×). The .txt is one plain-English sentence naming the project/skill/prompt; wrap the subject in <b>. Look for: a project or skill eating a disproportionate share, cache-hit <85%, a single prompt >2% of total, subagent types averaging >1M tokens/call, cache breaks clustering.

    • Fill the <!-- AGENT: optimizations --> block (at the bottom of the page) with 1–4 <div class="callout"> suggestions tied to specific rows (e.g. "/weekly-status spawned 7 subagents for 8.1% of total — scope it to fewer parallel agents").
    • Do not restructure existing sections.
  5. Report the saved file path to the user. Do not open it or render it.

Notes

  • The template is the source of interactivity (sorting, expand/collapse, block-char bars). Your job is data + narrative, not markup.
  • Keep commentary terse and specific — reference actual project names, numbers, timestamps from the JSON.
  • top_prompts already includes subagent tokens and rolls task-notification continuations into the originating prompt.
  • If the JSON is >2MB, trim top_prompts to 100 entries and cache_breaks to 100 before embedding (they should already be capped).