HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
AlDanial
cloc
Perl2016–2026
AlDanial / cloc

cloc

cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.

34Distinct people
39Mentions
0Explicit recommenders
23.7KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 5:05:26 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year39 dated mentions

Observed mentions: 2016-04-18 20:21:59 UTC to 2026-01-07 21:52:30 UTC.

02462016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 6 mentions; 1 submissions, 5 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 7 mentions; 1 submissions, 6 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 7 mentions; 1 submissions, 6 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC413
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC303
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC202
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC404
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC312
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC615
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC716
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC716
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
cloc Count Lines of Code cloc counts blank lines, comment lines, and physical lines of source code in many programming languages. Latest release: v2.10 (July 4, 2026) cloc moved to GitHub in September 2015 after being hosted at http://cloc.sourceforge.net/ since August 2006. Quick Start Step 1: Install cloc (see Install from Github Releases and Install via package manager) or run cloc's docker image. The Windows executable has no requirements. The source version of cloc requires a Perl interpreter, and the Docker version of cloc requires a Docker installation. Step 2: Open a terminal (cmd.exe on Windows). Step 3: Invoke cloc to count your source files, directories, archives, or git commits. The executable name differs depending on whether you use the development source version (cloc), source for a released version (cloc-2.10.pl) or a Windows executable (cloc-2.10.exe). On this page, cloc is the generic term used to refer to any of these. Include Security has a YouTube video showing the steps in action. a file prompt> cloc hello.c 1 text file. 1 unique file. 0 files ignored. https://github.com/AlDanial/cloc v 1.65 T=0.04 s (28.3 files/s, 340.0 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- C 1 0 7 5 ------------------------------------------------------------------------------- a directory prompt> cloc gcc-5.2.0/gcc/c 16 text files. 15 unique files. 3 files ignored. https://github.com/AlDanial/cloc v 1.65 T=0.23 s (57.1 files/s, 188914.0 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- C 10 4680 6621 30812 C/C++ Header 3 99 286 496 ------------------------------------------------------------------------------- SUM: 13 4779 6907 31308 ------------------------------------------------------------------------------- an archive We'll pull cloc's source zip file from GitHub, then count the contents: prompt> wget https://github.com/AlDanial/cloc/archive/master.zip prompt> cloc master.zip https://github.com/AlDanial/cloc v 1.65 T=0.07 s (26.8 files/s, 141370.3 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Perl 2 725 1103 8713 ------------------------------------------------------------------------------- SUM: 2 725 1103 8713 ------------------------------------------------------------------------------- a git repository, using a specific commit This example uses code from PuDB, a fantastic Python debugger. prompt> git clone https://github.com/inducer/pudb.git prompt> cd pudb prompt> cloc 6be804e07a5db 48 text files. 41 unique files. 8 files ignored. github.com/AlDanial/cloc v 1.99 T=0.04 s (1054.9 files/s, 189646.8 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Python 28 1519 728 4659 reStructuredText 6 102 20 203 YAML 2 9 2 75 Bourne Shell 3 6 0 17 Text 1 0 0 11 make 1 4 6 10 ------------------------------------------------------------------------------- SUM: 41 1640 756 4975 ------------------------------------------------------------------------------- each subdirectory of a particular directory Say you have a directory with three different git-managed projects, Project0, Project1, and Project2. You can use your shell's looping capability to count the code in each. This example uses bash (scroll down for cmd.exe example): prompt> for d in ./*/ ; do (cd "$d" && echo "$d" && cloc --vcs git); done ./Project0/ 7 text files. 7 unique files. 1 file ignored. github.com/AlDanial/cloc v 1.71 T=0.02 s (390.2 files/s, 25687.6 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- D 4 61 32 251 Markdown 1 9 0 38 make 1 0 0 4 ------------------------------------------------------------------------------- SUM: 6 70 32 293 ------------------------------------------------------------------------------- ./Project1/ 7 text files. 7 unique files. 0 files ignored. github.com/AlDanial/cloc v 1.71 T=0.02 s (293.0 files/s, 52107.1 lines/s) ----------------------------
Read the full README on GitHub

What Hacker News says

