# Review a Pull Request in C# With Atlas (2026)

> Atlas reviews a C# pull request by reading whole .cs files rather than hunks, then running the lsp tool's findReferences on every changed method signature.

Atlas reviews a C# pull request the way a careful human does: it gets the diff, then leaves the diff. Atlas's bash tool produces the changed files and the raw patch, and its VCS layer exposes status, diff, diffRaw, and commits over the same git data. read then pulls the full .cs files rather than the hunks, because a diff hides everything it did not touch, and the lsp tool's findReferences checks whether a changed method signature broke a caller in a project the diff never shows. Findings come back as a todowrite list ordered by severity, and `dotnet test` runs the xUnit suite before you sign off.

## Key takeaways

- Atlas's VCS layer exposes status, diff, diffRaw, and commits, so a C# pull request lands in context as a real patch rather than a summary.
- Reading whole .cs files catches what hunks hide: constructor injection, service lifetimes, and the xUnit [Fact] attributes covering the change.
- The lsp tool's findReferences names callers in dependent projects the pull request never included, before the merge rather than after.
- A new optional parameter with a default keeps every C# caller compiling while changing behavior at each one, which no compiler will flag for you.
- `dotnet test` green is a floor for approval, not proof; read what the xUnit assertions actually exercise.

## How do you get a C# pull request's diff into an AI reviewer's context?

Fetch the branch and produce the diff with Atlas's bash tool. Atlas's VCS layer exposes status, diff, diffRaw, and commits over the same git data, so a C# pull request touching 9 .cs files across 3 projects in the .sln lands in context as a real patch rather than a summary.

Start with the raw patch, not a description of it. Run the fetch and the diff through bash, and read what actually changed: the modified method bodies, the new NuGet package references in the .csproj, and any change to a `<TargetFramework>` or `<Nullable>` setting, which alters compilation for the whole project and is easy to skim past. Atlas reads git branches, status, and diffs, and can stage and create commits on your behalf, so the review session is anchored to the real working tree. Note which projects in the solution are affected: a change in a shared library project referenced by 4 others has a blast radius the diff alone will not show you, and that is the number the rest of the review is about.

## Why should a C# reviewer read whole files instead of just the diff hunks?

Atlas reads the changed C# files in full with its read tool, not just the diff hunks, because a hunk that adds an `await` inside a method says nothing about whether the enclosing class is registered as a singleton in Program.cs. In 2026 that combination is still where a real .NET bug lives.

A diff is a lossy view. In C# the loss is specific and dangerous: the hunk shows a changed method but not the class's other members, not the `IDisposable` implementation it must respect, not the constructor injection that decides its lifetime, and not the `[Fact]` and `[Theory]` attributes on the xUnit tests that cover it. Atlas indexes code by AST declarations using tree-sitter, not blind line windows, so reading a file gives you whole method and class declarations rather than a window cut through a `switch` expression. Read the .csproj too. A quietly added NuGet package reference, or a `PackageReference` version bump, can change behavior in ways no .cs hunk reveals, and reviewers skip it almost every time.

## How do you find C# callers a pull request did not touch?

Atlas runs its lsp tool with the findReferences operation on every changed method signature, which is step 3 of the documented review workflow, to name the callers the diff never touched. In a C# solution, a signature change in a shared library project breaks compilation in dependent projects the pull request does not include.

The C# compiler will eventually catch a broken caller, but only if the caller is in the solution and only when someone builds it. findReferences gives you the list during the review, before merge, which is when it is cheap to fix. Pay closest attention to changed optional parameters and changed default values: adding a parameter with a default keeps every caller compiling while silently changing behavior at each one, and that is a review finding no compiler will hand you. Then grep for the patterns the change should have updated but did not: old constant names, stale copies of a modified helper, feature flag strings, and appsettings.json keys. Atlas's grep takes a real regex plus include and path filters, so scoping to `**/*.cs` while including `appsettings*.json` is one pass.

## How do you run and report on a C# pull request's tests?

Atlas runs the tests with its bash tool using `dotnet test`, which executes the xUnit suite across the solution, then reports findings as a todowrite list ordered by severity. In 2026 a pull request that adds a method but no `[Fact]` for it is a review finding, and a green `dotnet test` is a floor for approval, not proof of correctness.

