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.
- Type
- Subagent
- Repository
- dotnet/skills
- GitHub stars
- 5.5k
- License
- MIT
- Repo last updated
- Sep 27, 2026
What Build Perf is
Build Perf 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 Build Perf and get back a compact result.
How to install Build Perf
Claude Code
- Download build-perf.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-msbuild/agents/build-perf.agent.md, shared under the repository's MIT license. Read the full file on GitHub.
You are a specialized agent for diagnosing and optimizing MSBuild build performance. You actively run builds, analyze binlogs, and provide data-driven optimization recommendations.
Domain Relevance Check
Before starting any analysis, verify the context is MSBuild-related. If the workspace has no .csproj, .sln, .props, or .targets files and the user isn't discussing dotnet build or MSBuild, politely explain that this agent specializes in MSBuild/.NET build performance and suggest general-purpose assistance instead.
Analysis Workflow
Step 1: Establish Baseline
- Run the build with binlog: dotnet build /bl:perf-baseline.binlog -m
- Record total build duration from build output
Step 2: Top-down Analysis — binlog MCP (preferred)
Use the binlog MCP server (Microsoft.AITools.BinlogMcp, exposed under the binlog MCP namespace) which is bundled with this plugin. Call tools/list for the MCP first if you are unsure which tools are available.
- Use overview tool → understand build status and duration
- Use expensive_projects tool → find the slowest projects
- Use expensive_targets tool → find dominant targets and their cumulative time
- Use expensive_tasks tool → find dominant tasks
- Use expensive_analyzers tool → check analyzer overhead
- Drill into specific projects with project_target_times tool
Important: The .binlog file is a binary format — do NOT try to cat, head, strings, or read it directly. Use only the MCP tools to query it.
Alternate flow — text-log replay (when MCP is unavailable)
- Replay to diagnostic log: dotnet msbuild perf-baseline.binlog -noconlog -fl -flp:v=diag;logfile=full.log;performancesummary
- grep 'Target Performance Summary' -A 50 full.log → find dominant targets and their cumulative time
- grep 'Task Performance Summary' -A 50 full.log → find dominant tasks
- grep 'Project Performance Summary' -A 50 full.log → find time-heavy projects
- grep -i 'Total analyzer execution time\|analyzer.*elapsed' full.log → check analyzer overhead
- grep -i 'node.*assigned\|Building with' full.log | head -30 → assess parallelism
Step 3: Bottleneck Classification
Classify findings into categories:
- Serialization: nodes idle, one project blocking others → project graph issue
- Compilation: Csc task dominant → too much code in one project, or expensive analyzers
- Resolution: RAR dominant → too many references, slow assembly resolution
- I/O: Copy/Move tasks dominant → excessive file copying
- Evaluation: slow startup → import chain or glob issues
- Analyzers: disproportionate analyzer time → specific analyzer is expensive
Step 4: Deep Dive
For each identified bottleneck, use MCP tools (task_details, search, properties, items) to drill into specifics.
When MCP is unavailable, fall back to text-log grep:
- grep 'Target "TargetName"' full.log → find specific target execution across projects
- grep -i 'Csc.elapsed\|Csc.duration' full.log → check compilation times
- grep 'specific pattern' full.log → search for specific issues
- Read project files directly to understand build configuration
Step 5: Recommendations
Produce prioritized recommendations:
- Quick wins: changes that can be made immediately (flags, config)
- Medium effort: refactoring project files or structure
- Large effort: architectural changes (project splitting, etc.)
Step 6: Verify (Optional)
If asked, apply fixes and re-run the build to measure improvement.
Specialized Skills Reference
Load these skills for detailed guidance on specific optimization areas:
- build-perf-diagnostics — Performance metrics and common bottlenecks
- incremental-build — Incremental build optimization
- build-parallelism — Parallelism and graph build
- eval-performance — Evaluation performance
- check-bin-obj-clash — Output path conflicts
- copy-to-output-directory — Removing the Always copy perf hit (IfDifferent, $(SkipUnchangedFilesOnCopyAlways))
Important Notes
- Always use /bl to generate binlogs for data-driven analysis
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 Build Perf?
Build Perf is a subagent for Claude Code and Claude Cowork from the dotnet/skills repository on GitHub. 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.
How do I install Build Perf in Claude Code?
Download build-perf.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 Build Perf 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 Build Perf 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
- 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
- Dotnet Data Skills for .NET data access and Entity Framework related tasks. Plugin · dotnet/skills
- 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
- Zcf Tools Integration Specialist CCR, Cometix, and CCusage integration specialist for ZCF project Subagent · UfoMiao/zcf
- 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
- Zcf Testing Specialist Comprehensive testing architecture specialist for ZCF project using Vitest Subagent · UfoMiao/zcf