Give coding agents compiler-accurate Find Usages for C#
Give coding agents compiler-accurate Find Usages for C#. Task: The workflow uses graphify-csharp, a headless Roslyn/MSBuild indexer, to convert C# solutions into deterministic semantic graphs containing exact callers, references, and inheritance. Coding agents query this graph to identify test-only usage or dead code candidates by applying naming conventions to the returned evidence. A human reviewer must validate these findings before any code deletion or refactoring, as the tool provides static analysis rather than runtime proof.; tools: custom-built or unnamed agent. Human role: The original post does not say how a person stayed involved.; limitations: Prerequisites include .NET 10 or 11 SDKs and a C# solution/project structure. The tool provides compiler evidence, not runtime reachability proof; reflection, DI, and dynamic invocations may create relationships invisible to static analysis. Human review is mandatory for deletion candidates to check entry points and external consumers. Integration requires configuring agent skills or instructions to interpret the JSON output correctly..
Tools
custom-built or unnamed agent
Published on Agent Work Atlas:
Overview
Give coding agents compiler-accurate Find Usages for C#.
Workflow
The workflow uses graphify-csharp, a headless Roslyn/MSBuild indexer, to convert C# solutions into deterministic semantic graphs containing exact callers, references, and inheritance. Coding agents query this graph to identify test-only usage or dead code candidates by applying naming conventions to the returned evidence. A human reviewer must validate these findings before any code deletion or refactoring, as the tool provides static analysis rather than runtime proof.
Reported result
The source describes the tool's capabilities and intended workflow but does not report specific measured outcomes, success rates, or failure cases from actual business deployments. It emphasizes that agents can reliably distinguish overloads and project boundaries compared to text search, but actual impact metrics are unknown. A measurable acceptance check would be verifying that the agent correctly identifies all callers of a specific overloaded method in a sample project without false positives.
Human role
The original post does not say how a person stayed involved.
Limitations
Prerequisites include .NET 10 or 11 SDKs and a C# solution/project structure. The tool provides compiler evidence, not runtime reachability proof; reflection, DI, and dynamic invocations may create relationships invisible to static analysis. Human review is mandatory for deletion candidates to check entry points and external consumers. Integration requires configuring agent skills or instructions to interpret the JSON output correctly.
Try it
I need to analyze a C# codebase to find methods used only by tests. First, install graphify-csharp globally using dotnet tool install --global Graphify.CSharp --framework net10.0. Navigate to my repository root [replaceable: path to repo] and run graphify-csharp export --input ./src/[replaceable: solution name].sln --root . --output ./graphify-out/csharp.json. Then, use an agent to query this JSON file. Ask the agent: 'Which methods have zero inbound static references from non-test projects?' The agent should filter nodes where 'project' does not contain 'Tests' and check for incoming 'calls' edges. Output a list of candidate methods with their file paths and line numbers. Before deleting any code, I will manually review each candidate to ensure no reflection or DI usage exists. Start with a dry run on a small subset of files to verify the agent's query logic is correct.
Source reports are not independently verified. Publication date is the catalog publication date, not the original article date.