A Language Server Protocol (LSP) plugin for Claude Code, optimized for Unity game development with C#.
- Go to Definition - Jump to symbol definitions across your Unity project
- Find References - Locate all usages of classes, methods, and variables
- Hover Information - View type signatures and documentation
- Document Symbols - Navigate file structure quickly
- Diagnostics - Real-time error and warning detection
- Unity-Optimized - Configured for Unity's Mono runtime and project structure
- Cross-Platform - Works on Windows, macOS, and Linux
- Auto-Installation - Automatically detects and installs OmniSharp if missing
- Claude Code v2.0.74 or later
- .NET SDK 6.0+ - Download here
- Unity Project with generated
.slnand.csprojfiles - Windows: Visual Studio 2022 (any edition) - required for MSBuild
The easiest way to install - just two commands:
# Add the plugin marketplace
claude plugin marketplace add bruno1308/unity-csharp-lsp-claude-code
# Install the plugin (loads automatically in all projects)
claude plugin install unity-csharp-lsp --scope userRestart Claude Code and the plugin will load automatically. No --plugin-dir flag needed!
If you prefer to install manually or need to modify the plugin:
git clone https://github.com/bruno1308/unity-csharp-lsp-claude-code.git
cd unity-csharp-lsp-claude-codeWindows (PowerShell):
$dest = Join-Path $env:USERPROFILE ".claude\plugins\unity-csharp-lsp"
New-Item -ItemType Directory -Force -Path $dest
Copy-Item -Path ".\*" -Destination $dest -Recurse -ForcemacOS / Linux:
mkdir -p ~/.claude/plugins/unity-csharp-lsp
cp -r ./* ~/.claude/plugins/unity-csharp-lsp/Close and reopen Claude Code for the plugin to load.
Run /plugins in Claude Code and check that unity-csharp-lsp appears in the list.
The plugin requires OmniSharp to be installed on your system. The plugin will attempt to auto-install on first run, but you can also install manually:
# Option 1: Install via Scoop (Recommended)
scoop install omnisharp
# Option 2: Install via winget
winget install OmniSharp.OmniSharp
# Option 3: Download from GitHub releases
# https://github.com/OmniSharp/omnisharp-roslyn/releases
# Extract and add to PATH# Install OmniSharp with Mono support (Required for Unity)
brew tap omnisharp/omnisharp-roslyn
brew install omnisharp-monoImportant: Use
omnisharp-mono(not justomnisharp) for Unity projects to ensure Mono runtime compatibility.
# Option 1: Download from GitHub releases
# https://github.com/OmniSharp/omnisharp-roslyn/releases
# Download the linux-x64 or linux-arm64 version, extract, and add to PATH
# Option 2: Build from source
# See: https://github.com/OmniSharp/omnisharp-roslyn#buildingFor the LSP to work, your Unity project needs valid solution and project files.
- Open your Unity project in the Unity Editor
- Go to Edit > Preferences > External Tools
- Under "Generate .csproj files for:", check the boxes for your needs
- Click Regenerate project files
- Verify that
.slnandAssembly-CSharp.csprojfiles exist in your project root
Create an omnisharp.json file in your Unity project root for custom settings:
{
"msbuild": {
"enabled": true,
"UseLegacySdkResolver": true
},
"formattingOptions": {
"enableEditorConfigSupport": true,
"useTabs": false,
"tabSize": 4
},
"roslynExtensionsOptions": {
"enableAnalyzersSupport": true,
"enableImportCompletion": true
}
}Important: The
UseLegacySdkResolver: truesetting helps with SDK resolution on systems with multiple .NET SDK versions.
A sample configuration file is included: omnisharp.json.sample
| Extension | Language | LSP Support |
|---|---|---|
.cs |
C# | Full |
.csx |
C# Script | Full |
- Verify OmniSharp is installed and in your PATH:
omnisharp --version # or OmniSharp --version - Restart Claude Code after installing OmniSharp
- Check
/plugins> Errors tab for details
If using Method C (/plugin install), try Method A (copy to ~/.claude/plugins/) instead.
- Ensure your Unity project has a valid
.slnfile - Regenerate project files in Unity Editor
- Check that
Assembly-CSharp.csprojexists
Use the Mono version instead of the .NET version:
brew install omnisharp-mono # NOT just 'omnisharp'OmniSharp needs to index your project on first load. This can take 60-90 seconds for large Unity projects with many assemblies. Subsequent loads will be faster.
This error occurs when there's a mismatch between your .NET SDK version and Visual Studio's MSBuild. The plugin includes a workaround (MSBuildEnableWorkloadResolver=false) that should handle this automatically.
If you still see this error:
- Ensure you have .NET SDK 6.0+ installed:
dotnet --list-sdks - Verify Visual Studio 2022 is installed (provides MSBuild)
- Check that
omnisharp.jsonin your Unity project has"UseLegacySdkResolver": true
This usually means projects failed to load. Check:
- Wait 60-90 seconds after starting Claude Code for indexing
- Verify your Unity project has a valid
.slnfile - Check
/plugins> Errors for SDK-related errors - Try regenerating project files in Unity Editor
This plugin configures Claude Code to use OmniSharp as the Language Server for C# files. When you open a Unity project:
- Claude Code detects
.csfiles - The plugin starts OmniSharp with Unity-optimized settings
- OmniSharp indexes your project using the
.slnfile - Claude gains access to semantic code intelligence
| Operation | Status | What Claude can do |
|---|---|---|
documentSymbol |
✅ Works | List all symbols (classes, methods, fields) in a file |
workspaceSymbol |
✅ Works | Search for symbols across the entire workspace |
hover |
✅ Works | Get type information and documentation |
goToDefinition |
✅ Works | Navigate to where symbols are defined |
findReferences |
✅ Works | Find all usages of a class, method, or variable |
goToImplementation |
✅ Works | Find implementations of interfaces/abstract classes |
getDiagnostics |
✅ Works | See compiler errors and warnings |
prepareCallHierarchy |
❌ N/A | Not supported by OmniSharp |
incomingCalls |
❌ N/A | Not supported by OmniSharp |
outgoingCalls |
❌ N/A | Not supported by OmniSharp |
- Navigation queries: ~50ms (vs ~45 seconds with text search)
- Reference lookups: Near-instant across entire codebase
- Real-time diagnostics: Errors shown as you discuss code
unity-csharp-lsp/
├── .claude-plugin/
│ └── plugin.json # Plugin metadata
├── .lsp.json # OmniSharp configuration
├── hooks/
│ ├── hooks.json # Auto-install hooks
│ ├── check-omnisharp.sh # macOS/Linux installer
│ └── check-omnisharp.ps1 # Windows installer
├── omnisharp.json.sample # Sample project config
├── CLAUDE.md # Instructions for Claude
├── README.md # This file
└── LICENSE # MIT License
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Test with a Unity project
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see LICENSE file for details.
- OmniSharp - The C# language server
- Claude Code - Anthropic's CLI coding assistant
- Piebald-AI/claude-code-lsps - LSP plugin reference