| name | codebase-inspection |
| description | Inspect and analyze codebases using pygount for LOC counting, language breakdown, and code-vs-comment ratios. Use when asked to check lines of code, repo size, language composition, or codebase stats. |
| zh_description | 用于用 pygount 检查代码行数、语言构成、仓库规模和代码/注释比例。 |
| version | 1.0.0 |
| author | Hermes Agent |
| source | in-house |
| source_url | |
| license | MIT |
| tags | [LOC, Code Analysis, pygount, Codebase, Metrics, Repository] |
| created_at | 2026-04-13 |
| updated_at | 2026-06-29 |
| quality | 4 |
| complexity | intermediate |
| metadata | null |
| hermes | null |
| related_skills | [github-repo-management] |
| prerequisites | null |
| commands | [pygount] |
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:
--folders-to-skip=".git,venv,.venv,__pycache__,.cache,dist,build,.tox,.eggs,.mypy_cache"
--folders-to-skip=".git,node_modules,dist,build,.next,.cache,.turbo,coverage"
--folders-to-skip=".git,node_modules,venv,.venv,__pycache__,.cache,dist,build,.next,.tox,vendor,third_party"
3. Filter by Specific Language
pygount --suffix=py --format=summary .
pygount --suffix=py,yaml,yml --format=summary .
4. Detailed File-by-File Output
pygount --folders-to-skip=".git,node_modules,venv" .
pygount --folders-to-skip=".git,node_modules,venv" . | sort -t$'\t' -k1 -nr | -20