unity-cli CLAUDE.md

A project instruction file for Claude Code working with Unity CLI, a command-line tool that controls the Unity game editor through a relay server. It documents setup, editor controls, screenshots, logs, scenes, tests, and recording.

In plain words
What is it for?
Use it to install or run Unity CLI, start the relay server, control play mode, inspect scenes and logs, capture screenshots, run tests, or record gameplay.
Why use it?
It gives the coding agent the commands and system layout needed to operate Unity and inspect its state without guessing.

Instructions file

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 instructions/bigdra50/unity-cli/claude-md
Clone the repo
git clone --depth 1 https://github.com/bigdra50/unity-cli
Per session 985 This file is loaded in full into every session.
When invoked 985 The same file — it is already loaded in full.
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.00985 $0.00985
Opus 5 $0.00492 $0.00492
Sonnet 5 $0.00197 $0.00197
Haiku 4.5 $0.00098 $0.00098

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

Security

Grade A, and why

unity-cli CLAUDE.md 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.

CLAUDE.md · 132 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

Unity CLI + Relay Server for controlling Unity Editor via TCP. Supports multiple Unity instances with domain reload resilience.

CLI ←──TCP:6500──→ Relay Server (Python) ←──TCP:6500──→ Unity Editor(s)

Commands

# Install globally (provides: unity-cli, u, unity commands)
uv tool install .

# Run Relay Server standalone
unity-relay --port 6500

All subcommands are self-documenting: u --help, u <command> --help.

Frequently used:

u state                                   # Get editor state
u play / u stop / u pause                 # Playmode control
u refresh                                 # Refresh AssetDatabase
u screenshot -s game -p ./out.png         # Capture screenshot
u screenshot --burst -n 10                # Burst capture
u console get -l E                        # Error logs
u scene hierarchy                         # Scene hierarchy
u tests run edit                          # Run EditMode tests
u recorder start --fps 30                 # Start frame recording
u recorder stop                           # Stop recording
u uitree dump -p "GameView"               # UI Toolkit tree

Architecture

State Machine

DISCONNECTED → (REGISTER) → READY → (COMMAND) → BUSY → (COMMAND_RESULT) → READY
                              ↓                                              ↑
                        (beforeReload)                              (afterReload)
                              ↓                                              ↑
                          RELOADING ─────────────────────────────────────────┘

Key Implementation Details

Relay Server

  • Port: 6500 (default)
  • Heartbeat: 5s interval, 15s timeout, 3 retries
  • RELOADING timeout: 30s (extended)
  • Single Outstanding PING rule
  • Queue: FIFO, max 10, disabled by default
  • Idempotency: cache success responses for 60s

Read the full file on GitHub · 132 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. yesterday First seen · 132 lines · 985 tokens per session scan A 74ac50d13378

Subscribe to this mod's changes

unity-cli CLAUDE.md is an instructions file published in the GitHub repository bigdra50/unity-cli (39 stars, last pushed 2mo ago), licensed MIT. It adds 985 tokens to every session, about $0.0049 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 instructions, from other repositories

core CLAUDE.md

Instructions for ReactUnity/core, covering claude.md, what this repo is, two package universes, pnpm workspace membership and commands.

ReactUnity/core · 6,014 tokens

unity-cli-loop AGENTS.md

AGENTS.md instructions for hatayama/unity-cli-loop, covering architecture overview, repository map, cli / unity package compatibility, project runner pin and generated skill files.

hatayama/unity-cli-loop · 3,014 tokens

core AGENTS.md

Instructions for ReactUnity/core, covering release workflow, write changelog files, example, fix button hover state and package references.

ReactUnity/core · 245 tokens

unity-mesh-fracture AGENTS.md

Instructions for sinanata/unity-mesh-fracture, covering agents.md, what this project is, golden rules (do not violate), wire it into your project and public api.

sinanata/unity-mesh-fracture · 2,647 tokens

Aspid.FastTools CLAUDE.md

Instructions for VPDPersonal/Aspid.FastTools, covering обзор репозитория, сборка, архитектура, карта функциональности and соглашения по коду редактора.

VPDPersonal/Aspid.FastTools · 2,948 tokens

unity-mesh-fracture copilot-instructions.md

Instructions for sinanata/unity-mesh-fracture: This repository follows the cross-tool AGENTS.md standard. Read /AGENTS.md for the full guide: the MeshFracture API, the bake-at-load / look-up-at-impact pipeline, the material rules, build and preview commands, and the pull-request checklist.

sinanata/unity-mesh-fracture · 346 tokens