From claude-mods
Analyzes codebases using tokei for fast line counts by language and difft for semantic AST-aware diffs. Use for project overviews, code statistics, language composition, file comparisons, and git change reviews.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-mods:code-statsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Quickly analyze codebase size, composition, and changes.
Quickly analyze codebase size, composition, and changes.
# 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
===============================================================================
# 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
| Traditional diff | difft |
|---|---|
| Line-by-line | AST-aware |
| Shows moved as delete+add | Recognizes moves |
| Whitespace sensitive | Ignores formatting |
| 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 |
For detailed patterns, load:
./references/tokei-advanced.md - Filtering, output formats, CI integration./references/difft-advanced.md - Display modes, git integration, language supportnpx claudepluginhub 0xdarkmatter/claude-mods --plugin claude-modsCounts lines of code, analyzes codebase size/composition, and compares code between versions using `cloc`. Supports 200+ languages and multiple output formats.
Counts source lines by file type and auto-detected modules via shell inspection. Handles JS/TS monorepos, Rust/Go/Python workspaces, Java/Kotlin multi-module, full-stack monoliths.
Surveys codebase structure including modules, tech stack, entry points, git hotspots, and call graphs using analyzers.