LaunchKit · 2026
Back to Skills

code-stats

Visualizes repository complexity by counting files, lines of code, and grouping by extension.

0
0 downloads
by @wanng-ide

Setup & Installation

openclaw skills install @wanng-ide/code-stats

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install code-stats

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.

INPUT

User asks: How many files and lines of code are in my project?

AGENT
  1. 1Run `node skills/code-stats/index.js` from the project root
  2. 2Receive a JSON object with `files`, `lines`, and `byExt` fields
  3. 3Parse `byExt` to identify the top file extensions
  4. 4Report total file count, total line count, and per-extension breakdown
OUTPUT

{ files: 312, lines: 28450, byExt: { '.ts': 18200, '.json': 4100, '.md': 6150 } }