# sagemath/sage SLOC report

> As of 2026-08-27 (commit 8bed9c3744bf), sagemath/sage contains 2,907,138 total lines: 2,624,400 code, 117,143 comments, 165,595 blank, across 4,444 files in 29 languages (top: Python 72.7%). Custom configuration (tests excluded, docs excluded, generated excluded). Counted with tokei via OctoCounts.

sagemath/sage has 2,624,400 source lines of code out of 2,907,138 total lines across 4,444 files, counted from the develop ref at commit 8bed9c3744bf by the OctoCounts tokei engine on 2026-08-27. The report is cached by commit, tokei version, and analysis options, so recounting the same revision returns exactly these numbers.

OctoCounts produced this report by resolving sagemath/sage to commit 8bed9c3744bf, downloading the repository source archive, and counting every source file 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, so counting the same revision again reproduces exactly these numbers.

## Repository size insights

This is a very large codebase by counted code lines. Code represents 90.3% of all lines, comments represent 4.0%, and the repository averages 591 code lines per file. Python accounts for 72.7% of counted code.

| Language | Files | Lines | Code | Comments | Blanks |
| --- | ---: | ---: | ---: | ---: | ---: |
| Python | 2,503 | 2,080,390 | 1,908,880 | 65,644 | 105,866 |
| Cython | 1,317 | 722,353 | 647,419 | 28,534 | 46,400 |
| C++ | 64 | 44,374 | 29,602 | 9,764 | 5,008 |
| C Header | 258 | 13,668 | 8,284 | 3,191 | 2,193 |
| Meson | 116 | 7,873 | 7,231 | 194 | 448 |
| YAML | 17 | 6,728 | 6,666 | 47 | 15 |
| M4 | 46 | 6,913 | 4,461 | 1,970 | 482 |
| C | 8 | 2,574 | 1,922 | 325 | 327 |
| C++ Header | 4 | 2,424 | 1,732 | 292 | 400 |
| JSON | 3 | 1,633 | 1,632 | 0 | 1 |
| INI | 9 | 1,999 | 1,275 | 550 | 174 |
| BASH | 6 | 1,515 | 1,116 | 219 | 180 |

Top language (Python 72.7%). Generated at 2026-08-27T20:19:22.065470656+00:00. Canonical report: https://octocounts.com/github/sagemath/sage

## Reproduce this report

[Reproduce this exact report and configuration](https://octocounts.com/github/sagemath/sage/commit/8bed9c3744bfeaf3a443ad428dbcfe300b1a1b75?analysis=%7B%22ignoredDirs%22%3A%5B%5D%2C%22ignoredLanguages%22%3A%5B%5D%2C%22profile%22%3A%22default%22%2C%22includeDocs%22%3Afalse%2C%22includeTests%22%3Afalse%2C%22includeGenerated%22%3Afalse%7D).

## Report FAQ

### How many lines of code does sagemath/sage have?

sagemath/sage has 2,907,138 total lines, including 2,624,400 code lines, 117,143 comment lines, and 165,595 blank lines.

### How was the sagemath/sage line count measured?

OctoCounts resolved the public GitHub repository to commit 8bed9c3744bf, downloaded the source archive, counted it with tokei, and cached the report by commit, tokei version, and analysis options.

### What commit was counted for sagemath/sage?

This OctoCounts report was generated from develop at commit 8bed9c3744bf on 2026-08-27T20:19:22.065470656+00:00.

## Similar repository reports

- [pytorch/pytorch](https://octocounts.com/github/pytorch/pytorch) — Python, 2,563,680 code lines
- [apache/airflow](https://octocounts.com/github/apache/airflow) — Python, 1,709,773 code lines
- [home-assistant/core](https://octocounts.com/github/home-assistant/core) — Python, 1,513,961 code lines
- [nousresearch/hermes-agent](https://octocounts.com/github/nousresearch/hermes-agent) — Python, 1,446,188 code lines
- [comet-ml/opik](https://octocounts.com/github/comet-ml/opik) — Python, 1,415,239 code lines
- [NousResearch/hermes-agent](https://octocounts.com/github/NousResearch/hermes-agent) — Python, 1,268,423 code lines

## Related OctoCounts pages

- [Recently analyzed repositories](https://octocounts.com/recent)
- [Popular SLOC reports](https://octocounts.com/popular)
- [Trending GitHub repositories](https://octocounts.com/trending)
- [Hall of Monoliths](https://octocounts.com/hall-of-monoliths)
- [TensorFlow vs PyTorch](https://octocounts.com/compare/tensorflow-vs-pytorch)
- [Django vs Ruby on Rails](https://octocounts.com/compare/django-vs-rails)
- [Laravel vs Django](https://octocounts.com/compare/laravel-vs-django)
- [GitHub SLOC counter guide](https://octocounts.com/docs/github-sloc-counter)
- [Counting methodology](https://octocounts.com/docs/methodology)
- [SLOC and code metrics glossary](https://octocounts.com/docs/glossary)
- [Original research: how filtering changes SLOC counts](https://octocounts.com/research)
- [OctoCounts API docs](https://octocounts.com/docs/api)
