NetHack/NetHack has 395,442 source lines of code out of 552,398 total lines across 888 files, counted with tokei from the NetHack-5.0 ref at commit baf8e7186ff1 on November 8, 2026. Tests, docs and generated files are excluded under OctoCounts' canonical public options.
As of 2026-11-08 (commit baf8e7186ff1), NetHack/NetHack contains 552,398 total lines: 395,442 code, 106,384 comments, 50,572 blank, across 888 files in 22 languages (top language: C 80.3%). Canonical public options (tests, docs and generated files excluded). Counted with tokei via OctoCounts.
OctoCounts produced this report by resolving NetHack/NetHack to commit baf8e7186ff1, downloading the repository source archive, and counting files selected by the effective rules with tokei, the open-source line counter written in Rust. The table below breaks the count down by programming language into files, total lines, code lines, comment lines, and blank lines, so the figures can be compared across languages and projects. Results are cached by commit, tokei version, and analysis options; an exact reproduction needs the same commit, engine version, and effective counting rules.
This is a large codebase by counted code lines. Code represents 71.6% of all lines, comments represent 19.3%, and the repository averages 445 code lines per file. C accounts for 80.3% of counted code.
| Language | Files | Lines | Code | Comments | Blanks |
|---|---|---|---|---|---|
| C | 345 | 414721 | 317482 | 57548 | 39691 |
| C Header | 252 | 51910 | 36211 | 9942 | 5757 |
| Lua | 132 | 17589 | 14134 | 2322 | 1133 |
| C++ | 28 | 18800 | 14025 | 2826 | 1949 |
| Visual Studio Project | 18 | 3055 | 3055 | 0 | 0 |
| R | 8 | 2467 | 2407 | 11 | 49 |
| Perl | 25 | 3364 | 2219 | 691 | 454 |
| Makefile | 6 | 2614 | 1698 | 444 | 472 |
| Python | 8 | 1273 | 1035 | 70 | 168 |
| Shell | 12 | 1184 | 786 | 277 | 121 |
| MSBuild | 10 | 558 | 551 | 5 | 2 |
| Visual Studio Solution | 2 | 381 | 379 | 0 | 2 |
Top language: C 80.3%. Generated on .
NetHack/NetHack: tokei-15.0.0, policy directories-v1; docs excluded, tests excluded, generated excluded. Excluded directory names: .cache, .generated, .git, .next, __tests__, build, dist, doc, docs, documentation, fixtures, gen, generated, node_modules, target, test, tests, vendor. Ignored languages: none. Repository declarations: off. Exclusions are rule-based; they do not prove that every test, document or generated file was removed.
Saved reports remain subject to cache cleanup and replacement. Export the JSON or text for durable citation; live repository URLs can change.
NetHack/NetHack has 395,442 lines of code, plus 106,384 comment lines and 50,572 blank lines, for 552,398 total lines at commit baf8e7186ff1 on November 8, 2026. Tests, docs and generated files are excluded under OctoCounts' canonical public options.
OctoCounts resolved the public GitHub repository to commit baf8e7186ff1, downloaded the source archive, counted it with tokei, and cached the report by commit, tokei version, and analysis options.
This OctoCounts report was generated from NetHack-5.0 at commit baf8e7186ff1 on November 8, 2026.
Other public repositories with an OctoCounts report, ranked by top language and code size similarity:
Play the growth animation for NetHack/NetHack on this page — 395,442 code lines across 22 languages, counted by tokei.