csharp-scripts

csharp-scripts is a skill for Claude Code, Codex from managedcode/dotnet-skills. It costs 104 tokens per session (2,777 once invoked), scanned A, a copy of csharp-scripts, MIT.

A guide to running small C# programs directly from source files with the .NET command-line tools, without first creating a project. It is intended for experiments and small utilities.

In plain words
What is it for?
Use it for one-file experiments, small multi-file scripts, prototypes, or utilities when a full .NET project is unnecessary.
Why use it?
It provides a quick way to try C# code or an API without adding full project files to an existing codebase.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is #:project ../MyLibrary/MyLibrary.csproj.

Good fit Use it for one-file experiments, small multi-file scripts, prototypes, or utilities when…

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/managedcode/dotnet-skills
agentmods
npx agentmods add skills/managedcode/dotnet-skills/csharp-scripts

Made for: Claude Code, Codex.

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 csharp-scripts

README.md
[![agentmods](https://agentmods.dev/badge/skills/managedcode/dotnet-skills/csharp-scripts.svg)](https://agentmods.dev/skills/managedcode/dotnet-skills/csharp-scripts)
Your own site
<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/csharp-scripts"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/csharp-scripts.svg" alt="Measured on agentmods" height="20"></a>
Per session 104 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,777 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod 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.00104 $0.02777
Opus 5 $0.00052 $0.01388
Sonnet 5 $0.00021 $0.00555
Haiku 4.5 $0.00010 $0.00278

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

Security

Grade A, and why

csharp-scripts 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 3d 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.

Origin

This is a copy

100% identical to csharp-scripts — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

catalog/Platform/Official-DotNet-Advanced/skills/csharp-scripts/SKILL.md · 299 lines

How it starts

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

File-Based C# Apps

When to Use

  • Testing a C# concept, API, or language feature with a quick file-based app
  • Prototyping logic before integrating it into a larger project
  • Building a small utility from one entry-point file and a few helper .cs files

When Not to Use

  • The user asks for a language-agnostic quick script, throwaway computation, or shell/Python/PowerShell-style automation
  • The user needs a full project, solution integration, or project references in an existing app
  • The user is working inside an existing .NET solution and wants to add code there
  • The app is large enough that project structure, build customization, tests, or publish configuration should live in a .csproj

Inputs

Input Required Description
C# code or intent Yes The code to run, or a description of what the file-based app should do

Workflow

Step 1: Check the .NET SDK version

Run dotnet --version to verify the SDK is installed and note the full version, including the feature band. File-based apps require .NET 10 or later. #:include, #:exclude, and transitive directive processing require SDK 10.0.300 or later; SDK 10.0.100/10.0.200 builds can run single-file apps but do not support those multi-file directives. If the version is below 10, follow the fallback for older SDKs instead.

Step 2: Write the app file

Create an entry-point .cs file using top-level statements. Place it outside any existing project directory to avoid conflicts with .csproj files.

#!/usr/bin/env dotnet
// hello.cs
Console.WriteLine("Hello from a file-based app!");

var numbers = new[] { 1, 2, 3, 4, 5 };
Console.WriteLine($"Sum: {numbers.Sum()}");

Guidelines:

  • Use top-level statements (no Main method, class, or namespace boilerplate)
  • Place using directives at the top of the file (after the #! line and any #: directives if present)
  • Place type declarations (classes, records, enums) after all top-level statements

Read the full file on GitHub · 299 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3d ago First seen · 299 lines · 104 tokens per session scan A acc0ea3c0231

Subscribe to this mod's changes

csharp-scripts is a skill published in the GitHub repository managedcode/dotnet-skills (477 stars, last pushed yesterday), licensed MIT. It adds 104 tokens to every session and 2,777 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to csharp-scripts, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

winui-setup

Install and verify the prerequisites the win-dev-skills WinUI 3 toolchain depends on — .NET SDK 8.0.100+, WinApp CLI 0.6+, and Developer Mode. Use only when the user explicitly asks to set up or repair the toolchain. Do not invoke automatically when another skill reports a missing prerequisite; tell the user what is…

microsoft/win-dev-skills · 88 tokens

winui-wpf-migration

Migrate WPF applications to WinUI 3 — namespace replacement (System.Windows → Microsoft.UI.Xaml), control mapping (DataGrid→ListView, WrapPanel→ItemsRepeater, TabControl→TabView), threading (Dispatcher→DispatcherQueue), imaging (System.Drawing→BitmapImage), MVVM conversion to CommunityToolkit.Mvvm, and…

microsoft/win-dev-skills · 100 tokens

opengis-skills

Use when AI coding assistant needs GIS/CAD/C#/AI/IoT/3D domain expertise for 73+ open-source projects. One-stop skill index with tag-based search and on-demand loading for GDAL, GeoServer, QGIS, PostGIS, JTS, CesiumJS, FreeCAD, OpenSCAD, OCCT, NPOI, SqlSugar, Furion, Dify, SuperSplat, Go and more.

znlgis/opengis-skills · 97 tokens

clean-architecture-dotnet

Use when domain logic leaks into API/Infrastructure, project references violate layer boundaries, or you need to decide between CQS (always), CQRS bus (complex domains), and DDD patterns (invariants and events).

SebastienDegodez/copilot-instructions · 50 tokens

creating-dotnet-mcp-servers

Use when building Model Context Protocol (MCP) servers in .NET, configuring tools, transports (SSE/stdio), JSON serialization for AOT, or testing MCP endpoints.

SebastienDegodez/copilot-instructions · 43 tokens

blazor

Use for Blazor Server development with Fluent UI Blazor, Razor components, layouts, pages, scoped UI services, culture switching, localization, forms, loading/empty/error states, and Studio-style dashboard workflows.

AterDev/Perigon.CLI · 45 tokens