Skip to content

ctoc

Count code lines and tokens in one pass

Visit official site

What ctoc is

The tool is described as a fast code statistics utility that counts lines and tokens. It extends an existing line counter and keeps its command style.

What you can do with it

  • Count code lines in a project
  • Count tokens across the code base
  • Break results down by language and by file

Example commands

  • Print token counts per Go file with by-file and language flags
  • Output statistics in JSON format
  • Run the default command to show line and token counts

Pros & cons

✓ What we like

  • Compatible with all gocloc functions
  • Useful for prompt engineering and token cost estimates

! What to watch out for

  • Counts follow the language and file flags you pass
  • The tool extends an existing line counter

FAQ

What does it count?

The material states it counts code lines and token numbers.

What formats are listed?

The material lists per language, per file and JSON output, plus gocloc command compatibility.

Last reviewed: 2026-11-15

More AI coding tools tools

View all →

How we review