scc
Sloc, Cloc and Code: scc is a very fast accurate code counter with complexity calculations and COCOMO estimates written in pure Go
A fast command-line tool that counts lines of code, blanks, and comments across a codebase by programming language, with complexity estimates and COCOMO cost projections.
scc, short for Sloc Cloc and Code, is a command-line tool that counts lines of code in a software project. Given a directory of source files, it scans every file and reports how many lines are actual code, how many are blank, and how many are comments, broken down by programming language. It supports a large number of languages and runs on Windows, Linux, and macOS.
The tool is designed to be extremely fast. It is written in Go and takes advantage of multiple CPU cores, getting faster as more cores are available. Its author created it partly to outperform older alternatives like cloc and sloccount on speed while keeping the results just as accurate. It can be installed through several package managers including Homebrew on Mac, Scoop on Windows, snap on Linux, or by downloading a pre-built binary from the releases page.
Beyond simple line counts, scc offers additional analysis. It can estimate code complexity using a measure similar to cyclomatic complexity, which gives a rough sense of how complicated the logic in a codebase is. It can calculate COCOMO estimates, which are a classic formula used in software engineering to predict how many people and how much time a project of a given size might require to build. It also offers a newer LOCOMO estimate intended to approximate costs when using AI-assisted development. A DRYness metric identifies how many lines are unique versus repeated across files.
Output can be formatted in several ways, including plain text tables, JSON, CSV, and a format compatible with cloc's YAML output, which makes it a drop-in replacement for teams already using cloc in their scripts. It can also run as an MCP server, which is a protocol used by some AI tools to expose capabilities as callable services.
The project is licensed under the MIT licence and is free for individual developers and companies. A commercial enterprise version with team dashboards and historical analysis features was being explored at the time of writing, with early access sign-up available. The full README is longer than what was shown.
Where it fits
- Count lines of code in your project broken down by programming language to understand codebase size and composition.
- Generate a JSON or CSV code metrics report to include in a CI pipeline or project dashboard.
- Estimate cyclomatic complexity scores across files to identify the most complicated parts of a codebase.
- Get a COCOMO estimate predicting developer-hours a codebase represents, useful for project planning or handoffs.