cloc
cloc delivers line-count, language composition, and branch-diff statistics for .NET codebases through repeatable, configurable commands. Use it to measure solution footprint, compare code deltas across refs, and track codebase composition—not to assess developer productivity or replace design review.
cloc generates repeatable line-count and language-mix reports for .NET repositories with configurable scope and machine-readable output.
AI-generated summary based on this skill's SKILL.md
Install
managedcode/dotnet-skills/cloc · repository language: C#
git clone https://github.com/managedcode/dotnet-skills
cp -r dotnet-skills/catalog/Tools/cloc/skills/cloc ~/.claude/skills/clocnpx skillfed install managedcode/dotnet-skills/clocFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I count lines of code in my C# project with cloc?
cloc scans your C# project and reports line counts by language, including code, comments, and blank lines. Run `cloc .` in your solution root to generate a summary table. cloc identifies .NET file types automatically and produces repeatable statistics suitable for tracking codebase size over time or across branches.
Can cloc compare code size and composition between Git branches?
Yes. cloc supports branch-diff analysis through `cloc --git-diff-main` or by comparing two refs directly. This lets you measure code deltas between branches or releases, showing which languages grew and by how much. Branch comparisons are useful for sizing decisions and understanding code composition shifts across development cycles.
What is cloc's language mix analysis for .NET solutions?
cloc breaks down your .NET codebase by language—C#, XAML, JSON, XML, and others—reporting lines of code, comments, and blanks for each. This composition view helps you understand solution footprint and identify dominant languages, making it easier to assess codebase complexity and plan maintenance or refactoring efforts.
How do I integrate cloc into my CI pipeline for automated reporting?
cloc outputs JSON, CSV, and plain text formats via command-line flags like `--json` and `--csv`. Pipe output to files in your CI job, then archive or publish results. This enables automated code statistics collection across builds, letting you track metrics over time and detect unexpected code growth or composition changes.
Can cloc exclude bin and obj directories from .NET line counts?
cloc respects `.gitignore` rules and excludes common build artifacts by default, including bin and obj folders. You can also use `--exclude-dir` to skip specific directories. This ensures your line counts reflect source code only, not compiled or generated output, for accurate footprint measurement.
What does cloc measure and what should it not be used for?
cloc delivers repeatable line-count, language composition, and branch-diff statistics for .NET codebases. Use it to measure solution footprint, compare code deltas, and track codebase composition. Do not use cloc to assess developer productivity or replace design review—line counts alone do not reflect code quality or effort.
SKILL.md
rendered from the published skill — quoted content, verbatim
CLOC for .NET Repositories
Trigger On
- the repo wants
cloc - the team needs repeatable LOC, language, or branch diff statistics for a .NET repo
- the user asks about C# codebase size, solution composition, or code-count deltas between refs
Value
- produce a concrete project delta: code, docs, config, tests, CI, or review artifact
- reduce ambiguity through explicit planning, verification, and final validation skills
- leave reusable project context so future tasks are faster and safer
Do Not
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 5 files
catalog/Tools/cloc/skills/cloc/SKILL.md
catalog/Tools/cloc/skills/cloc/manifest.json
catalog/Tools/cloc/skills/cloc/references/cloc.md
catalog/Tools/cloc/skills/cloc/references/commands.md
catalog/Tools/cloc/skills/cloc/references/examples.md