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.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.svg" alt="Measured on agentmods" 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 $0.02202 $0.02202
Sonnet 5 $0.00881 $0.00881
Haiku 4.5 $0.00440 $0.00440

Measured 8d ago against content hash f73d9f0617a1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 8d 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、多模态输入、上下文窗口和生成式资产。

当前架构重点:

  • 统一请求模型: 上层只接触 AIRequestAIResponseAIStreamChunkAIMessageAIContent
  • 多协议 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. 8d 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 4mo ago), licensed Apache-2.0. It adds 4,404 tokens to every session, about $0.0220 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

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens