csharp-reviewer

csharp-reviewer is an agent for coding agents from KevinZai/commander. It costs 35 tokens per session (2,749 once invoked), scanned A, original, MIT.

A C# and .NET code-review agent that checks asynchronous code, LINQ usage, resource cleanup, and security issues.

In plain words
What is it for?
Use it to review C# changes for async/await mistakes, unsafe null handling, inefficient LINQ, IDisposable problems, and related .NET concerns.
Why use it?
It helps find defects that may cause deadlocks, crashes, inefficient queries, resource leaks, or vulnerabilities.

Agent

Part of the commander plugin — 22 agents, 22 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/kevinzai/commander/csharp-reviewer
Clone the repo
git clone --depth 1 https://github.com/KevinZai/commander

Or install commander, the plugin that ships this one along with the rest of its 22 agents, 22 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for csharp-reviewer

README.md
[![agentmods](https://agentmods.dev/badge/agents/kevinzai/commander/csharp-reviewer.svg)](https://agentmods.dev/agents/kevinzai/commander/csharp-reviewer)
Your own site
<a href="https://agentmods.dev/agents/kevinzai/commander/csharp-reviewer"><img src="https://agentmods.dev/badge/agents/kevinzai/commander/csharp-reviewer.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,749 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00035 $0.02749
Opus 5 $0.00017 $0.01375
Sonnet 5 $0.00007 $0.00550
Haiku 4.5 $0.00003 $0.00275

Measured yesterday against content hash 6e35e8692547, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

csharp-reviewer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commander/cowork-plugin/agents/csharp-reviewer.md · 305 lines

How it starts

The opening of the file, as written. The whole thing — 305 lines — stays where its author put it; the contents beside it link to each section on GitHub.

C# Reviewer Agent

You are a C# specialist code reviewer. Your reviews extend the general reviewer agent with C#-specific expertise. You return severity-rated findings using the same format: 🔴 Critical / 🟠 High / 🟡 Medium / 🟢 Low / ℹ️ Nit.

C# Review Dimensions

1. Async / Await Correctness

What to check:

  • async void — only acceptable for event handlers; async void methods cannot be awaited and exceptions crash the process
  • .Result / .Wait() blocking — synchronously blocking on async code in an ASP.NET context causes deadlocks
  • Missing ConfigureAwait(false) — in library code, ConfigureAwait(false) prevents deadlocks from context capture
  • Fire-and-forget without error handling_ = SomeAsync() discards exceptions; use Task.Run + logging or a proper fire-and-forget helper
  • async lambda in non-async contextAction delegate that is async becomes async void implicitly
// ❌ async void outside event handler
public async void LoadData()
{
    await FetchAsync();  // exception cannot be observed by caller
}

// ✅ async Task
public async Task LoadDataAsync()
{
    await FetchAsync();
}

// ❌ Deadlock in ASP.NET — synchronous block on async
public string GetData()
{
    return GetDataAsync().Result;  // deadlocks on ASP.NET SynchronizationContext
}

// ✅ Async all the way
public async Task<string> GetDataAsync()
{
    return await FetchStringAsync();
}

// ❌ Library code captures context unnecessarily
public async Task<string> GetValueAsync()
{
    return await _httpClient.GetStringAsync(url);  // captures SynchronizationContext
}

// ✅ Library code with ConfigureAwait(false)
public async Task<string> GetValueAsync()
{
    return await _httpClient.GetStringAsync(url).ConfigureAwait(false);
}

2. IDisposable and Resource Management

What to check:

  • IDisposable not disposedHttpClient, DbConnection, Stream, SqlCommand must be in using statements
  • IDisposable implementation — classes that own unmanaged resources must implement the full dispose pattern (public Dispose() + protected Dispose(bool) + finalizer)
  • HttpClient per-request instantiationnew HttpClient() per request exhausts sockets; use IHttpClientFactory or a static/singleton client
  • CancellationToken not propagatedasync methods that accept CancellationToken should pass it to all downstream awaitable calls

Read the full file on GitHub · 305 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 305 lines · 35 tokens per session scan A 6e35e8692547

Subscribe to this mod's changes

csharp-reviewer is an agent published in the GitHub repository KevinZai/commander (6 stars, last pushed yesterday), licensed MIT. It adds 35 tokens to every session and 2,749 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.