Read what the xUnit tests actually assert, not just whether they are green. A test that mocks the dependency it should be exercising will pass regardless of the change under review. Run `dotnet format --verify-no-changes` too, so formatting noise is separated from substantive changes and the review is about behavior. Then report findings as a todowrite list ordered by severity, so the pull request author gets a triaged list rather than a wall of comments: broken callers found by findReferences first, missing xUnit coverage next, then style. Atlas fans out work to subagents that can run in the foreground or in parallel background sessions, so a large C# pull request can be reviewed project by project in parallel while you read the core change yourself.

## How does Atlas keep a C# code review read-only and safe?

Atlas gates every tool call against 3 rule types, allow, ask, and deny, before it runs, which is how a C# review stays read-only. Deny the edit tools and bash, read, the lsp tool, and grep all keep working, and that is the entire toolset a pull request review needs.

A reviewer should not be able to fix the code by accident. Atlas also drafts a plan in a read-only plan agent and asks before switching to a build agent, which is a natural fit for review: gather findings with no write capability, and only switch to a build agent if you decide to push a fix yourself. If you do edit, Atlas computes a unified diff for every file edit and surfaces it for approval before writing, and Atlas snapshots file changes as git patches so any change can be diffed and rolled back. For a private .NET solution, Atlas can build its code index with local Ollama embeddings, keeping code off third-party servers, so reviewing proprietary C# does not mean shipping it to a vendor's index.

## Steps

1. Run atlas in the C# solution root, the directory with the .sln or the top-level .csproj, so every project in the solution is in scope.
2. Fetch the branch and produce the diff with bash; Atlas's VCS layer exposes status, diff, diffRaw, and commits over the same git data.
3. Read the changed .cs files in full with read, not just the hunks, so class members, constructor injection, and IDisposable implementations outside the diff are visible.
4. Read the .csproj as carefully as the source, checking for a quietly added NuGet PackageReference or a changed TargetFramework or Nullable setting.
5. For every changed method signature, run the lsp tool's findReferences operation to check callers in dependent projects the pull request never touched.
6. Grep for the patterns the change should have updated but did not: old constant names, stale copies of a modified helper, feature flags, and appsettings.json keys.
7. Run `dotnet test` with bash to execute the xUnit suite, and run `dotnet format --verify-no-changes` so formatting noise is separated from behavior.
8. Report findings as a todowrite list ordered by severity: broken callers first, missing xUnit coverage next, then style.

## FAQ

### how to review a C# pull request with an AI agent

Have Atlas produce the raw diff with bash, read the changed .cs files in full rather than the hunks, run the lsp tool's findReferences on every changed method signature, grep for stale constants and appsettings keys, then run `dotnet test` and report findings as a triaged todowrite list.

### can Atlas find C# callers that a pull request forgot to update

Yes. The lsp tool's findReferences operation returns every callsite of a changed method, including callers in dependent projects the pull request never touched. That list is the highest-severity review finding in most C# solutions.

### does Atlas run dotnet test during a code review

Yes, through the bash tool. `dotnet test` executes the xUnit suite across the solution, and `dotnet format --verify-no-changes` separates formatting noise from behavior so the review is about the actual change.

### why read whole files instead of the diff in a C# review

A diff hides everything it did not touch. In C# that means the class's other members, its constructor injection and service lifetime, its IDisposable implementation, and the xUnit tests that cover it, all of which decide whether a changed method is actually correct.

### can an AI reviewer edit my C# code by accident

Not if you deny the edit tools. Every Atlas tool call is permission-gated against allow, ask, and deny rules before it runs, and bash, read, the lsp tool, and grep, which are the whole review toolset, keep working with edits denied.

### what should I check in a .csproj during a C# pull request review

Check for a quietly added NuGet PackageReference, a version bump on an existing one, and any change to TargetFramework or Nullable. Those change compilation and behavior for the whole project and no .cs hunk will show them to you.

### how do I review a very large C# pull request

Atlas fans out work to subagents that can run in the foreground or in parallel background sessions, so a large solution can be reviewed project by project in parallel while you read the core change yourself. Collect the results into one severity-ordered todowrite list.

### how do I start Atlas in a C# project

Run atlas in a solution with a .csproj or .sln. Atlas reads your namespaces, project references, and NuGet packages, and you can ask it to add xUnit tests or refactor async code, reviewing the diff before dotnet build.

---

Canonical HTML: https://runatlas.sh/resources/stacks/review-a-pull-request-in-csharp
Source of truth: aeo_pages row `/resources/stacks/review-a-pull-request-in-csharp` (segment: Stacks) (this file is generated from it, never hand-edited).
Licence: Atlas is proprietary with a free core. It is not open source and there is no public source repository.
