# Roslyn codelens

> Roslyn codelens is an open-source agent skill for developer tools. Gives agents semantic .NET/C# code intelligence via Roslyn instead of grep or builds. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/MarcelRoozekrans/roslyn-codelens-mcp/tree/main/plugins/roslyn-codelens/skills/roslyn-codelens
- **Repository:** https://github.com/marcelroozekrans/roslyn-codelens-mcp
- **GitHub stars:** 78
- **License:** MIT
- **Skill name:** roslyn-codelens
- **Collection:** https://github.com/MarcelRoozekrans/roslyn-codelens-mcp
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

This skill steers an AI coding agent away from text search and full builds when working on C# solutions, and toward the roslyn-codelens MCP server's tools. It sets out a set of rules: symbol lookups, caller and reference searches, implementation discovery and compiler diagnostics all go through semantic tools rather than Grep, Glob or dotnet build.

The skill is mostly a decision guide. It maps common questions, such as who calls a method, what implements an interface, or what a stack trace points to, onto the matching MCP tool, and explains how to read tool envelopes, error codes and trust prompts for analyzer diagnostics. It also covers planning changes, refactoring through rename and signature tools, and audits for dead code, async misuse, disposable leaks and layering violations.

It expects a .NET codebase and the roslyn-codelens MCP server to be available. If those tools are missing, the skill does nothing. The skill file itself is a single SKILL.md with no bundled scripts.

## When your agent uses it

> Use when working with any .NET / C# code (.cs/.csproj/.sln/.slnx files), finding callers/references/implementations, checking compiler errors or warnings, running dotnet build for diagnostics, searching for a type/method/interface by name, inspecting DI registrations, detecting dead code or circular dependencies, inspecting source-generator output, or about to Grep/Glob across a C# codebase — activates when roslyn-codelens MCP tools are available.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/MarcelRoozekrans/roslyn-codelens-mcp/tree/HEAD/plugins/roslyn-codelens/skills/roslyn-codelens)
- [License: MIT](https://github.com/MarcelRoozekrans/roslyn-codelens-mcp/tree/HEAD/plugins/roslyn-codelens/skills/roslyn-codelens)

## Features

- **Symbol and reference lookup:** Routes finding types, callers, implementations and usages to semantic Roslyn queries.
- **Compiler diagnostics:** Replaces dotnet build runs with structured compiler and analyzer diagnostics.
- **Safe refactoring tools:** Covers solution-wide rename and parameter signature changes with preview and conflict checks.
- **Code quality audits:** Points to tools for dead code, complexity, async misuse, and disposable leaks.
- **Exception analysis:** Traces what exceptions a method can throw and where they are caught.
- **Analyzer trust handling:** Explains when to ask the user before trusting a solution for analyzer execution.

## Good for

- Find every implementation of an interface across the solution
- Show all compiler errors without running dotnet build
- Rename a class and update every reference safely
- Find sync-over-async calls and missing awaits
- Map a pasted .NET stack trace to source lines
- Check whether a layer references a forbidden namespace

## Install

### Claude Code

This skill ships in the `roslyn-codelens` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add MarcelRoozekrans/roslyn-codelens-mcp
/plugin install roslyn-codelens@roslyn-codelens-mcp
```

Or copy only this skill to `~/.claude/skills/roslyn-codelens`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/MarcelRoozekrans/roslyn-codelens-mcp.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/roslyn-codelens &&
cp -R "$tmp/plugins/roslyn-codelens/skills/roslyn-codelens" ~/.claude/skills/roslyn-codelens &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/roslyn-codelens` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/roslyn-codelens` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/MarcelRoozekrans/roslyn-codelens-mcp.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/roslyn-codelens &&
cp -R "$tmp/plugins/roslyn-codelens/skills/roslyn-codelens" ~/.agents/skills/roslyn-codelens &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/roslyn-codelens` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/roslyn-codelens` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/MarcelRoozekrans/roslyn-codelens-mcp.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/roslyn-codelens &&
cp -R "$tmp/plugins/roslyn-codelens/skills/roslyn-codelens" ~/.cursor/skills/roslyn-codelens &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/roslyn-codelens` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/MarcelRoozekrans/roslyn-codelens-mcp.git --path plugins/roslyn-codelens/skills/roslyn-codelens
```

Or copy the folder to `~/.gemini/skills/roslyn-codelens` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/roslyn-codelens`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/MarcelRoozekrans/roslyn-codelens-mcp.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/roslyn-codelens &&
cp -R "$tmp/plugins/roslyn-codelens/skills/roslyn-codelens" ~/.copilot/skills/roslyn-codelens &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/roslyn-codelens` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/MarcelRoozekrans/roslyn-codelens-mcp.git
```

Then copy `roslyn-codelens-mcp/plugins/roslyn-codelens/skills/roslyn-codelens` into your agent's skills folder as `roslyn-codelens`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Does Roslyn codelens require anything to be installed?

It needs the roslyn-codelens MCP tools to be available. If find_implementations is not exposed as a tool, the skill stays inactive.

### Does Roslyn codelens replace dotnet build?

For finding compiler errors, warnings and analyzer results, the skill directs the agent to get_diagnostics instead. Building to produce binaries, run tests or package remains outside its scope.

### Will Roslyn codelens change my code on its own?

Refactoring tools such as rename_symbol and change_signature preview changes by default and apply them only when asked, with conflict and freshness checks.

### Does analyzer analysis run without asking?

Analyzer diagnostics run analyzer DLLs as in-process code, so the skill tells the agent to ask the user before trusting a solution.

### How do I install Roslyn codelens in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/roslyn-codelens to use it in all your projects, or to .claude/skills/roslyn-codelens in one project. Or install the roslyn-codelens plugin, which includes it: /plugin marketplace add MarcelRoozekrans/roslyn-codelens-mcp, then /plugin install roslyn-codelens@roslyn-codelens-mcp.

### Does Roslyn codelens run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Roslyn codelens?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Roslyn codelens?

The closest alternatives to Roslyn codelens are Roslynk, Roslyn analyzers, Go semantic tools, Entroly context control and Semantic kernel.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Roslynk](https://ai-powered.com/skills/roslynk): Roslynk is an open-source agent skill for developer tools.
- [Roslyn analyzers](https://ai-powered.com/skills/roslyn-analyzers): Roslyn analyzers is an open-source agent skill for developer tools.
- [Go semantic tools](https://ai-powered.com/skills/go-semantic-tools): Go semantic tools is an open-source agent skill for developer tools.
- [Entroly context control](https://ai-powered.com/skills/entroly-context-control): Entroly context control is an open-source agent skill for developer tools.
- [Semantic kernel](https://ai-powered.com/skills/semantic-kernel): Semantic kernel is an open-source agent skill for developer tools.
- [Dotnet best practices](https://ai-powered.com/skills/dotnet-best-practices): Dotnet best practices is an open-source agent skill for developer tools.
- [Microsoft code reference](https://ai-powered.com/skills/microsoft-code-reference): Microsoft code reference is an open-source agent skill for developer tools.
- [Microsoft skill creator](https://ai-powered.com/skills/microsoft-skill-creator): Microsoft skill creator is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/roslyn-codelens-marcelroozekrans
