Marketplace code-stats
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.
install
source · Clone the upstream repo
git clone https://github.com/aiskillstore/marketplace
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/aiskillstore/marketplace "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/0xdarkmatter/code-stats" ~/.claude/skills/aiskillstore-marketplace-code-stats && rm -rf "$T"
manifest:
skills/0xdarkmatter/code-stats/SKILL.mdsource content
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 | |
| Compact output | |
| Sort by code | |
| TypeScript only | |
| JSON output | |
| Exclude dir | |
| Semantic diff | |
| 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:
- Filtering, output formats, CI integration./references/tokei-advanced.md
- Display modes, git integration, language support./references/difft-advanced.md