codebase-stats
/install codebase-stats
Codebase Stats
Project metrics, complexity analysis, and health indicators. Pure Python, zero deps, 40+ languages.
Quick Start
# Analyze current directory
python3 scripts/codebase_stats.py
# Analyze specific project
python3 scripts/codebase_stats.py /path/to/project
# Markdown report
python3 scripts/codebase_stats.py /path/to/project --format markdown
# JSON (for CI/CD dashboards)
python3 scripts/codebase_stats.py /path/to/project --format json
# Filter by language
python3 scripts/codebase_stats.py --language Python
# Save report
python3 scripts/codebase_stats.py --format markdown --output stats.md
What It Measures
| Category | Metrics |
|---|---|
| Size | Total files, code/comment/blank lines, lines per file |
| Languages | Distribution by code lines and file count (40+ languages) |
| Complexity | Per-function cyclomatic complexity estimate, top complex functions |
| Quality | Code-to-comment ratio, test file coverage indicator |
| Dependencies | npm, pip, Go modules, Cargo crate counts |
| Tech Debt | TODO/FIXME/HACK/XXX counts across codebase |
| Files | Top 10 largest files by line count |
Supported Languages
Python, JavaScript, TypeScript, Java, Go, Rust, Ruby, PHP, C, C++, C#, Swift, Kotlin, Scala, R, Lua, Perl, Shell, SQL, HTML, CSS, SCSS, Vue, Svelte, Dart, Elixir, Erlang, Zig, Nim, V, Solidity, Terraform, Protobuf, and more.
Exit Codes
0— Success1— Error (directory not found, language not found)
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install codebase-stats - After installation, invoke the skill by name or use
/codebase-stats - Provide required inputs per the skill's parameter spec and get structured output
What is codebase-stats?
Analyze project metrics: lines of code, language distribution, function complexity, code-to-comment ratio, test coverage indicators, dependency counts, large... It is an AI Agent Skill for Claude Code / OpenClaw, with 99 downloads so far.
How do I install codebase-stats?
Run "/install codebase-stats" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is codebase-stats free?
Yes, codebase-stats is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does codebase-stats support?
codebase-stats is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created codebase-stats?
It is built and maintained by charlie-morrison (@charlie-morrison); the current version is v1.0.0.