UniAI: Instructions file for Claude Code

CLAUDE.md

UniAI CLAUDE.md is an instructions file for Claude Code from PiscesGameDev/UniAI. It costs 4,404 tokens per session, scanned A, original, Apache-2.0.

A guide for developers building UniAI, a Unity framework that connects games and other Unity projects to AI services through a shared C# interface.

In plain words
What is it for?
Use it when developing or modifying UniAI's chat, agent, tool, MCP, multimodal, model-routing, runtime, or Unity Editor features.
Why use it?
It explains where provider differences, model settings, agent tools, generated assets, runtime code, and Editor features belong. This helps assistants change the framework without mixing responsibilities between its parts.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md.

This is PiscesGameDev/UniAI's own configuration. It tells Claude Code how to work on UniAI 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 UniAI configures →

Reuse

Borrowing it

Nothing to install: this file belongs to PiscesGameDev/UniAI. 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/PiscesGameDev/UniAI/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/PiscesGameDev/UniAI

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 UniAI CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/piscesgamedev/uniai/claude-md/github.svg)](https://agentmods.dev/instructions/piscesgamedev/uniai/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/piscesgamedev/uniai/claude-md"><img src="https://agentmods.dev/badge/instructions/piscesgamedev/uniai/claude-md/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 UniAI CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/piscesgamedev/uniai/claude-md"><img src="https://agentmods.dev/badge/instructions/piscesgamedev/uniai/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,404 This file is loaded in full into every session.
When invoked 4,404 The same file — it is already loaded in full.
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.04404 $0.04404
Opus 5.5 $0.01762 $0.01762
Sonnet 5.5 $0.00881 $0.00881
Haiku 4.5 $0.00440 $0.00440

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

Security

Grade A, and why

UniAI 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 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.md · 397 lines

How it starts

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

UniAI - AI Assistant Guide

本文档面向参与 UniAI 开发的 AI 助手。它不是用户手册,面向用户的说明见 README.md。修改框架前请先读本文件,避免把模型差异、Editor 行为或生成式路由重新写回错误层级。

包名: com.uniai.core
版本: 0.0.1
Unity: 2022.3+
许可证: Apache 2.0


1. 框架定位

UniAI 是 Unity 与 AI Provider 之间的运行时框架,同时提供 Editor 助手能力。核心目标是让 Unity 项目可以通过统一 C# API 使用 Chat、Agent、Tool、MCP、多模态输入、上下文窗口和生成式资产。

当前架构重点:

  • 统一请求模型: 上层只接触 AIRequest、AIResponse、AIStreamChunk、AIMessage、AIContent。
  • 多协议 Provider: 内置 Claude Messages API 与 OpenAI Chat Completions 兼容协议。
  • 模型元数据驱动: ModelEntry 描述能力、端点、上下文窗口、AdapterId、行为标志和行为参数。
  • Adapter/Dialect 扩展: Provider 主流程保持通用,模型或厂商差异放进 adapter/dialect。
  • Agent Tool Loop: AIAgentRunner 是门面,实际 loop、工具执行和 tool-call history 构造已拆分。
  • 生成式路由: 生成图片等资产由 GenerativeProviderRouter 按模型元数据、渠道和 adapter 决定 provider。
  • Runtime/Editor 分层: Runtime 不依赖 UnityEditor;Editor 只负责 UI、配置管理和 Unity 上下文采集。

不要把 UniAI 当成单一聊天窗口项目。Runtime API 和 Editor Chat 都是一等使用场景。

2. 当前目录职责

Runtime/
├── Core/
│   ├── AIClient / AIConfig / ChannelEntry / UniAISettings
│   ├── ChannelManager / ChannelRouteSelector / ProviderCache
│   ├── ModelRegistry / ModelEntry / ModelCapability
│   ├── Presets/                         # 内置渠道与模型预设
│   ├── Adapters/                        # AdapterAttribute / Catalog / Registry / Discovery
│   ├── ChatOrchestrator                 # 对话生命周期编排
│   ├── ConversationRuntimeFactory       # Client、Runner、ContextPipeline 生命周期
│   ├── ConversationContextPreparer      # ChatSession -> AIMessage + 上下文注入
│   ├── McpConversationInitializer       # Agent MCP 初始化与 Resource 注入
│   ├── AgentEventSessionApplier         # AgentEvent -> ChatSession
│   └── ChatSessionPolicies              # 保存和标题策略
├── Models/                              # 统一请求、响应、消息、工具、流式块
├── Providers/
│   ├── IAIProvider / IAIProviderFactory
│   ├── JsonSseProviderBase
│   ├── Claude/
│   └── OpenAI/
│       └── Chat/                        # OpenAI Chat dialect 和 request converter
├── Agent/
│   ├── AIAgentRunner                    # Agent 门面
│   ├── AgentLoop                        # stream/non-stream tool loop
│   ├── AgentToolExecutor                # 本地 Tool + MCP Tool 执行
│   ├── AgentMessageFactory              # assistant tool-call history
│   └── UniAIToolRegistry / ToolSchemaGenerator / ToolResponse
├── Chat/                                # ChatSession、历史管理和文件存储
├── Context/                             # ContextPipeline、TokenEstimator、摘要、IContextProvider
├── MCP/                                 # MCP Client、Transport、Resource Provider
├── Generative/
│   ├── GenerativeProviderRouter
│   ├── IGenerativeProviderFactory
│   ├── IGenerativeAssetProvider
│   └── Providers/OpenAI/Images/         # OpenAI Images provider + image dialect
├── Tools/                               # Runtime 可用 [UniAITool]
└── Http/                                # AIHttpClient、SSEDownloadHandler、SSEParser

Editor/
├── Setting/                             # Manager 窗口、配置 Tab、AIConfigManager
├── Chat/                                # AIChatWindow、StreamingController、ContextCollector
├── Agent/                               # Agent 资产扫描、Inspector、EditorAgentGuard
├── MCP/                                 # MCP 配置 UI
└── Tools/                               # Editor 专用 [UniAITool]

Read the full file on GitHub · 397 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 · 397 lines · 4,404 tokens per session scan A f73d9f0617a1

Subscribe to this mod's changes

UniAI CLAUDE.md is an instructions file published in the GitHub repository PiscesGameDev/UniAI (30 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 4,404 tokens to every session, about $0.0176 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-30.

Related

UniAI CLAUDE.md compared with instructions from other repositories

UniAI CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
UniAI CLAUDE.mdPiscesGameDev/UniAIInstructions file306mo agoApache-2.0A4,404Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode