code-stats
tokeiによる高速な行数カウントとdifftによる意味的な差分分析で、コードベースの概要を素早く把握し、プロジェクトの統計情報を確認するためのSkill。
📜 元の英語説明(参考)
Analyze codebase with tokei (fast line counts by language) and difft (semantic AST-aware diffs). Get quick project overview without manual counting. Triggers on: how big is codebase, count lines of code, what languages, show semantic diff, compare files, code statistics.
🇯🇵 日本人クリエイター向け解説
tokeiによる高速な行数カウントとdifftによる意味的な差分分析で、コードベースの概要を素早く把握し、プロジェクトの統計情報を確認するためのSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o code-stats.zip https://jpskill.com/download/5907.zip && unzip -o code-stats.zip && rm code-stats.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/5907.zip -OutFile "$d\code-stats.zip"; Expand-Archive "$d\code-stats.zip" -DestinationPath $d -Force; ri "$d\code-stats.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
code-stats.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
code-statsフォルダができる - 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 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
コード統計
コードベースのサイズ、構成、変更を素早く分析します。
tokei - 行数カウント
# Count all code
tokei
# Compact output sorted by code
tokei --compact --sort code
# Specific languages
tokei --type=TypeScript,JavaScript
# Exclude directories
tokei --exclude node_modules --exclude dist
# JSON output for scripting
tokei --output json | jq '.Total.code'
出力例
===============================================================================
Language Files Lines Code Comments Blanks
===============================================================================
TypeScript 45 12847 9823 1456 1568
JavaScript 12 2341 1876 234 231
-------------------------------------------------------------------------------
Total 57 15188 11699 1690 1799
===============================================================================
difft - 意味のある差分
# Compare files
difft old.ts new.ts
# Inline mode
difft --display=inline old.ts new.ts
# With git
GIT_EXTERNAL_DIFF=difft git diff
GIT_EXTERNAL_DIFF=difft git show HEAD~1
なぜ意味があるのか?
| 従来の差分 | difft |
|---|---|
| 行単位 | AST認識 |
| 移動を削除+追加として表示 | 移動を認識 |
| 空白に敏感 | フォーマットを無視 |
クイックリファレンス
| タスク | コマンド |
|---|---|
| すべてのコードをカウント | tokei |
| コンパクトな出力 | tokei --compact |
| コードでソート | tokei --sort code |
| TypeScriptのみ | tokei -t TypeScript |
| JSON出力 | tokei --output json |
| ディレクトリを除外 | tokei --exclude node_modules |
| 意味のある差分 | difft file1 file2 |
| Git差分 | GIT_EXTERNAL_DIFF=difft git diff |
使用場面
- コードベースの概要を素早く把握したい場合
- コードの変更を意味的に比較したい場合
- プロジェクトの構成を理解したい場合
- リファクタリングの影響を確認したい場合
- コードベースの成長を追跡したい場合
その他のリソース
詳細なパターンについては、以下を読み込んでください。
./references/tokei-advanced.md- フィルタリング、出力形式、CI統合./references/difft-advanced.md- 表示モード、Git統合、言語サポート
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Code Statistics
Quickly analyze codebase size, composition, and changes.
tokei - Line Counts
# Count all code
tokei
# Compact output sorted by code
tokei --compact --sort code
# Specific languages
tokei --type=TypeScript,JavaScript
# Exclude directories
tokei --exclude node_modules --exclude dist
# JSON output for scripting
tokei --output json | jq '.Total.code'
Sample Output
===============================================================================
Language Files Lines Code Comments Blanks
===============================================================================
TypeScript 45 12847 9823 1456 1568
JavaScript 12 2341 1876 234 231
-------------------------------------------------------------------------------
Total 57 15188 11699 1690 1799
===============================================================================
difft - Semantic Diffs
# Compare files
difft old.ts new.ts
# Inline mode
difft --display=inline old.ts new.ts
# With git
GIT_EXTERNAL_DIFF=difft git diff
GIT_EXTERNAL_DIFF=difft git show HEAD~1
Why Semantic?
| Traditional diff | difft |
|---|---|
| Line-by-line | AST-aware |
| Shows moved as delete+add | Recognizes moves |
| Whitespace sensitive | Ignores formatting |
Quick Reference
| Task | Command |
|---|---|
| Count all code | tokei |
| Compact output | tokei --compact |
| Sort by code | tokei --sort code |
| TypeScript only | tokei -t TypeScript |
| JSON output | tokei --output json |
| Exclude dir | tokei --exclude node_modules |
| Semantic diff | difft file1 file2 |
| Git diff | GIT_EXTERNAL_DIFF=difft git diff |
When to Use
- Getting quick codebase overview
- Comparing code changes semantically
- Understanding project composition
- Reviewing refactoring impact
- Tracking codebase growth
Additional Resources
For detailed patterns, load:
./references/tokei-advanced.md- Filtering, output formats, CI integration./references/difft-advanced.md- Display modes, git integration, language support