uloop-execute-dynamic-code

A Unity command that runs custom C# code with access to Unity's editor and project APIs. C# is the programming language commonly used for Unity projects.

In plain words
What is it for?
Use it to automate scenes, prefabs, serialized properties, asset database refreshes, metadata-file creation, editor menus, or Play Mode tasks. It accepts short inline code or a C# script file.
Why use it?
Built-in commands may not expose enough of a scene, prefab, asset, menu, or Play Mode workflow. Custom code can inspect or change those parts when needed.

Skill for Claude CodeCodex

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 skills/hatayama/unity-cli-loop/uloop-execute-dynamic-code
Any agent
npx skills add hatayama/unity-cli-loop --skill uloop-execute-dynamic-code
Clone the repo
git clone --depth 1 https://github.com/hatayama/unity-cli-loop

Made for: Claude Code, Codex.

Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,667 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 $0.00043 $0.01667
Opus 5 $0.00022 $0.00834
Sonnet 5 $0.00009 $0.00333
Haiku 4.5 $0.00004 $0.00167

Measured yesterday against content hash 9e7ddefb9414, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

uloop-execute-dynamic-code 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 yesterday.

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.

.agents/skills/uloop-execute-dynamic-code/SKILL.md · 89 lines

How it starts

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

Task

Run focused C# snippets in the active Unity Editor with uloop execute-dynamic-code.

For basic selected GameObject discovery or property inspection, use find-game-objects --search-mode Selected before this tool. Use this tool after the built-in inspection tools are not enough or when you need to modify Unity state.

This tool can inspect reachable Unity state — GameObjects, components, public properties, static values, method results — but it cannot read local variables or intermediate calculations inside an already-running method. When those values matter, follow the uloop-pause-point skill: a pause point's CapturedVariables carries the locals, parameters, and instance fields at that line with no code edit or recompile, and while Unity stays paused UloopPausePoint.TryGetCapturedValue(name) gives this tool live captured references. That skill also covers the reverse combination — registering an EditorApplication.update watcher from this tool that freezes Unity on the first frame a runtime condition holds. Never poll or sleep inside a snippet; the body runs synchronously on the main thread.

Live state injection: when a running PlayMode session is merely in the wrong state — a stuck end-to-end scenario, a camera angle a raycast can never hit, a private flag blocking the path under test — fix the state instead of the code: write the field directly from this tool (reflection reaches private fields) and steer the session onward. Nothing recompiles and no domain reload happens, so the session's in-memory state survives intact. The snippet is a one-off diagnostic that never lands in source files, so project rules restricting reflection in production code are not violated.

Parameters

Parameter Type Default Description
--code string - Inline C# statements to execute. Direct statements only; return is optional, and using directives may appear at the top of the snippet.
--parameters object - Shell-quoted JSON object literal for reusing a snippet with varying data or keeping values outside the code. Values are exposed as parameters["param0"], parameters["param1"], and so on. Omit for most snippets; never pass a JSON string value.
--wait-for-domain-reload flag - Wait for Domain Reload recovery after snippets that intentionally trigger Unity script reload or import work. Omit for normal inspection and editor-state workflows.
--yield-to-foreground-requests flag - Allow foreground requests to preempt this execution

Read the full file on GitHub · 89 lines

Files

What ships with it

2 files 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. yesterday Changed · +1 lines · -5 tokens per session 9e7ddefb9414
  2. yesterday First seen · 88 lines · 48 tokens per session scan A f4098e45a6a5

Subscribe to this mod's changes

uloop-execute-dynamic-code is a skill published in the GitHub repository hatayama/unity-cli-loop (522 stars, last pushed yesterday), licensed MIT. It adds 43 tokens to every session and 1,667 once invoked, about $0.0002 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-08-30.

Related

Other skills, from other repositories

unity

Compile, test, and drive Unity for this repo's C# packages (unity/core, jint, quickjs, clearscript) and the two Unity projects (tests/, kitchen-sink/). Use when a change touches C# under unity/, when Unity test results are needed, when a rendering snapshot has to be checked or regenerated, or when the app has to be…

ReactUnity/core · 108 tokens

test-designing-guide

Provides test design methodology for Unity projects. Use this skill whenever designing test cases from requirements or specifications, including selecting test techniques, deriving test cases, and formatting them. Even for small features, load this skill to ensure test design rigor.

nowsprinting/unity-coding-skills · 52 tokens

fix-bug

Diagnoses and fixes bugs using a test-first workflow (reproduce, diagnose, fix). Use this skill whenever the user reports a bug, describes unexpected behavior, or asks to investigate or fix a defect. Even if the user says "something's broken", "this isn't working", "fix this bug", or "why does X happen", load this…

nowsprinting/unity-coding-skills · 86 tokens

plan-feature

Orchestrates the test-first implementation planning workflow for feature implementation and spec changes. Use this skill whenever plan mode is active and the task involves implementing or adding a new feature, or changing an existing specification. Even if the user only says "plan this" or "how should we implement…

nowsprinting/unity-coding-skills · 76 tokens

refine-tests

Reviews existing test code for conformance to the test-designing-guide and test-writing-guide, then applies the refinements. Use this skill when the user wants to review or refine existing test code so it follows the project's test design and writing conventions. Typically invoked as /refine-tests .

nowsprinting/unity-coding-skills · 64 tokens

test-writing-guide

Provides guidelines for writing test code for Unity projects. Make sure to use this skill whenever writing, creating, editing, or modifying test code files (files under Tests/). This includes implementing new tests, fixing test failures, adding test cases, or any task that results in test code changes. Even for small…

nowsprinting/unity-coding-skills · 81 tokens