Borrowing it
Nothing to install: this file belongs to Pretend-to/mio-chat-backend. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Pretend-to/mio-chat-backend/master/CLAUDE.mdgit clone --depth 1 https://github.com/Pretend-to/mio-chat-backendWrote 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.
[](https://agentmods.dev/instructions/pretend-to/mio-chat-backend/claude-md)<a href="https://agentmods.dev/instructions/pretend-to/mio-chat-backend/claude-md"><img src="https://agentmods.dev/badge/instructions/pretend-to/mio-chat-backend/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.
<a href="https://agentmods.dev/instructions/pretend-to/mio-chat-backend/claude-md"><img src="https://agentmods.dev/badge/instructions/pretend-to/mio-chat-backend/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.02414 | $0.02414 |
| Opus 5 | $0.01207 | $0.01207 |
| Sonnet 5 | $0.00483 | $0.00483 |
| Haiku 4.5 | $0.00241 | $0.00241 |
Grade A, and why
mio-chat-backend 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 9d 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.
How it starts
The opening of the file, as written. The whole thing — 167 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.
项目定位
Mio-Chat 的后端,自称 "Agent OS":不只是 API 转发,而是带 Hook 拦截、三层插件体系、真实终端桥接的 Agent 运行环境。配套前端仓库 mio-chat-frontend(本机通常在 ../mio-chat-frontend)。
这是作者自用的个人项目,仍在开发阶段,没有外部用户。因此:
- 数据结构可以直接改到对的形态,不必为兼容旧数据写迁移分支(真需要迁移时走
lib/migration/,启动时自动检测执行)。 - CI 只构建 Docker 镜像,不卡合并。直接提交到
master,无 PR 流程。 - 有测试但覆盖不全,不要假设改动会被测试拦住。
命令
pnpm dev # node --watch app.js,日志打到 stdout
pnpm start # pm2 start ./config/pm2.json(生产)
pnpm lint # oxlint
pnpm lint:fix # oxlint --fix
pnpm format # prettier --write .
pnpm test # bash scripts/utils/run-tests.sh
pnpm test:unit # node --test tests/**/*.test.js
node --test tests/adapters/openai.test.js # 跑单个测试文件
pnpm db:push # prisma db push(改完 schema 用这个,开发阶段够了)
pnpm db:migrate # prisma migrate dev
pnpm db:studio # 可视化查看 data/app.db
pnpm docker:up / docker:down / docker:logs
测试用 Node 内置的 node --test,无第三方框架。测试分布:tests/{adapters,integration,plugins,routes,unit}/。适配器测试最全(每个 provider 一个文件),业务逻辑覆盖较薄。
启动流程
app.js 是入口,所有依赖都是动态 import 的(await import(...)),因为初始化有严格顺序:
performFullInitialization() # 确保 .env 存在、数据库目录存在、schema 已同步
→ prismaManager.initialize()
→ 各 Service.initialize()(Preset / SystemSettings / PluginConfig / Task)
→ initializeDefaults()
→ AutoMigrationDetector.checkAndMigrate()
→ config.reload()
→ statusCheck() # lib/check.js,在这里创建 global.middleware
→ taskScheduler.initialize()
→ startServer() # lib/server/http/index.js
app.js 还实现了优雅关闭(SIGINT/SIGTERM,10s 强制超时),改启动/关闭逻辑时注意别破坏这条链。
两个全局
global.middleware— 在lib/check.js里创建,lib/middleware.js定义。运行期访问 socket server、插件、LLM 适配器、OneBot 的统一入口。logger—utils/logger.js,全局可用无需 import。用logger.info/warn/error/debug/mark/json。
架构
lib/
├── server/
│ ├── http/ Express 5:routes(index.js) + controllers/ + middleware/
│ └── socket.io/ 实时层,与前端的主通道
├── chat/
│ ├── llm/ 适配器、Skills、结晶服务、任务执行
│ ├── onebot/ OneBot v11(反向 WS 客户端)
│ └── acp/ Agent Client Protocol,带独立进程管理
├── hooks/ 全局 Hook 架构(V3)
├── plugins/ 内置插件
├── database/ Prisma 封装 + Service 层
├── initialization/ 首次启动自愈
└── migration/ 自动迁移检测
plugins/custom/ 第三方插件(pnpm workspace)
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.
- 9d ago First seen · 167 lines · 2,414 tokens per session scan A 8fbec50b82d1
mio-chat-backend CLAUDE.md is an instructions file published in the GitHub repository Pretend-to/mio-chat-backend (38 stars, last pushed yesterday), licensed MIT. It adds 2,414 tokens to every session, about $0.0121 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.
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.
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.
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).
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).
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.
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.