# scc

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

Stars: 8.9k · Language: Go · License: MIT · Categories: Dev Tools

- Repository: https://github.com/boyter/scc
- Page: https://www.trmn.sh/tools/scc

## Install

- Homebrew: `brew install scc`
- Go: `go install github.com/boyter/scc/v4@latest`
- Snap: `sudo snap install scc`

## Overview

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

```bash
# via Homebrew
brew install scc
```

```bash
# via Go
go install github.com/boyter/scc/v4@latest
```

```bash
# via Snap
sudo snap install scc
```

## Alternatives

- [reviewdog](https://www.trmn.sh/tools/reviewdog.md): Parses linter output and posts findings in changed lines as review comments on GitHub, GitLab, and Bitbucket, or filters lint results by diff locally. (Go, 9.7k stars)
- [Terragrunt](https://www.trmn.sh/tools/terragrunt.md): Orchestration tool for OpenTofu/Terraform infrastructure code, used to scale and manage Infrastructure as Code across many modules and environments. (Go, 9.9k stars)
- [Krew](https://www.trmn.sh/tools/krew.md): Package manager for kubectl plugins: discover, install, and manage plugins from a central index, similar to apt, dnf, or brew. (Go, 7.0k stars)
- [Popeye](https://www.trmn.sh/tools/popeye.md): Read-only scanner that lints live Kubernetes clusters for misconfigurations, unused resources, and over/under allocation, with console, JSON, and HTML reports. (Go, 6.5k stars)
- [Docker CLI](https://www.trmn.sh/tools/docker-cli.md): Source repository for the Docker command-line client, written in Go and built with docker buildx bake, with cross-platform and glibc/musl build targets. (Go, 6.1k stars)

---

Canonical: https://www.trmn.sh/tools/scc
