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 a full .NET project is unnecessary.

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for csharp-scripts

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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.5 $0.00042 $0.01111
Sonnet 5.5 $0.00021 $0.00555
Haiku 4.5 $0.00010 $0.00278

Measured 3mo ago against content hash acc0ea3c0231, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 3mo 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. 3mo 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 (530 stars, last pushed today), licensed MIT. It adds 104 tokens to every session and 2,777 once invoked, about $0.0004 per session on Opus 5.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

csharp-scripts compared with skills from other repositories

csharp-scripts next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
csharp-scriptsmanagedcode/dotnet-skillsSkill530todayMITA104Claude Code, Codex
clean-architecture-dotnetSebastienDegodez/copilot-instructionsSkill19929d agoApache-2.0A50Claude Code, Codex
creating-dotnet-mcp-serversSebastienDegodez/copilot-instructionsSkill19929d agoApache-2.0A43Claude Code, Codex
blazorAterDev/Perigon.CLISkill545d agoApache-2.0A45Claude Code, Codex
cliAterDev/Perigon.CLISkill545d agoApache-2.0A52Claude Code, Codex
codegenAterDev/Perigon.CLISkill545d agoApache-2.0A53Claude Code, Codex
dotnetAterDev/Perigon.CLISkill545d agoApache-2.0A61Claude Code, Codex