Setup & Installation
Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:
What This Skill Does
Counts files and lines of code in a repository and groups results by file extension. Takes an optional path argument and outputs a structured JSON object. Useful for quickly assessing project size without external tooling.
Returns a machine-readable JSON breakdown in one command, making it easy to pipe results into other scripts or dashboards.
When to use it
- Checking total LOC before a code review
- Comparing file counts across two branches
- Auditing a newly cloned repo before contributing
- Tracking codebase growth between sprints
- Identifying which languages dominate a monorepo
Example Workflow
Here's how your AI assistant might use this skill in practice.
User asks: How many files and lines of code are in my project?
- 1Run `node skills/code-stats/index.js` from the project root
- 2Receive a JSON object with `files`, `lines`, and `byExt` fields
- 3Parse `byExt` to identify the top file extensions
- 4Report total file count, total line count, and per-extension breakdown
{ files: 312, lines: 28450, byExt: { '.ts': 18200, '.json': 4100, '.md': 6150 } }