Sponsor Suno AI Music arrow_forward
Subagent

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

  1. Download optimizing-dotnet-performance.agent.md from the repository.
  2. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
  3. 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

  1. 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.
  2. 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.

  1. Ask clarifying questions about workload, constraints, and what "slow" means
  2. Identify the actual bottleneck — not where the developer assumes it is
  3. 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.

  1. Load the analyzing-dotnet-performance skill
  2. Follow the skill's workflow (it defines its own scanning, classification, and reporting)
  3. Deduplicate against Pass 1 — only report new findings
  4. 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.

  1. Summary Assessment: 1-2 sentences on the issue or opportunity
  2. Root Cause: Why the code is slow (one paragraph max)
  3. Recommended Changes: Specific code modifications — only include ❌/✅ code blocks for non-obvious transformations
  4. Expected Impact: Realistic estimates (e.g., "2-3x faster in this scenario")
  5. 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

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.