code-stats
Analyzes codebase size and semantic differences quickly via command-line tools.
Install
mkdir -p .claude/skills/code-stats && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/19381" && unzip -o skill.zip -d .claude/skills/code-stats && rm skill.zipInstalls to .claude/skills/code-stats
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
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.Key capabilities
- →Calculate total lines of code by language using tokei
- →Generate compact codebase statistics sorted by code volume
- →Perform semantic diffs between files using difft
- →Integrate semantic diffing into git workflows
- →Filter line counts by specific programming languages
- →Exclude specific directories from codebase analysis
How it works
The skill executes tokei to perform rapid line counts and difft to generate AST-aware semantic diffs. It uses Bash commands to interface with these tools for project analysis.
Inputs & outputs
When to use code-stats
- →Count total lines of code by language
- →View semantic changes between file versions
- →Generate a project size overview
About this skill
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
Prerequisites
How it compares
Unlike traditional line-by-line diff tools, this approach uses AST-aware logic to ignore formatting changes and recognize moved code blocks.
Compared to similar skills
code-stats side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| code-stats (this skill) | 0 | 3mo | Review | Beginner |
| tech-debt-tracker | 1 | 1mo | Review | Intermediate |
| quality-engineering-zephyr-coverage-analysis | 0 | 2mo | No flags | Intermediate |
| quality | 0 | 4mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by 0xDarkMatter
View all by 0xDarkMatter →You might also like
tech-debt-tracker
alirezarezvani
Scan codebases for technical debt, score severity, track trends, and generate prioritized remediation plans. Use when users mention tech debt, code quality, refactoring priority, debt scoring, cleanup sprints, or code health assessment. Also use for legacy code modernization planning and maintenance cost estimation.
quality-engineering-zephyr-coverage-analysis
HoangNguyen0403
Audit test coverage health, gaps, and QE debt for Jira stories or epics. Produces coverage_analysis_report.md with AC-to-TC heatmap, risk scores, and prioritized action plan. Use when assessing coverage percentage, pre-release readiness, sprint readiness, or identifying missing test cases. Do NOT us
quality
dpaola2
Generate a code quality report for a pipeline project by reading quality frontmatter from progress.md and optionally running fresh analysis.
evaluation-anchor-checker
WILLOSCAR
|
dbt-transformation-patterns
wshobson
Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.
analyse-issue
monarch-initiative
Analyze MONDO GitHub issues for validity, suggest improvements, and generate structured reports with duplication checks and identifier validation