3 sources
I tried finding the lines of code in each language with cloc. C/C++ Header contains a sum of C and CPP header files. Python has been used across different language dirs as wrapper script or so, otherwise, it's own implementation is probably 1350 lines at max. This would also probably include bugs in cloc. github.com/AlDanial/cloc v 1.70 T=2.86 s (433.6 files/s, 67570.0 lines/s) -------------------------------------------------------------------------------- Language files blank comment code -------------------------------------------------------------------------------- Visual Basic 36 1569 132 8036 Swift 36 1199 1606 7951 SQL 36
Read the rest
956 649 7594 Pascal 19 704 951 6253 Ada 28 1975 380 5856 Elm 19 1619 226 5647 awk 16 290 15 5169 Lisp 37 825 256 4562 VHDL 17 434 32 4228 C# 20 658 346 4175 Python 37 574 394 4018 make 89 1244 873 4010 C 19 466 392 3499 Perl 35 413 171 3450 Go 17 281 148 3397 Rust 18 304 130 3331 JavaScript 43 449 247 3235 Forth 18 516 158 3228 C++ 18 568 71 2986 Java 17 325 135 2938 D 17 363 10 2938 Racket 35 480 385 2740 TypeScript 17 284 56 2740 Markdown 8 714 0 2730 Rexx 17 283 47 2713 Bourne Shell 30 390 315 2692 Tcl/Tk 17 284 43 2416 Dart 16 255 41 2303 F# 20 337 13 2298 Objective C 17 285 150 2189 Erlang 17 277 191 2185 MATLAB 26 184 128 2165 Haxe 19 254 79 2161 Crystal 18 417 58 2146 vim script 17 242 50 2076 Haskell 17 331 99 2000 PHP 18 249 120 1955 Lua 18 248 87 1874 Scala 16 221 113 1816 Elixir 19 366 35 1809 JSON 28 246 0 1765 R 17 201 100 1612 Groovy 17 170 98 1582 Kotlin 17 312 0 1554 Julia 17 189 126 1405 Nim 16 320 36 1397 lex 18 209 0 1355 Ruby 17 167 87 1264 OCaml 15 109 98 1211 PowerShell 11 128 71 1146 ClojureC 15 257 129 1053 CoffeeScript 17 195 126 1037 CSS 6 150 132 792 C/C++ Header 22 266 44 752 HTML 2 36 35 486 Bourne Again Shell 47 1 4 135 YAML 2 6 10 86 Maven 1 2 7 85 Clojure 2 8 12 65 ClojureScript 1 1 0 2 -------------------------------------------------------------------------------- SUM: 1242 24806 10447 158293 --------------------------------------------------------------------------------
In Mal – Make a Lisp, in 68 languages
As always, it depends on the context. Do you know why you were hired? You mentioned "10 devs, QA, BA" .. maybe a good chance to talk to everyone and write down and later agree on a roles & responsibilities matrix. Same goes with process. Talk to everyone and find out what they actually do, write it down and then have an objective discussion if all this is still the best way of doing things / working together. As for the coding side of things: using cloc [1] and cpd [2] proved to be super helpful every single time for me. When talking to current devs you are likely to get a glimpse if what they worked on recently or will work on in the next few weeks. Cloc gives you the whole story from the beginning. Maybe it's a new stack -- but how come there are 1000s of lines of perl code in the repo? Always a joy to dig deeper and learn about the
Read the rest
history. Cpd is a great helper to gauge what your devs actually do vs. what the say. In the heat of deadlines it is often the case that stuff just gets copy and pasted rather than refactored -- which will turn into a nightmare sooner or later. Bonus points for lots of copy/pasting in your test suites and automating cloc & cpd runs .. Also, if everyone is busy adding code/features, be the one who removes stuff that isn't needed anymore. On the learning side: you said you are not familiar with the stack. Are you sure your team is? This is a great opportunity to start a learning/ book reading activity for your team. Last but not least, always assume best intentions. A lot of things probably do not make sense anymore but they did in the past -- find out about the history and you'll earn the trust required to make an impact in the future. [1] http://cloc.sourceforge.net and https://github.com/AlDanial/cloc [2] http://pmd.sourceforge.net/pmd-4.3.0/cpd.html
In Ask HN: How do you become productive in a new project as a senior developer?

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.