cloc is a command-line tool that counts blank lines, comment lines, and physical lines of source code across many programming languages.
The tool addresses the need to measure code volume and composition by parsing source files and categorizing each line as blank, comment, or code. It works by recognizing language-specific comment syntax and blank line patterns, then aggregating these counts across files and directories. This approach allows developers to quickly understand the scale and structure of codebases without manual inspection.
cloc suits developers and teams who need to audit code metrics for project estimation, documentation, or codebase analysis. It works well for quick assessments of existing projects, comparing code volume across versions, or generating reports on code composition. The tool handles many programming languages out of the box, making it practical for polyglot codebases where a single unified metric is useful.
The project shows steady maintenance with regular updates addressing edge cases and adding support for additional languages. Bug reports receive attention and are resolved through incremental improvements to the parsing logic. The codebase remains focused on its core counting functionality without scope creep into unrelated features.