{"slug": "show-hn-graphify-c-compiler-accurate-find-usages-for-coding-agents", "title": "Show HN: Graphify C# – Compiler-accurate Find Usages for coding agents", "summary": "A developer released graphify-csharp, a free, MIT-licensed headless Roslyn/MSBuild indexer that gives coding agents compiler-accurate Find Usages for C#, resolving callers, references, implementations, inheritance, and overrides across overloads, generics, and projects. The tool installs via `dotnet tool install --global Graphify.CSharp --framework net10.0`, accepts .sln, .slnx, .csproj, and SDK file-based .cs inputs, and emits a single JSON document of nodes, edges, and hyperedges for agents such as Codex and Claude Code. It requires no IDE, no compiled project DLL, and no database, and ships with a skill file that teaches agents when to refresh the index and how to follow semantic edges.", "body_md": "**Give coding agents compiler-accurate Find Usages for C#.**\n\n`graphify-csharp` is a free, headless Roslyn/MSBuild indexer that turns C#\nsource into deterministic, queryable semantic evidence: compiler-resolved\ncallers, references, implementations, inheritance, and overrides—even across\noverloads, generics, and projects.\n\nThink of it as the semantic-navigation slice of Rider/ReSharper, exported for Codex, Claude Code, and other coding agents.\n\n**MIT licensed · No IDE · No compiled project DLL required · No database · Graphify optional**\n\nSuppose you ask:\n\n**Which methods are used only by tests?**\n\nA 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.\n\nGraphify 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:\n\n| Without semantic indexing | With Graphify C# | \n|---|---|\n| Matching names look like usages | Roslyn resolves the exact declaration | \n| Overloads and generics are ambiguous | Bound signatures and project/TFM identity are retained | \n| Test-only usage requires manual inspection | Every caller carries project, namespace, and source location | \n| Type relationships are reconstructed from text | `inherits` ,`implements` , and`overrides` are explicit edges | \n\nFor example, this repository contains an internal\n`DeclarationCatalogBuilder.ForTesting(...)` method. From the extracted graph,\nan agent can see one compiler-resolved incoming call:\n\n```\nGraphify.CSharp.Roslyn.DeclarationCatalogBuilder.ForTesting(...)\n└── called by Graphify.CSharp.Tests.Roslyn.CSharp14FeatureTests\n    at tests/Graphify.CSharp.Tests/Roslyn/CSharp14FeatureTests.cs:143\n```\n\nThat 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.\n\n```\ndotnet tool install --global Graphify.CSharp --framework net10.0\ngraphify-csharp \\\n  --input ./src/MyProduct.sln \\\n  --root . \\\n  --configuration Release \\\n  --output ./graphify-out/csharp.json\n```\n\nThe result is one complete JSON document containing `nodes`, `edges`, and\n`hyperedges`. It can be read directly by an agent, queried with `jq`, consumed\nfrom your own code, or passed to Graphify.\n\nSupported inputs are `.sln`, `.slnx`, `.csproj`, and SDK file-based `.cs` apps.\nThe repository's SDKs, packages, and MSBuild inputs must be available locally.\n\nThe included [`graphify-csharp` skill](/zachsaw/graphify-csharp/blob/main/.agents/skills/graphify-csharp/SKILL.md)\nteaches an agent when to refresh the index, how to follow semantic edges, and\nwhere static analysis stops.\n\nInstall it in a Codex-compatible project:\n\n```\nmkdir -p .agents/skills/graphify-csharp\ncurl -fsSL \\\n  https://raw.githubusercontent.com/zachsaw/graphify-csharp/main/.agents/skills/graphify-csharp/SKILL.md \\\n  -o .agents/skills/graphify-csharp/SKILL.md\n```\n\nFor Claude Code, use `.claude/skills/graphify-csharp/SKILL.md` instead. Reload\nan agent session after installing or updating the skill.\n\nIf you do not use skills, add this to your project instructions:\n\nFor C# structure and usage questions, refresh\n`graphify-out/csharp.json` with `graphify-csharp` before answering. Identify\ndeclarations by `symbol_key` and inspect incoming `calls` and `references`\nedges. Treat zero inbound edges as observed static evidence, not proof of\nruntime unreachability.\n\nNow ask your agent:\n\n- What calls this exact overload or constructor?\n- Which source declarations reference this field, property, event, or type?\n- Which classes implement this interface?\n- Which members override this virtual or interface member?\n- Which declarations have zero observed inbound references?\n- Which methods are referenced only from test projects?\n\n| What a developer does in Rider | What an agent gets from Graphify C# | \n|---|---|\n| Find Usages | Directed, compiler-resolved `calls` and`references` edges | \n| Jump to Implementation | `implements` edges to the exact interface contract | \n| Navigate base and derived types | `inherits` and`overrides` edges | \n| Disambiguate overloads and generics | Stable symbol identities with bound signature information | \n| Inspect a large solution | Project, target-framework, source-location, and provenance metadata | \n| Keep navigating while editing | Incremental indexing with an optional warm watcher | \n\nThe 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.\n\nGraphify C# deliberately covers a focused layer:\n\n- **Rider and ReSharper** provide interactive navigation, inspections,\nrefactorings, and quick fixes for developers inside an IDE.\n- **NDepend** provides a broad, commercial architecture and code-quality suite\nbuilt around dependency analysis, metrics, rules, reports, baselines, and\nvisualizations.\n- **Graphify C#** provides source-level C# semantic evidence for coding agents,\nheadlessly and in an open format.\n\nThere 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.\n\nGraphify C# is standalone. It does not invoke, load, or require Graphify.\n\nWithout Graphify, query the JSON with an agent, `jq`, C#, Python, or any other\nconsumer. For example, list every indexed method:\n\n```\njq '.nodes[] | select(.properties.node_kind == \"method\")' \\\n  graphify-out/csharp.json\n```\n\nWith Graphify, refresh the C# evidence and use its higher-level query, path, explanation, clustering, and export workflows:\n\n```\ngraphify-csharp \\\n  --input ./src/MyProduct.sln \\\n  --root . \\\n  --configuration Release \\\n  --output ./graphify-out/csharp.json\n\ngraphify query \"Which methods call the order service?\" \\\n  --graph ./graphify-out/csharp.json\n```\n\nGraphify remains the general graph workflow. `graphify-csharp` contributes the\nC# layer where compiler binding matters.\n\n- Namespaces, classes, structs, interfaces, records, enums, and delegates\n- Constructors, methods, operators, and local functions\n- Properties, indexers, fields, enum members, and events\n- Parameters, locals, type parameters, aliases, labels, and query range variables\n\n- Direct calls, constructor calls, method groups, and member access\n- Field, type, attribute, generic, `typeof` , and declaration-header references\n- `inherits` ,`implements` , and`overrides`\n- Compiler-selected operators, conversions, deconstruction, `foreach` ,`await` ,`using` , patterns, ranges, and collection expressions\n- Invocation and constructor arguments bound to source formal parameters\n- Cross-project relationships with overload-aware, project/TFM-aware identity\n\nEvery 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.\n\nSee [Compatibility](/zachsaw/graphify-csharp/blob/main/docs/COMPATIBILITY.md) for the complete language and\ncompiler-feature matrix.\n\nFor repeated agent work, start a watcher:\n\n```\ngraphify-csharp \\\n  --input ./src/MyProduct.sln \\\n  --root . \\\n  --configuration Release \\\n  --output ./graphify-out/csharp.json \\\n  --watch\n```\n\nThe watcher keeps the Roslyn workspace warm and prepares changed projects in\nthe background. A normal `graphify-csharp` invocation acts as an explicit\nrefresh barrier and returns only after a complete JSON snapshot is current.\n\nIf no matching watcher is running, the same command performs a one-shot\nrefresh. Use `--rebuild` to invalidate the incremental cache.\n\nSee [Usage](/zachsaw/graphify-csharp/blob/main/docs/USAGE.md) and\n[Incremental indexing](/zachsaw/graphify-csharp/blob/main/docs/INCREMENTAL_INDEXING.md) for watcher ownership,\nfiltering, recovery, and cache behavior.\n\nThe package contains two tool assets:\n\n| Tool asset | Runtime | Compiler surface | \n|---|---|---|\n| `net10.0` | .NET 10 | Roslyn 5.9 / C# 14 | \n| `net11.0` | .NET 11 | .NET 11 SDK Roslyn / C# 15 preview | \n\nInstall or update the package with `dotnet tool ... --framework` to select the\ntool runtime and Roslyn asset:\n\n```\ndotnet tool update --global Graphify.CSharp --framework net11.0\n```\n\nThis is separate from the optional `--target-framework` argument, which chooses\none analyzed compilation when an input project targets multiple frameworks.\nSingle-target projects do not need `--target-framework`.\n\nGraphify 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.\n\nConsequently:\n\n- zero inbound references means **zero observed static references** ;\n- a test-only result depends on your project or namespace classification; and\n- every deletion candidate still requires judgment.\n\nThe tool exposes this boundary instead of pretending static evidence is a runtime reachability proof.\n\n```\ndotnet restore Graphify.CSharp.sln\ndotnet build Graphify.CSharp.sln --configuration Release\ndotnet test Graphify.CSharp.sln --configuration Release\ndotnet pack src/Graphify.CSharp.Cli --configuration Release\n```\n\nMore detail:\n\nMIT. See [LICENSE](/zachsaw/graphify-csharp/blob/main/LICENSE).", "url": "https://wpnews.pro/news/show-hn-graphify-c-compiler-accurate-find-usages-for-coding-agents", "canonical_source": "https://github.com/zachsaw/graphify-csharp", "published_at": "2026-09-12 00:16:10+00:00", "updated_at": "2026-09-12 00:23:21.058996+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools"], "entities": ["graphify-csharp", "Roslyn", "MSBuild", "Codex", "Claude Code", "Graphify", "Rider", "ReSharper"], "alternates": {"html": "https://wpnews.pro/news/show-hn-graphify-c-compiler-accurate-find-usages-for-coding-agents", "markdown": "https://wpnews.pro/news/show-hn-graphify-c-compiler-accurate-find-usages-for-coding-agents.md", "text": "https://wpnews.pro/news/show-hn-graphify-c-compiler-accurate-find-usages-for-coding-agents.txt", "jsonld": "https://wpnews.pro/news/show-hn-graphify-c-compiler-accurate-find-usages-for-coding-agents.jsonld"}}