Graphify C# provides compiler-accurate semantic indexing for AI coding agents
A new open-source tool called Graphify C has been released to enhance the capabilities of AI coding agents working with C codebases. Unlike standard text-based search methods, this headless indexer leverages Roslyn and MSBuild to generate compiler-accurate semantic evidence. It resolves complex relationships such as method overloads, generics, and cross-project references, providing agents with…
Key points
- Graphify C# uses Roslyn to provide compiler-accurate semantic data for AI coding agents.
- The tool outputs JSON graphs enabling agents to resolve overloads and cross-project references.
- It is MIT-licensed, headless, and integrates with agents like Codex and Claude Code via skills.
The tool outputs a structured JSON document containing nodes and edges that represent the code's semantic graph. This allows agents like Codex or Claude Code to answer specific queries, such as identifying which methods are used exclusively by tests or finding all implementations of an interface. The project is MIT-licensed and requires no IDE, database, or compiled DLLs, making it lightweight and easy to integrate into existing workflows.
By distinguishing between static evidence and runtime behavior, Graphify C# helps agents avoid false positives in code analysis. It includes a watcher mode for continuous indexing and integrates with the broader Graphify ecosystem for advanced graph querying. This approach aims to bridge the gap between static analysis tools and the dynamic needs of autonomous coding assistants.
Show HN: Graphify C# – Compiler-accurate Find Usages for coding agents
github.com · 12 September 2026Give coding agents compiler-accurate Find Usages for C#.
graphify-csharp is a free, headless Roslyn/MSBuild indexer that turns C#
source into deterministic, queryable semantic evidence: compiler-resolved
callers, references, implementations, inheritance, and overrides—even across
overloads, generics, and projects.
Think of it as the semantic-navigation slice of Rider/ReSharper, exported for Codex, Claude Code, and other coding agents.
MIT licensed · No IDE · No compiled project DLL required · No database · Graphify optional
Suppose you ask:
Which methods are used only by tests?
A text search can find matching spellings. It cannot reliably tell which overload was bound, which project the caller belongs to, or whether an interface implementation is the symbol you meant.
Graphify C# loads the project through MSBuild and asks Roslyn what every symbol actually means. It emits stable identities and directed relationships that an agent can inspect instead of infer:
For example, this repository contains an internal
DeclarationCatalogBuilder.ForTesting(...) method. From the extracted graph,
an agent can see one compiler-resolved incoming call:
Graphify.CSharp.Roslyn.DeclarationCatalogBuilder.ForTesting(...)
└── called by Graphify.CSharp.Tests.Roslyn.CSharp14FeatureTests
at tests/Graphify.CSharp.Tests/Roslyn/CSharp14FeatureTests.cs:143
That is semantic evidence, not a text-match count. A consumer can classify the caller by project or namespace convention and report the method as test-only for human review.
`dotnet tool install --global Graphify.CSharp --framework net10.0````
graphify-csharp
--input ./src/MyProduct.sln
--root .
--configuration Release
--output ./graphify-out/csharp.json
The result is one complete JSON document containing `nodes`, `edges`, and
`hyperedges`. It can be read directly by an agent, queried with `jq`, consumed
from your own code, or passed to Graphify.
Supported inputs are `.sln`, `.slnx`, `.csproj`, and SDK file-based `.cs` apps.
The repository's SDKs, packages, and MSBuild inputs must be available locally.
The included `graphify-csharp` skill
is a self-contained guide to using the installed CLI on your codebase: refresh
the index, follow semantic edges, and interpret static-analysis limits. The
NuGet installation above supplies the executable; this Markdown file supplies
the agent's usage instructions. It contains no extractor development or
release workflow.
Install it in a Codex-compatible project:
mkdir -p .agents/skills/graphify-csharp
curl -fsSL
https://raw.githubusercontent.com/zachsaw/graphify-csharp/main/.agents/skills/graphify-csharp/SKILL.md
-o .agents/skills/graphify-csharp/SKILL.md
For Claude Code, use `.claude/skills/graphify-csharp/SKILL.md` instead. Reload
an agent session after installing or updating the skill. If you installed an
earlier copy, replace it with the current consumer-only version. See
agent setup for personal, machine-wide locations.
If you do not use skills, add this to your project instructions:
For C# structure and usage questions, refresh
`graphify-out/csharp.json` with `graphify-csharp` before answering. Identify
declarations by `symbol_key` and inspect incoming `calls` and `references`
edges. Treat zero inbound edges as observed static evidence, not proof of
runtime unreachability.
Now ask your agent:
- What calls this exact overload or constructor?
- Which source declarations reference this field, property, event, or type?
- Which classes implement this interface?
- Which members override this virtual or interface member?
- Which declarations have zero observed inbound references?
- Which methods are referenced only from test projects?
The extractor supplies the facts. Your agent or downstream consumer decides what those facts mean: test-only usage, zero observed references, a deletion candidate, or something requiring human review.
Graphify C# deliberately covers a focused layer:
- **Rider and ReSharper** provide interactive navigation, inspections,
refactorings, and quick fixes for developers inside an IDE.
- **NDepend** provides a broad, commercial architecture and code-quality suite
built around dependency analysis, metrics, rules, reports, baselines, and
visualizations.
- **Graphify C#** provides source-level C# semantic evidence for coding agents,
headlessly and in an open format.
There is real overlap with NDepend around callers, dependencies, inheritance, and dead-code investigation. The difference is the product boundary: Graphify C# is not a free NDepend clone or an IDE replacement. It is a Roslyn-native semantic index that other tools and agents can build on.
Graphify C# is standalone. It does not invoke, load, or require Graphify.
Without Graphify, query the JSON with an agent, `jq`, C#, Python, or any other
consumer. For example, list every indexed method:
jq '.nodes[] | select(.properties.node_kind == "method")'
graphify-out/csharp.json
With Graphify, refresh the C# evidence and use its higher-level query, path, explanation, clustering, and export workflows:
graphify-csharp
--input ./src/MyProduct.sln
--root .
--configuration Release
--output ./graphify-out/csharp.json
graphify query "Which methods call the order service?"
--graph ./graphify-out/csharp.json
Graphify remains the general graph workflow. `graphify-csharp` contributes the
C# layer where compiler binding matters. If you use Graphify's general skill,
keep it alongside the C# skill and refresh the C# evidence before each C# graph
query or export. Installing either skill does not install its executable.
- Namespaces, classes, structs, interfaces, records, enums, and delegates
- Constructors, methods, operators, and local functions
- Properties, indexers, fields, enum members, and events
- Parameters, locals, type parameters, aliases, labels, and query range variables
- Direct calls, constructor calls, method groups, and member access
- Field, type, attribute, generic, `typeof` , and declaration-header references
- `inherits` ,`implements` , and`overrides`
- Compiler-selected operators, conversions, deconstruction, `foreach` ,`await` ,`using` , patterns, ranges, and collection expressions
- Invocation and constructor arguments bound to source formal parameters
- Cross-project relationships with overload-aware, project/TFM-aware identity
Every edge points from the declaration where the relationship was observed to the declaration Roslyn resolved. Source location and provenance are retained. Unsupported semantic shapes are reported as diagnostics instead of silently disappearing or crashing the entire extraction.
See Compatibility for the complete language and compiler-feature matrix.
For repeated agent work, start a watcher:
graphify-csharp
--input ./src/MyProduct.sln
--root .
--configuration Release
--output ./graphify-out/csharp.json
--watch
The watcher keeps the Roslyn workspace warm and prepares changed projects in
the background. A normal `graphify-csharp` invocation acts as an explicit
refresh barrier and returns only after a complete JSON snapshot is current.
If no matching watcher is running, the same command performs a one-shot
refresh. Use `--rebuild` to invalidate the incremental cache.
See Usage and Incremental indexing for watcher ownership, filtering, recovery, and cache behavior.
The package contains two tool assets:
Install or update the package with `dotnet tool ... --framework` to select the
tool runtime and Roslyn asset:
`dotnet tool update --global Graphify.CSharp --framework net11.0`
This is separate from the optional `--target-framework` argument, which chooses
one analyzed compilation when an input project targets multiple frameworks.
Single-target projects do not need `--target-framework`.
Graphify C# reports what Roslyn can observe statically. Reflection, dependency injection, native callbacks, dynamic invocation, and code absent from the loaded compilation may create runtime relationships that are not represented as direct edges.
Consequently:
- zero inbound references means **zero observed static references** ;
- a test-only result depends on your project or namespace classification; and
- every deletion candidate still requires judgment.
The tool exposes this boundary instead of pretending static evidence is a runtime reachability proof.
Contributing to the indexer itself? The repository's AGENTS.md contains its architecture, performance, and testing guidance. Those rules apply here and are separate from the consumer skill installed in your projects.
dotnet restore Graphify.CSharp.sln dotnet build Graphify.CSharp.sln --configuration Release dotnet test Graphify.CSharp.sln --configuration Release dotnet pack src/Graphify.CSharp.Cli --configuration Release
More detail:
This text was published by github.com . It is reproduced here with attribution so you can read it in full; the rights remain with the publisher. Read it at the source ↗
Coverage and discussion
1 source- Hacker News discussion · 41 points news.ycombinator.com
The headline, key points and digest above were generated by Digest AI's editorial model from the linked sources. Automated summaries can contain errors: the sources are the record. Spotted a mistake? Tell us.
More in Agents & Tools
All →- OpenAI agents uploaded malicious RubyGems packages in May, researchers say · 12 src
- Local AI email assistant "Mira" lets user bypass Gmail inbox · 1 src
- Virginia man’s life changes after trying Google’s Gemini chatbot · 1 src
- iLands AI Agent Spam Targeting Freelancers with $25 Offers · 1 src
- OpenAI adds ‘Reference my writing style’ feature to ChatGPT, lets AI mimic your voice · 23 src
Comments
via GitHub Discussions