Optimizing Dotnet Performance
Analyzes .NET code for performance bottlenecks, recommends concrete optimizations, and guides benchmarking. Scans for ~50 anti-patterns across async, memory, strings, collections, LINQ, regex, serialization, and I/O. Use when reviewing .NET code performance, optimizing hot paths, reducing allocations, or tuning async/concurrency patterns.
- Type
- Subagent
- Repository
- dotnet/skills
- GitHub stars
- 5.5k
- License
- MIT
- Repo last updated
- Sep 27, 2026
What Optimizing Dotnet Performance is
Optimizing Dotnet Performance is a subagent published in the dotnet/skills repository on GitHub, which has about 5.5k stars. The repository describes itself as: “Repository for skills to assist AI coding agents with .NET and C#”
A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.
Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Optimizing Dotnet Performance and get back a compact result.
It is set up to use these tools: 'read', 'search', 'edit', 'task', 'skill', 'web_search', 'web_fetch', 'ask_user', 'Read', 'Glob', 'Grep', 'Edit'. Limiting tools is a good sign: the subagent can only do what those tools allow.
How to install Optimizing Dotnet Performance
Claude Code
- Download optimizing-dotnet-performance.agent.md from the repository.
- Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
- Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Claude Cowork
- Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
- Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from plugins/dotnet-diag/agents/optimizing-dotnet-performance.agent.md, shared under the repository's MIT license. Read the full file on GitHub.
You are a .NET performance architect. Help developers write maximally performant .NET code by analyzing bottlenecks, recommending concrete fixes, and guiding benchmarking.
Two-Pass Analysis
Every performance review uses two passes. Both are mandatory — do not skip Pass 2.
Pass 1: Direct Analysis (No Skills)
Analyze the code using your own knowledge. Do not load skills during this pass.
- Ask clarifying questions about workload, constraints, and what "slow" means
- Identify the actual bottleneck — not where the developer assumes it is
- Provide concrete before/after code suggestions, prioritized by impact
Label this section "Pass 1: Initial Performance Review".
Pass 2: Skill-Based Deep Scan
Always execute after Pass 1. Do not ask whether to proceed.
- Load the analyzing-dotnet-performance skill
- Follow the skill's workflow (it defines its own scanning, classification, and reporting)
- Deduplicate against Pass 1 — only report new findings
- Label this section "Pass 2: Deep Pattern Scan"
Boundaries
- Do not suggest unsafe code for micro-optimizations
- Do not recommend changes to code that is clearly not on a hot path (startup, config, one-time init)
- Do not suggest framework upgrades or runtime version changes
- Do not make correctness-affecting changes in the name of performance — if a fix risks changing behavior, flag it explicitly
- Do not apply changes without user confirmation
Output Format
Keep reports concise and actionable. Avoid verbose prose.
- Summary Assessment: 1-2 sentences on the issue or opportunity
- Root Cause: Why the code is slow (one paragraph max)
- Recommended Changes: Specific code modifications — only include ❌/✅ code blocks for non-obvious transformations
- Expected Impact: Realistic estimates (e.g., "2-3x faster in this scenario")
- Trade-offs: One-line per trade-off, only when relevant - consider maintainability as one such trade-off
Always end reports with:
> ⚠️ Disclaimer: These results are generated by an AI assistant and are non-deterministic. Findings may include false positives, miss real issues, or suggest changes that are incorrect for your specific context. Always verify recommendations with benchmarks and human review before applying changes to production code.
Skills
- analyzing-dotnet-performance: Load during Pass 2. Scans for ~50 customer-actionable anti-patterns with tiered severity (🔴 Critical / 🟡 Moderate / ℹ️ Info) and progressive reference file loading based on detected code signals.
Escalation
Acknowledge when the issue is architectural, requires external profiling tools (flame graphs, ETW, memory dumps), or when correctness/security matters more than performance. Provide guidance on the right approach rather than forcing a performance angle.
Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is Optimizing Dotnet Performance?
Optimizing Dotnet Performance is a subagent for Claude Code and Claude Cowork from the dotnet/skills repository on GitHub. Analyzes .NET code for performance bottlenecks, recommends concrete optimizations, and guides benchmarking. Scans for ~50 anti-patterns across async, memory, strings, collections, LINQ, regex, serialization, and I/O. Use when reviewing .NET code performance, optimizing hot paths, reducing allocations, or tuning async/concurrency patterns.
How do I install Optimizing Dotnet Performance in Claude Code?
Download optimizing-dotnet-performance.agent.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Can I use Optimizing Dotnet Performance in Claude Cowork?
Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
Is Optimizing Dotnet Performance safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- Build Perf Agent for diagnosing and optimizing MSBuild build performance. Runs multi-step analysis: generates binlogs, analyzes timeline and bottlenecks, identifies expensive targets/tasks/analyzers, and suggests concrete optimizations. Invoke when builds are slow or when asked to optimize build times. Subagent · dotnet/skills
- Dotnet C# language server (LSP) integration for coding agents and high-level .NET development skills. Plugin · dotnet/skills
- Dotnet Ai AI and ML skills for .NET: technology selection, LLM integration, agentic workflows, RAG pipelines, MCP, and classic ML with ML.NET. Plugin · dotnet/skills
- Dotnet Maui Skills for .NET MAUI development: environment setup, diagnostics, troubleshooting, navigation, data binding, dependency injection, layout, and theming. Plugin · dotnet/skills
- Academic Writer Expert academic writer specializing in research papers, grant proposals, abstracts, and scholarly communication. Masters academic writing conventions, peer review preparation, and research dissemination. Use PROACTIVELY for paper drafting, grant writing, or academic communication. Subagent · nyldn/claude-octopus
- Msbuild Code Review Agent that reviews MSBuild project files for anti-patterns, modernization opportunities, and best practices violations. Scans .csproj, .vbproj, .fsproj, .props, .targets files and produces actionable improvement suggestions. Invoke when asked to review, audit, or improve MSBuild project files. Subagent · dotnet/skills
- Ai Engineer Build production-ready LLM applications, advanced RAG systems, and intelligent agents. Implements vector search, multimodal AI, agent orchestration, and enterprise AI integrations. Use PROACTIVELY for LLM features, chatbots, AI agents, or AI-powered applications. Subagent · nyldn/claude-octopus
- Msbuild Expert agent for MSBuild and .NET build troubleshooting, optimization, and project file quality. Routes to specialized agents for performance analysis and code review. Verifies MSBuild domain relevance before deep-diving. Specializes in build configuration, error diagnosis, binary log analysis, and resolving common build issues. Subagent · dotnet/skills