unity-editor-mcp: Command for Claude Code

.claude/commands/fix-unity-console.md

fix-unity-console is a command for Claude Code from akiojin/unity-editor-mcp. It costs 0 tokens per session (1,392 once invoked), scanned A, original, MIT.

A Unity Editor command that reads console errors, warnings, and assertions, then coordinates fixes through UnityMCP. Unity is a tool for building games and other interactive applications.

In plain words
What is it for?
Use it to investigate and fix Unity compilation errors, null-reference errors, missing script references, and obsolete API warnings.
Why use it?
It turns a noisy console into grouped problems and checks whether fixes worked by reimporting assets or recompiling scripts. It also reports issues that still need manual attention.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is akiojin/unity-editor-mcp's own configuration. It tells Claude Code how to work on unity-editor-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything unity-editor-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to akiojin/unity-editor-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/akiojin/unity-editor-mcp/main/.claude/commands/fix-unity-console.md
Clone the repo
git clone --depth 1 https://github.com/akiojin/unity-editor-mcp

Made for: Claude Code.

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 fix-unity-console

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/akiojin/unity-editor-mcp/fix-unity-console"><img src="https://agentmods.dev/badge/commands/akiojin/unity-editor-mcp/fix-unity-console.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,392 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.00000 $0.01392
Opus 5.5 $0.00000 $0.00557
Sonnet 5.5 $0.00000 $0.00278
Haiku 4.5 $0.00000 $0.00139

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

Security

Grade A, and why

fix-unity-console 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 2mo 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.

.claude/commands/fix-unity-console.md · 165 lines

How it starts

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

/FixUnityConsole

Unityエディタのコンソール出力を確認し、エラーや警告を自動的に解決するコマンド

概要

このコマンドは、UnityMCPを利用してUnityエディタのコンソールログを取得・分析し、unity-architectが複数の専門サブエージェントに作業を分配して問題を並列で解決します。エラーの種類に応じて適切なサブエージェントが専門的な修正を実行します。

処理フロー

  1. Unity Editor接続確認

    • UnityMCPへの接続確認
    • エディタの実行状態確認
    • 接続エラー時の診断と対処法の提示
  2. コンソールログ収集

    • エラー、警告、アサートを取得
    • タイムスタンプ順にソート
    • 重複するエラーをグループ化
  3. Unity側での再検証

    • アセットの再インポート
    • スクリプトの再コンパイル
    • エラーが解消されたことを確認
  4. 作業完了報告

    • 修正内容のサマリー
    • 残存する問題の報告
    • 手動対応が必要な項目の提示

エラータイプ別の対処法

コンパイルエラー

// エラー例: CS0246: 型または名前空間の名前 'Vector3' が見つかりませんでした
// 修正: using UnityEngine; を追加

Null参照例外

// エラー例: NullReferenceException: Object reference not set to an instance of an object
// 修正: null チェックの追加
if (component != null) {
    component.DoSomething();
}

Missing参照

// エラー例: The referenced script on this Behaviour is missing!
// 修正:
// 1. スクリプトファイルを検索
// 2. GameObjectのコンポーネントを更新
// 3. プレハブを再保存

非推奨API

// エラー例: 'Application.LoadLevel' is obsolete
// 修正: SceneManager.LoadScene に置換

実装詳細

Unity接続確認

# UnityMCPの接続テスト
mcp__UnityMCP__ping

# エディタ状態の確認
mcp__UnityMCP__get_editor_state

ログ取得と分析

# エラーログの取得
mcp__UnityMCP__enhanced_read_logs --logTypes Error --count 100

# コンパイル状態の確認
mcp__UnityMCP__get_compilation_state

修正できない問題の処理

  • プロジェクト設定の問題
  • 外部アセットの互換性
  • プラットフォーム固有の問題
  • ライセンス関連のエラー

出力例

成功時の出力:

/FixUnityConsole

🔍 Unity Editorに接続中...
  ✅ 接続成功
  📊 エディタ状態: Play Mode

📋 コンソールログを取得中...
  ⚠️ 警告: 15件
  ❌ エラー: 8件
  🔴 アサート: 2件

🏗️ unity-architectが問題を分析中...
  コンパイルエラー: 3件
  Null参照例外: 2件
  Missing参照: 3件

🔄 Unityで再コンパイル中...
  ✅ コンパイル成功

📊 最終結果:
  修正済み: 8/8 エラー(5つのサブエージェントによる並列処理)
  処理時間: 通常の1/5に短縮
  残存エラー: 0件

✅ すべてのエラーが解決されました!

エラー時の出力:

/FixUnityConsole

🔍 Unity Editorに接続中...
  ❌ 接続失敗

⚠️ Unity Editorが起動していないか、UnityMCPが正しく設定されていません。

🔧 対処法:
  1. Unity Editorが起動していることを確認
  2. UnityMCPの設定を確認:
     - .mcp.jsonでUnityMCPが有効になっているか
     - ポート番号が正しいか(デフォルト: 5001)
  3. Unity側でMCPパッケージがインポートされているか確認

📖 詳細なセットアップ手順:
  https://github.com/your-repo/unity-mcp-setup

Read the full file on GitHub · 165 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. 2mo ago First seen · 165 lines · 0 tokens per session scan A 63da118387b1

Subscribe to this mod's changes

fix-unity-console is a command published in the GitHub repository akiojin/unity-editor-mcp (11 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,392 tokens. 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.