KarlCat CLAUDE.md

KarlCat CLAUDE.md is an instructions file for Claude Code from 050602/KarlCat. It costs 3,960 tokens per session, scanned A, original, MIT.

Repository instructions for KarlCat, a TypeScript and Node.js framework for multiplayer game servers. They explain how to add business features while keeping the framework itself free of built-in game-specific tables and modules.

In plain words
What is it for?
Adding game data tables, database access, cached models and handlers for TCP, WebSocket or KCP server messages.
Why use it?
They prevent application-specific code from changing the default framework and describe the required path through databases, models, caching and network requests.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

Not installable on its own: it reads a path above its own folder, which only exists inside its repository. The line is import { allTables } from "../app";.

Install

Getting it into your agent

There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/050602/karlcat/claude-md.svg)](https://agentmods.dev/instructions/050602/karlcat/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/050602/karlcat/claude-md"><img src="https://agentmods.dev/badge/instructions/050602/karlcat/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,960 This file is loaded in full into every session.
When invoked 3,960 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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.03960 $0.03960
Opus 5 $0.01980 $0.01980
Sonnet 5 $0.00792 $0.00792
Haiku 4.5 $0.00396 $0.00396

Measured 6d ago against content hash 53c5b7901d56, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

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 6d 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 · 384 lines

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
  • 当前原则:仓库保持“纯框架”,不内置具体业务表/业务模块

纯框架约束(重要)

  1. 允许保留框架级扩展点,但默认不注入业务表。
  2. server/src/database/ 中若出现业务表代码,可作为示例;不要默认视为“必须启用”。
  3. 评审时不要把“未启用业务表”当作缺陷,除非用户明确要求跑业务功能。

最小业务接入模板

在保持“纯框架”主干不变的前提下,推荐按以下最小步骤接入业务:

  1. 定义 Table(数据库服)
  • 新建 XxxTable,继承 BaseOneKeyTableBase2Table(或直接 BaseTable)。
  • 写操作统一走 WAL 包装:insert/update/deleteRecoverOne -> MarkedXxxFinish
  • init(db) 中完成 schema/model 初始化,并调用 BaseTable.initDataLog(this)
  1. 定义 Model(逻辑服)
  • 新建 XxxModel 继承 BaseModel
  • 通过 app.rpcDB() 调用 DB 事件,不直接访问 Mongo。
  • 按需开启缓存(覆盖 enableCache() 和 TTL 配置)。
  1. 定义 ModelLogic(业务入口)
  • 新建 XxxModelLogic 继承 BaseModelLogic
  • 在此组织业务读写、缓存刷新、登出清理等流程。
  1. 注册协议处理入口
  • servers/<type>/ 下新增处理类,继承 BaseServerLogic
  • 使用 bindCmd/bindAwait 绑定协议处理函数。
  • 协议主键需落入 route.ts 对应服务器区间。
  1. 业务模块启用方式(建议)
  • 不改框架主干默认行为。
  • 在业务分支或部署层显式启用:实例化 XxxTable/XxxModel/XxxModelLogic,并在启动流程中注册。
  • 未启用时,框架可运行但业务事件不可用,这属于预期行为。

最小代码骨架(可复制)

  1. 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;
  }
}

Read the full file on GitHub · 384 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. 6d ago First seen · 384 lines · 3,960 tokens per session scan A 53c5b7901d56

Subscribe to this mod's changes

KarlCat CLAUDE.md is an instructions file published in the GitHub repository 050602/KarlCat (22 stars, last pushed 5mo ago), licensed MIT. It adds 3,960 tokens to every session, about $0.0198 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

minestom-mcp AGENTS.md

Instructions for RonaldBunk/minestom-mcp, a project described as: A stdio MCP server for Minestom, implemented with the Model Context Protocol SDK and TanStack AI tool definitions.

RonaldBunk/minestom-mcp · 369 tokens

Silex AGENTS.md

AGENTS.md instructions for silexlabs/Silex, covering agents.md, tech stack, run it locally, building the desktop app and when writing code for silex (editing source).

silexlabs/Silex · 1,155 tokens

unity-code-style-guide AGENTS.md

Instructions for krogh-jacobsen/unity-code-style-guide, covering agents.md — unity 6 c, project setup — edit this block, never do these — they corrupt the project, deprecated in unity 6 and if you read nothing else.

krogh-jacobsen/unity-code-style-guide · 4,528 tokens

game-and-watch-retro-go-sd CLAUDE.md

Claude Code instructions for sylverb/game-and-watch-retro-go-sd, covering claude.md, what this project is, build / flash workflow, architecture and three storage tiers, one elf.

sylverb/game-and-watch-retro-go-sd · 2,946 tokens

base-building-trap-defense-design-agent-skill CLAUDE.md

Instructions for dungnotnull/base-building-trap-defense-design-agent-skill, covering claude.md — skill 250: base-building-trap-defense-design, skill identity, problem this skill solves, harness flow summary and sub-skills.

dungnotnull/base-building-trap-defense-design-agent-skill · 1,910 tokens

trident-mcp AGENTS.md

Instructions for mordor-forge/trident-mcp, covering agents.md, what this is, build and test, single-file verification and e2e tests.

mordor-forge/trident-mcp · 1,465 tokens