Give coding agents compiler-accurate Find Usages for C#.
graphify-csharp is simply 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 arsenic the semantic-navigation portion of Rider/ReSharper, exported for Codex, Claude Code, and different coding agents.
MIT licensed · No IDE · No compiled task DLL required · No database · Graphify optional
Stop making your supplier guess
Suppose you ask:
Which methods are utilized only by tests?
A matter hunt tin find matching spellings. It cannot reliably show which overload was bound, which task the caller belongs to, aliases whether an interface implementation is the awesome you meant.
Graphify C# loads the task done MSBuild and asks Roslyn what each symbol actually means. It emits unchangeable identities and directed relationships that an agent tin inspect alternatively of infer:
| Matching names look for illustration usages | Roslyn resolves the nonstop declaration |
| Overloads and generics are ambiguous | Bound signatures and project/TFM personality are retained |
| Test-only usage requires manual inspection | Every caller carries project, namespace, and root location |
| Type relationships are reconstructed from text | inherits, implements, and overrides are definitive edges |
For example, this repository contains an internal DeclarationCatalogBuilder.ForTesting(...) method. From the extracted graph, an supplier tin spot 1 compiler-resolved incoming call:
That is semantic evidence, not a text-match count. A user tin categorize the caller by task aliases namespace normal and study the method arsenic test-only for quality review.
The consequence is 1 complete JSON archive containing nodes, edges, and hyperedges. It tin beryllium publication straight by an agent, queried pinch jq, consumed from your ain code, aliases passed to Graphify.
Supported inputs are .sln, .slnx, .csproj, and SDK file-based .cs apps. The repository's SDKs, packages, and MSBuild inputs must beryllium disposable locally.
3. Teach your supplier to usage it
The included graphify-csharp skill teaches an supplier erstwhile to refresh the index, really to travel semantic edges, and where fixed study stops.
Install it successful a Codex-compatible project:
For Claude Code, usage .claude/skills/graphify-csharp/SKILL.md instead. Reload an supplier convention aft installing aliases updating the skill.
If you do not usage skills, adhd this to your task instructions:
For C# building and usage questions, refresh graphify-out/csharp.json pinch graphify-csharp earlier answering. Identify declarations by symbol_key and inspect incoming calls and references edges. Treat zero inbound edges arsenic observed fixed evidence, not impervious of runtime unreachability.
Now inquire your agent:
- What calls this nonstop overload aliases constructor?
- Which root declarations reference this field, property, event, aliases type?
- Which classes instrumentality this interface?
- Which members override this virtual aliases interface member?
- Which declarations person zero observed inbound references?
- Which methods are referenced only from trial projects?
From IDE navigation to supplier evidence
| Find Usages | Directed, compiler-resolved calls and references edges |
| Jump to Implementation | implements edges to the nonstop interface contract |
| Navigate guidelines and derived types | inherits and overrides edges |
| Disambiguate overloads and generics | Stable awesome identities pinch bound signature information |
| Inspect a ample solution | Project, target-framework, source-location, and provenance metadata |
| Keep navigating while editing | Incremental indexing pinch an optional lukewarm watcher |
The extractor supplies the facts. Your supplier aliases downstream user decides what those facts mean: test-only usage, zero observed references, a deletion candidate, aliases thing requiring quality review.
Graphify C# deliberately covers a focused layer:
- Rider and ReSharper supply interactive navigation, inspections, refactorings, and speedy fixes for developers wrong an IDE.
- NDepend provides a broad, commercialized architecture and code-quality suite built astir dependency analysis, metrics, rules, reports, baselines, and visualizations.
- Graphify C# provides source-level C# semantic grounds for coding agents, headlessly and successful an unfastened format.
There is existent overlap pinch NDepend astir callers, dependencies, inheritance, and dead-code investigation. The quality is the merchandise boundary: Graphify C# is not a free NDepend clone aliases an IDE replacement. It is simply a Roslyn-native semantic scale that different devices and agents tin build on.
Use it pinch Graphify—or without it
Graphify C# is standalone. It does not invoke, load, aliases require Graphify.
Without Graphify, query the JSON pinch an agent, jq, C#, Python, aliases immoderate other consumer. For example, database each indexed method:
With Graphify, refresh the C# grounds and usage its higher-level query, path, explanation, clustering, and export workflows:
Graphify remains the wide chart workflow. graphify-csharp contributes the C# furniture wherever compiler binding matters.
- Namespaces, classes, structs, interfaces, records, enums, and delegates
- Constructors, methods, operators, and section functions
- Properties, indexers, fields, enum members, and events
- Parameters, locals, type parameters, aliases, labels, and query scope variables
Compiler-resolved relationships
- Direct calls, constructor calls, method groups, and personnel 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 postulation expressions
- Invocation and constructor arguments bound to root general parameters
- Cross-project relationships pinch overload-aware, project/TFM-aware identity
Every separator points from the declaration wherever the narration was observed to the declaration Roslyn resolved. Source location and provenance are retained. Unsupported semantic shapes are reported arsenic diagnostics alternatively of silently disappearing aliases crashing the full extraction.
See Compatibility for the complete connection and compiler-feature matrix.
For repeated supplier work, commencement a watcher:
The watcher keeps the Roslyn workspace lukewarm and prepares changed projects in the background. A normal graphify-csharp invocation acts arsenic an explicit refresh obstruction and returns only aft a complete JSON snapshot is current.
If nary matching watcher is running, the aforesaid bid 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.
Runtime and connection support
The package contains 2 instrumentality assets:
| net10.0 | .NET 10 | Roslyn 5.9 / C# 14 |
| net11.0 | .NET 11 | .NET 11 SDK Roslyn / C# 15 preview |
Install aliases update the package pinch dotnet instrumentality ... --framework to prime the tool runtime and Roslyn asset:
This is abstracted from the optional --target-framework argument, which chooses one analyzed compilation erstwhile an input task targets aggregate frameworks. Single-target projects do not request --target-framework.
Graphify C# reports what Roslyn tin observe statically. Reflection, dependency injection, autochthonal callbacks, move invocation, and codification absent from the loaded compilation whitethorn create runtime relationships that are not represented as nonstop edges.
Consequently:
- zero inbound references intends zero observed fixed references;
- a test-only consequence depends connected your task aliases namespace classification; and
- every deletion campaigner still requires judgment.
The instrumentality exposes this bound alternatively of pretending fixed grounds is a runtime reachability proof.
More detail:
- Usage
- Compatibility
- Incremental indexing design
- Release and NuGet publishing
MIT. See LICENSE.
English (US) ·
Indonesian (ID) ·