· via Hacker News – Front Page (native)
Graphify C# gives coding agents compiler-accurate Find Usages via Roslyn
A free MIT-licensed Roslyn indexer outputs a JSON semantic graph of C# code so agents can resolve exact callers, implementations and test-only usage without grep-style guessing.
What Graphify C# does
Graphify C# is a free, MIT-licensed command-line indexer that gives coding agents compiler-accurate Find Usages for C#. According to the project's README, which reached Hacker News's front page via a Show HN post, the tool loads a codebase through MSBuild and asks Roslyn, the C# compiler platform, what every symbol actually resolves to. The result is a single JSON document of nodes, edges and hyperedges capturing compiler-resolved callers, references, implementations, inheritance and override relationships, surviving overloads, generics and cross-project references.
The project needs no IDE, no compiled project DLL and no database, and the separate Graphify tool is optional. Its author positions it as the semantic-navigation slice of Rider or ReSharper, exported for agents such as Codex and Claude Code. The repository advertises support for C# 15 syntax.
Why grep is not enough
The README's motivating example is the question of which methods are used only by tests. A text search can find matching spellings, but it cannot tell which overload was bound, which project a caller lives in, or whether an interface implementation is the symbol you meant. Graphify C# instead emits stable identities and directed relationships an agent can inspect rather than infer.
The README demonstrates with the tool's own code: an internal test helper shows exactly one compiler-resolved incoming call, from a named test class with a file and line number attached. An agent can classify the method as test-only and flag it for human review, which is semantic evidence rather than a match count.
Install, index, teach the agent
The tool installs as a .NET global tool targeting net10.0 and runs against .sln, .slnx, .csproj or SDK-style file-based .cs inputs, writing a complete JSON snapshot. The repository's SDKs, packages and MSBuild inputs must be available locally. The output can be read directly by an agent, queried with jq, or consumed from your own code.
A bundled skill file teaches Codex- and Claude Code-compatible agents when to refresh the index, how to follow semantic edges, and where static analysis stops; for setups without skills, the README supplies a short project-instruction snippet instead. A watch mode keeps the Roslyn workspace warm and prepares changed projects in the background, while a plain invocation acts as a refresh barrier that returns only after a complete, current snapshot. A rebuild flag invalidates the incremental cache.
What the index covers
Declarations range from namespaces, classes, structs, interfaces, records, enums and delegates down to constructors, methods, operators, local functions, properties, indexers, fields, events, parameters, locals and type parameters. Relationship edges cover direct and constructor calls, method groups and member access; field, type, attribute, generic and typeof references; inherits, implements and overrides; and compiler-selected operators, conversions, deconstruction, foreach, await, using, patterns, ranges and collection expressions. Invocation arguments are bound to source formal parameters, and every edge carries project, target-framework, source-location and provenance metadata. Constructs the extractor cannot handle are reported as diagnostics rather than disappearing silently or crashing the run.
Deliberate scope, not an IDE or NDepend clone
The README draws clear boundaries: Rider and ReSharper serve developers with interactive navigation, inspections and refactorings inside an IDE, while NDepend is a broad commercial architecture and code-quality suite. Graphify C# acknowledges overlap with NDepend around callers, dependencies, inheritance and dead-code investigation, but frames itself as a headless, open-format Roslyn semantic index that other tools can build on. Used with Graphify, it feeds higher-level query, path, explanation and clustering workflows; used alone, it is just JSON that any consumer can query.
Why it matters
Coding agents mostly navigate code with fuzzy or text-based search, which is exactly where C# hurts: overloads, generics and interface implementations make name matches unreliable. A deterministic, compiler-resolved graph turns questions like which declaration calls this exact overload, which classes implement an interface, or which members have zero inbound references into inspectable facts rather than probabilistic guesses. The project is candid about limits, noting that zero inbound edges is observed static evidence, not proof of runtime unreachability, and that local builds still need the right SDKs and packages. Even so, as agentic coding workflows mature, tools that hand agents compiler-grade evidence instead of grep-shaped approximations point at where the toolchain is heading.
- #c-sharp
- #roslyn
- #coding-agents
- #developer-tools
- #open-source