Skip to content
Skillpedia
General coding260k Β· #619

codebase-inspection

What it does

This skill has your AI measure a software project, such as its size and the mix of programming languages it uses. It is for developers and managers who want a quick overview of a codebase.

When to use it

  • βœ“When you ask how many lines of code a project has.
  • βœ“When you want a breakdown of the languages used in a repository.
  • βœ“When you want the ratio of code to comments in a project.

Skill link

https://github.com/NousResearch/hermes-agent/blob/main/skills/software-development/codebase-inspection/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/NousResearch/hermes-agent/blob/main/skills/software-development/codebase-inspection/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œHow many lines of code does this repo have, and which languages make up most of it?”

5 new skills a week. 1 minute to read.

How it works

The skill installs the pygount tool if it is missing and runs it on the project folder. It skips folders such as node_modules and build output, so the count is not inflated.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Codebase Inspection with pygount

Analyze repositories for lines of code, language breakdown, file counts, and code-vs-comment ratios using pygount.

When to Use

  • User asks for LOC (lines of code) count
  • User wants a language breakdown of a repo
  • User asks about codebase size or composition
  • User wants code-vs-comment ratios
  • General "how big is this repo" questions

Prerequisites

pip install --break-system-packages pygount 2>/dev/null || pip install pygount

1. Basic Summary (Most Common)

Get a full language breakdown with file counts, code lines, and comment lines:

cd /path/to/repo
pygount --format=summary \
  --folders-to-skip=".git,node_modules,venv,.venv,__pycache__,.cache,dist,build,.next,.tox,.eggs,*.egg-info" \
  .

IMPORTANT: Always use --folders-to-skip to exclude dependency/build directories, otherwise pygount will crawl them and take a very long time or hang.

2. Common Folder Exclusions

Adjust based on the project type:

# Python projects
--folders-to-skip=".git,venv,.venv,__pycache__,.cache,dist,build,.tox,.eggs,.mypy_cache"

# JavaScript/TypeScript projects
--folders-to-skip=".git,node_modules,dist,build,.next,.cache,.turbo,coverage"

# General catch-all
--folders-to-skip=".git,node_modules,venv,.venv,__pycache__,.cache,dist,build,.next,.tox,vendor,third_party"

3. Filter by Specific Language

# Only count Python files
pygount --suffix=py --format=summary .

# Only count Python and YAML
pygount --suffix=py,yaml,yml --format=summary .

4. Detailed File-by-File Output

# Default format shows per-file breakdown
pygount --folders-to-skip=".git,node_modules,venv" .

# Sort by code lines (pipe through sort)
pygount --folders-to-skip=".git,node_modules,venv" . | sort -t$'\t' -k1 -nr | head -20

5. Output Formats

# Summary table (default recommendation)
pygount --format=summary .

# JSON output for programmatic use
pygount --format=json .

# Pipe-friendly: Language, file count, code, docs, empty, string
pygount --format=summary . 2>/dev/null

6. Interpreting Results

The summary table columns:

  • Language β€” detected programming language
  • Files β€” number of files of that language
  • Code β€” lines of actual code (executable/declarative)
  • Comment β€” lines that are comments or documentation
  • % β€” percentage of total

Special pseudo-languages:

  • __empty__ β€” empty files
  • __binary__ β€” binary files (images, compiled, etc.)
  • __generated__ β€” auto-generated files (detected heuristically)
  • __duplicate__ β€” files with identical content
  • __unknown__ β€” unrecognized file types

Pitfalls

  1. Always exclude .git, node_modules, venv β€” without --folders-to-skip, pygount will crawl everything and may take minutes or hang on large dependency trees.
  2. Markdown shows 0 code lines β€” pygount classifies all Markdown content as comments, not code. This is expected behavior.
  3. JSON files show low code counts β€” pygount may count JSON lines conservatively. For accurate JSON line counts, use wc -l directly.
  4. Large monorepos β€” for very large repos, consider using --suffix to target specific languages rather than scanning everything.
FAQ

Does it need special software?

It needs pygount, which the skill installs with pip if it is missing.

Why skip some folders?

The skill says to skip dependency and build folders, because scanning them can take a very long time.

Can it count only one language?

Yes. The skill has a section for filtering results to a specific language.

Details

Original description by the author

Inspect codebases w/ pygount: LOC, languages, ratios.

repo: NousResearch/hermes-agent

Popularity

GitHub stars
260k
Ranking position
#619
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills