scc

Code counter written in Go that reports lines of code, comments, complexity, ULOC and COCOMO estimates across many languages, with multiple output formats.

install

scc (Sloc, Cloc and Code) is a code counting tool in the same space as cloc, sloccount and tokei. It counts lines of code, blank lines, comment lines and physical lines across many programming languages, and reports the number of bytes processed. It is written in Go and runs on Windows, Linux and macOS.

Beyond line counts, scc estimates code complexity in a manner similar to cyclomatic complexity calculators, calculates COCOMO cost estimates (tunable with flags such as --avg-wage and --cocomo-project-type, or disabled with --no-cocomo), and provides LOCOMO estimation for LLM-based development costs. It can also compute unique lines of code (ULOC) by file, language or project, and can ignore duplicate files, minified files, and large files by line count or bytes. It identifies many files by #! line, and handles details such as C# verbatim strings; blank lines inside comments are counted as comments.

Usage is scc [flags] [files or directories]. --by-file gives a per-file breakdown, --format outputs CSV, JSON, SQL, HTML and other formats (including cloc-style YAML), --count-as maps unrecognised extensions to a known language, and --report generates a self-contained HTML report. Configuration can come from a .sccconfig file, a global file via SCC_CONFIG_PATH, or CLI flags. The table of contents also lists git insight reports and an MCP server mode. It suits developers, teams and CI pipelines that need fast codebase size and complexity metrics.

Installation

# via Homebrew
brew install scc
# via Go
go install github.com/boyter/scc/v4@latest
# via Snap
sudo snap install scc

Alternatives & related tools

add a badge to your README

Maintain scc? Show that it's featured on trmn. The badge links back to this page.

Featured on trmn
Markdown
[![Featured on trmn](https://www.trmn.sh/badge/scc.svg)](https://www.trmn.sh/tools/scc?utm_source=badge)
HTML
<a href="https://www.trmn.sh/tools/scc?utm_source=badge"><img src="https://www.trmn.sh/badge/scc.svg" alt="Featured on trmn" height="20"></a>