Skip to content

What is CodeCharter?

A deterministic code quality tool for .NET teams that enforces architecture and conventions locally.

CodeCharter is a deterministic code quality tool for .NET teams. It analyzes your solution locally against a rule set of 120+ curated built-in rules plus as many custom rules as you like, written in a small LINQ-like DSL.

What CodeCharter delivers

  • CLI as a self-contained distribution for Windows, Linux, and macOS, usable in any CI without an installed .NET runtime.
  • Versioned rule profiles from the portal (for example codecharter/csharp-all), pinned via .codecharter/config.yml and a lockfile and delivered as signed bundles for reproducible analysis runs.
  • Windows installer for your developers, bundling the CLI and VS Code Extension in a single setup.
  • VS Code Extension with syntax highlighting and auto-completion for the DSL.
  • Official GitHub Action bochmann-software/codeguard@v1, integrated in a few lines of YAML.
  • MCP server built into the CLI (codecharter mcp), with one-command setup for Claude Code, Cursor, Claude Desktop, Windsurf, and Gemini via codecharter mcp install.
  • 120+ built-in rules across multiple categories, including ASP.NET conventions, async best practices, naming, architecture, complexity thresholds, testability, documentation, and error handling.
  • Output in four formats for different CI workflows: console, JSON, SARIF v2.1 (consumed by GitHub Code Scanning and GitLab SAST), and GitHub annotations shown directly on the pull request diff.

Three design decisions

Deterministic

Same source, same rule set, same findings. On every machine, at any time of day. If the build was green yesterday, it is green today.

Local

Analysis runs on the developer machine or CI runner. Source code never leaves your environment.

Architecture as a first-class citizen

Coupling, inheritance, dependencies, and complexity metrics are available directly in the schema. Layering rules and banned references are written in two or three lines of DSL.

@name "Domain layer must not reference Web layer"
@severity error
@category "Architecture"

from t in Types
where t.Namespace.FullName.StartsWith("Acme.Domain")
where t.UsedTypes.Any(u => u.Namespace.FullName.StartsWith("Acme.Web"))
select t

Who should use it

CodeCharter pays off especially for .NET teams of three or more developers with shared code ownership and a growing codebase where enforcing conventions in PRs is difficult.

How CodeCharter ships

Distribution What it contains
CLI (standalone) The full analyzer as a self-contained archive; no installed .NET runtime needed.
Windows installer The CLI plus the VS Code extension and PATH setup; requires the .NET 9 runtime (the installer offers to install it).
VS Code extension Editor integration that runs the CLI and gives live DSL feedback.
GitHub Action Runs the published CodeCharter container image (or a locally installed CLI) and publishes annotations on the pull request.

See Installation for setup details.

Next steps

  • Quick Start: first analysis in five minutes
  • Comparison with alternatives: how we position ourselves against Roslyn, SonarQube, and NDepend
  • Plan overview: what CodeCharter costs. Every CLI command requires a valid license; new accounts start with a 7-day trial.