msbuild

msbuild is an agent for Claude Code from dotnet/skills. It costs 62 tokens per session (1,541 once invoked), scanned A, original, MIT.

An expert agent for MSBuild, the build system used by .NET and Visual Studio projects.

In plain words
What is it for?
It is for running and troubleshooting .NET builds, tests, packages, and publishing; reviewing project configuration; and routing performance or code-quality questions to relevant build expertise.
Why use it?
It gives developers one place to investigate build errors, project-file problems, slow builds, parallelism issues, and binary logs.

Agent for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: mentions subagents.

Part of the dotnet-msbuild plugin — 19 skills, 3 agents shipped together

About the project

.NET/skills is a repository of reusable instructions and custom agents that help AI coding agents work with .NET and C#. It supports tasks such as C# language-server integration, data access, diagnostics, builds, packages, upgrades, MAUI, templates, and AI development. The catalogue entries are the repository's skills, agents, plugins, and instructions.

dotnet/skills · 5,363 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/dotnet/skills/msbuild
Clone the repo
git clone --depth 1 https://github.com/dotnet/skills

Made for: Claude Code.

Or install dotnet-msbuild, the plugin that ships this one along with the rest of its 19 skills, 3 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for msbuild

README.md
[![agentmods](https://agentmods.dev/badge/agents/dotnet/skills/msbuild.svg)](https://agentmods.dev/agents/dotnet/skills/msbuild)
Your own site
<a href="https://agentmods.dev/agents/dotnet/skills/msbuild"><img src="https://agentmods.dev/badge/agents/dotnet/skills/msbuild.svg" alt="Measured on agentmods" height="20"></a>
Per session 62 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,541 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00062 $0.01541
Opus 5 $0.00031 $0.00771
Sonnet 5 $0.00012 $0.00308
Haiku 4.5 $0.00006 $0.00154

Measured 2d ago against content hash 95a19416439a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

msbuild scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/dotnet-msbuild/agents/msbuild.agent.md · 100 lines

How it starts

The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MSBuild Expert Agent

You are an expert in MSBuild, the Microsoft Build Engine used by .NET and Visual Studio. You help developers run builds, diagnose build failures, optimize build performance, and resolve common MSBuild issues.

Core Competencies

  • Running and configuring MSBuild builds (dotnet build, msbuild.exe, dotnet test, dotnet pack, dotnet publish)
  • Analyzing build failures using binary logs (.binlog files)
  • Understanding MSBuild project files (.csproj, .vbproj, .fsproj, .props, .targets)
  • Resolving multi-targeting and SDK-style project issues
  • Optimizing build performance and parallelization

Domain Relevance Check

Before deep-diving into MSBuild troubleshooting, verify the context is MSBuild-related:

  1. Quick check: Are there .csproj, .sln, .props, .targets files in the workspace? Is the user discussing dotnet build, msbuild, or .NET error codes (CS, MSB, NU, NETSDK)?
  2. If yes: Proceed with MSBuild expertise
  3. If unclear: Briefly scan the workspace (glob **/*.csproj, glob **/*.sln) before committing
  4. If no: Politely explain that this agent specializes in MSBuild/.NET builds and suggest the user use general-purpose assistance instead

Triage and Routing

Classify the user's request and route to the appropriate specialist:

User Intent Route To
Build failed, errors to diagnose This agent + binlog-failure-analysis skill
Build is slow, optimize performance build-perf agent + build-perf-baseline skill (start with baseline)
Review/clean up project files msbuild-code-review agent (specialized code review)
Modernize legacy projects msbuild-code-review agent + msbuild-modernization skill
Organize build infrastructure This agent + directory-build-organization skill
Incremental build broken This agent + incremental-build skill
Choosing/fixing CopyToOutputDirectory behavior (IfDifferent, Always perf hit) This agent + copy-to-output-directory skill

Read the full file on GitHub · 100 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 100 lines · 62 tokens per session scan A 95a19416439a

Subscribe to this mod's changes

msbuild is an agent published in the GitHub repository dotnet/skills (5,363 stars, last pushed today), licensed MIT. It adds 62 tokens to every session and 1,541 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other agents, from other repositories

C#/.NET Janitor

Perform janitorial tasks on C#/.NET code including cleanup, modernization, and tech debt remediation.

github/awesome-copilot · 27 tokens

build-error-resolver

Autonomous .NET build fixer — parses dotnet build errors, categorizes them, applies known fix patterns, and rebuilds iteratively until green. Use when the build is broken, after a large refactor or dependency update, or whenever compiler errors need systematic resolution without hand-holding.

codewithmukesh/dotnet-claude-kit · 63 tokens

dotnet-concurrency-specialist

Expert in .NET concurrency, threading, and race condition analysis. Specializes in Task/async patterns, thread safety, synchronization primitives, and identifying timing-dependent bugs in multithreaded .NET applications. Use for analyzing racy unit tests, deadlocks, and concurrent code issues.

Aaronontheweb/dotnet-skills · 64 tokens

dotnet-async-performance-specialist

Analyzes async/await performance, ValueTask correctness, ConfigureAwait decisions, IO.Pipelines, ThreadPool tuning, and Channel selection in .NET code. Routes profiling to [skill:dotnet-performance-analyst], thread sync bugs to [skill:dotnet-csharp-concurrency-specialist].

novotnyllc/dotnet-artisan · 68 tokens

dotnet-csharp-concurrency-specialist

Debugs race conditions, deadlocks, thread safety issues, concurrent access bugs, lock contention, async races, parallel execution problems, and synchronization issues in .NET code. Routes general async/await questions to [skill:dotnet-csharp].

novotnyllc/dotnet-artisan · 58 tokens

dotnet-performance-analyst

Analyzes .NET profiling data, benchmark results, GC behavior, and performance bottlenecks. Interprets flame graphs, heap dumps, and benchmark comparisons. Triggers on: performance analysis, profiling investigation, benchmark regression, why is it slow, GC pressure, allocation hot path.

novotnyllc/dotnet-artisan · 64 tokens