unity-script

unity-script is a skill for Claude Code, Codex from batihandev/unity-mcp-skills. It costs 25 tokens per session (665 once invoked), scanned A, original, MIT.

A set of Unity tools for managing C# scripts, the files that contain much of a Unity project’s game or editor logic.

In plain words
What is it for?
It is for creating, listing, searching, editing, validating, hashing, and deleting C# scripts under a Unity project’s Assets folder.
Why use it?
It helps make structured script changes and catch compile errors while handling Unity’s reload and diagnostic steps correctly.

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 **Install-once Editor scripts** (screenshot helpers, custom Editor windows, build steps, exporters): check [`../tooling/SKILL.md`](../tooling/SKILL.md) for read.

Good fit It is for creating, listing, searching, editing, validating, hashing, and deleting C# scripts under a Unity project’s Assets folder.

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/batihandev/unity-mcp-skills
agentmods
npx agentmods add skills/batihandev/unity-mcp-skills/script

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 unity-script

README.md
[![agentmods](https://agentmods.dev/badge/skills/batihandev/unity-mcp-skills/script/github.svg)](https://agentmods.dev/skills/batihandev/unity-mcp-skills/script)
Your own site
<a href="https://agentmods.dev/skills/batihandev/unity-mcp-skills/script"><img src="https://agentmods.dev/badge/skills/batihandev/unity-mcp-skills/script/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 unity-script

Your own site · 80×15
<a href="https://agentmods.dev/skills/batihandev/unity-mcp-skills/script"><img src="https://agentmods.dev/badge/skills/batihandev/unity-mcp-skills/script.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 665 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 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.00025 $0.00665
Opus 5.5 $0.00010 $0.00266
Sonnet 5.5 $0.00005 $0.00133
Haiku 4.5 $0.00003 $0.00067

Measured 1mo ago against content hash 168dc0eba2b5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

unity-script 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 1mo 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.

skills/script/SKILL.md · 48 lines

How it starts

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

Script Management

Do not use Unity_RunCommand for script operations. The Unity MCP server exposes dedicated tools for every common script operation. Use them directly — they handle Domain Reload coordination and diagnostics natively.

Routing

Operation Tool Typical use
Create a new C# script Unity_CreateScript Writes a new file under Assets/; sets up the MonoBehaviour/ScriptableObject/Editor template.
Delete a C# script Unity_DeleteScript By URI (unity://path/...) or by Assets/... path.
List script files Unity_ListResources Commonly filtered to *.cs under Assets/.
Search inside a script Unity_FindInFile Regex-level matches with line numbers.
Structured edits Unity_ScriptApplyEdits Method-level replace / insert / remove. Prefer this over raw text edits.
Syntax + diagnostics check Unity_ValidateScript Call before and after edits; surfaces compile errors before they trigger a Domain Reload.
Hash for concurrency Unity_GetSha Compare against your expected hash to detect conflicting edits before writing.

Install-once Editor scripts (screenshot helpers, custom Editor windows, build steps, exporters): check ../tooling/SKILL.md for ready-to-paste templates before writing one from scratch.

Filename must match class name

The .cs filename (without extension) must exactly match the top-level class name. Unity's asset database relies on the 1:1 mapping — mismatches silently break MonoBehaviour attachment and asset references.

  • When creating a script, pass the scriptName without .cs.
  • When renaming a class, rename the file in the same operation.

Domain Reload coordination

After any script create / edit / delete, Unity triggers a Domain Reload (compilation + assembly swap). Tools return a compilation block where applicable — check it before issuing the next operation.

  1. If the response reports isCompiling: true, wait for it to settle before the next script edit.
  2. Once compilation completes, call Unity_ValidateScript on the affected file to surface any errors.
  3. Group related edits in a single task where possible — fewer edits = fewer Domain Reloads.

Read the full file on GitHub · 48 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. 1mo ago First seen · 48 lines · 25 tokens per session scan A 168dc0eba2b5

Subscribe to this mod's changes

unity-script is a skill published in the GitHub repository batihandev/unity-mcp-skills (6 stars, last pushed 12d ago), licensed MIT. It adds 25 tokens to every session and 665 once invoked, about $0.0001 per session on Opus 5.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-08-31.

Related

Other skills, from other repositories

unity-csharp

A set of practical guidelines for writing Unity game scripts in C#. Unity is a game engine, and these rules cover its update loop, object lifetime, memory cleanup, coroutines, and editable data.

Wade-DevCode/awesome-coding-skills-cn · 28 tokens

script-execute

Compiles and runs C# in the Unity Editor (Roslyn): plain statements with the last expression as the result, or a full class with a static method. See the skill body for the modes, usings/include and Unity object parameters.

IvanMurzak/Unity-MCP · 53 tokens

script-delete

Delete one or more .cs script files from disk, refresh the AssetDatabase, and wait for Unity compilation to settle before delivering the final result via the request's requestId. Pair with 'script-read' to inspect files before deletion.

IvanMurzak/Unity-MCP · 52 tokens

script-read

Read a .cs script file and return its content as a string. Supports a 1-based lineFrom/lineTo slice for partial reads. Pair with 'script-update-or-create' to write back.

IvanMurzak/Unity-MCP · 49 tokens

script-update-or-create

Write a .cs script file (create or overwrite) with the provided C# code. Validates syntax via Roslyn before write — invalid code is rejected with error details and the file is left untouched. Refreshes the AssetDatabase and delivers the final result via requestId after Unity finishes the triggered compilation. Use…

IvanMurzak/Unity-MCP · 80 tokens

godot-csharp

Use C#/.NET in Godot 4.7: partial classes extending nodes, the PascalCase lifecycle (Ready/Process/PhysicsProcess), [Export] fields, [Signal] delegates as C# events, type-safe node lookup, and calling between C# and GDScript. Use when writing Godot game code in C# (.cs files, .csproj), needing the Godot .NET build…

gamedev-skills/awesome-gamedev-agent-skills · 108 tokens