Borrowing it
Nothing to install: this file belongs to 050602/KarlCat. 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/050602/KarlCat/main/CLAUDE.mdgit clone --depth 1 https://github.com/050602/KarlCatWrote 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/050602/karlcat/claude-md)<a href="https://agentmods.dev/instructions/050602/karlcat/claude-md"><img src="https://agentmods.dev/badge/instructions/050602/karlcat/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/050602/karlcat/claude-md"><img src="https://agentmods.dev/badge/instructions/050602/karlcat/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.03960 | $0.03960 |
| Opus 5.5 | $0.01584 | $0.01584 |
| Sonnet 5.5 | $0.00792 | $0.00792 |
| Haiku 4.5 | $0.00396 | $0.00396 |
Grade A, and why
KarlCat 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.
How it starts
The opening of the file, as written. The whole thing — 384 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
本文件用于指导 Claude Code(claude.ai/code)在本仓库内进行开发与维护。
项目定位
KarlCat(卡尔猫)是基于 TypeScript + Node.js 的分布式多人游戏服务端框架。
- 技术栈:Node.js、TypeScript、MongoDB(Mongoose)、protobufjs
- 传输层:TCP / WebSocket / KCP
- 架构来源:pomelo → pinus → mydog → karlcat
- 当前原则:仓库保持“纯框架”,不内置具体业务表/业务模块
纯框架约束(重要)
- 允许保留框架级扩展点,但默认不注入业务表。
server/src/database/中若出现业务表代码,可作为示例;不要默认视为“必须启用”。- 评审时不要把“未启用业务表”当作缺陷,除非用户明确要求跑业务功能。
最小业务接入模板
在保持“纯框架”主干不变的前提下,推荐按以下最小步骤接入业务:
- 定义 Table(数据库服)
- 新建
XxxTable,继承BaseOneKeyTable或Base2Table(或直接BaseTable)。 - 写操作统一走 WAL 包装:
insert/update/deleteRecoverOne -> MarkedXxxFinish。 - 在
init(db)中完成 schema/model 初始化,并调用BaseTable.initDataLog(this)。
- 定义 Model(逻辑服)
- 新建
XxxModel继承BaseModel。 - 通过
app.rpcDB()调用 DB 事件,不直接访问 Mongo。 - 按需开启缓存(覆盖
enableCache()和 TTL 配置)。
- 定义 ModelLogic(业务入口)
- 新建
XxxModelLogic继承BaseModelLogic。 - 在此组织业务读写、缓存刷新、登出清理等流程。
- 注册协议处理入口
- 在
servers/<type>/下新增处理类,继承BaseServerLogic。 - 使用
bindCmd/bindAwait绑定协议处理函数。 - 协议主键需落入
route.ts对应服务器区间。
- 业务模块启用方式(建议)
- 不改框架主干默认行为。
- 在业务分支或部署层显式启用:实例化
XxxTable/XxxModel/XxxModelLogic,并在启动流程中注册。 - 未启用时,框架可运行但业务事件不可用,这属于预期行为。
最小代码骨架(可复制)
server/src/database/XxxTable.ts
import mongoose from "mongoose";
import { allTables } from "../app";
import { BaseTable } from "./BaseTable";
export class XxxTable extends BaseTable {
public static get Instance(): XxxTable {
return this.getInstance();
}
public async init(db: mongoose.Mongoose) {
const schema = new mongoose.Schema({
roleUid: { type: Number, required: true, index: true },
value: { type: Number, default: 0 },
});
this.table = db.model(this.tableName, schema);
allTables.push(this);
BaseTable.initDataLog(this);
}
public async insertOne(data: any): Promise<any> {
this.insertRecoverOne(data, { roleUid: data.roleUid });
const ret = await super.insertOne(data);
if (ret) {
this.MarkedInsertFinish(data);
this.dataLog?.updateLastWriteTime();
}
return ret;
}
}
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.
- 2mo ago First seen · 384 lines · 3,960 tokens per session scan A 53c5b7901d56
KarlCat CLAUDE.md is an instructions file published in the GitHub repository 050602/KarlCat (22 stars, last pushed 7mo ago), licensed MIT. It adds 3,960 tokens to every session, about $0.0158 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.
KarlCat CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| KarlCat CLAUDE.md050602/KarlCat | Instructions file | 22 | 7mo ago | MIT | A | 3,960 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,649 | GitHub Copilot |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| vscode model-prompts.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 2,022 | GitHub Copilot |