Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/guyeyouhun/auto-knowledge-base/claude-mdgit clone --depth 1 https://github.com/guyeyouhun/auto-knowledge-baseWrote 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/guyeyouhun/auto-knowledge-base/claude-md)<a href="https://agentmods.dev/instructions/guyeyouhun/auto-knowledge-base/claude-md"><img src="https://agentmods.dev/badge/instructions/guyeyouhun/auto-knowledge-base/claude-md.svg" alt="Measured on agentmods" 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 | $0.01020 | $0.01020 |
| Opus 5 | $0.00510 | $0.00510 |
| Sonnet 5 | $0.00204 | $0.00204 |
| Haiku 4.5 | $0.00102 | $0.00102 |
Grade A, and why
auto-knowledge-base 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 3d 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 — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.
自主知识库 (Auto Knowledge Base)
MCP 协议的知识库系统,为工程 Agent 提供智能知识服务。
当前状态
- 版本: v0.1 MVP
- GitHub: https://github.com/guyeyouhun/auto-knowledge-base
- MCP Server: 通过
node dist/install.js一键安装到 Claude Code - LLM 配置: 通过环境变量
LLM_BASE_URL、LLM_API_KEY、LLM_MODEL指定 - 存储: SQLite + FTS5 全文索引
- 安装: 支持一键安装/卸载,复制到永久目录运行
核心设计原则
- 自带 LLM 层 — 不依赖 Claude Code 会话,MCP Server 独立调用 LLM
- staging 暂存 — 自动捕获的知识先存 staging,确认后才固化
- 主动推送 —
knowledge_relevant根据上下文推送,不被动等待查询 - 通用协议 — MCP,任何兼容客户端都能用,模型用户自配
知识类型
concept— 概念/理论pattern— 可复用的实现模式decision— 技术决策及理由project— 项目特有知识
信任级别
confirmed— LLM 提取 + 指令导入,直接固化staging— 自动捕获或暂存,需确认extracted/inferred— 为后续扩展预留
架构决策(重要)
| 决策 | 选择 | 理由 |
|---|---|---|
| LLM API 格式 | 单 LLM 提供商(当前通过 baseUrl 配置) | 兼容主流格式 |
| 存储方式 | SQLite 存储 | 生产级持久化,支持并发 |
| 搜索结果排序 | 关键词初筛 → LLM 语义重排 | 兼顾速度和理解力 |
| 降级策略 | LLM 不可用时降级为纯文本搜索 | 不影响基本功能 |
技术债务 / 待改进
向量嵌入— 已完成,集成@fastembed/fastembed进程内 ONNX 推理,模型文件在 knowledge/models/- 自动捕获 — PostToolUse hook 提取工程知识到 staging
- 知识图谱可视化 — 展示实体间关系
一键安装 / 卸载
# 构建
npm run build
# 第 1 步:探测 LLM 配置(不安装)
node dist/install.js
# Agent 会看到探测结果并让用户选择 LLM 配置方式
# 第 2 步:根据用户选择执行安装
# 选项 A:用探测到的 LLM 安装
node dist/install.js --install
# 选项 B:自定义 LLM
node dist/install.js --install -u <URL> -k <KEY> -m <MODEL>
# 选项 C:不配 LLM,后续手动设置
node dist/install.js --install --no-detect
# 安装后使用(在任意 Claude Code 会话中)
claude> 把这份代码存到知识库
claude> 搜索关于 MCP 的知识
# 卸载
node dist/uninstall.js
Agent 安装指引
当用户在 Claude Code 中说"安装 auto-kb"时:
- 克隆仓库:
git clone https://github.com/guyeyouhun/auto-knowledge-base.git - 进入目录:
cd auto-knowledge-base - 安装依赖并构建:
npm install && npm run build - 探测 LLM:
node dist/install.js→ 看到 JSON 结果 - 问用户选哪个 LLM 配置
- 执行安装:
node dist/install.js --install(或带参数安装)
开发记录
- 2026-07-14: v0.1 全量修复完成,15 工具全部测试通过(157 tests)
知识库内容(./knowledge/)
存入的知识包括:
- MCP 协议、React Hooks、TypeScript interface vs type、CC-Switch 等测试数据
- 后续实际使用中会积累更多工程知识
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.
- 3d ago First seen · 96 lines · 1,020 tokens per session scan A 5424268985d9
auto-knowledge-base CLAUDE.md is an instructions file published in the GitHub repository guyeyouhun/auto-knowledge-base (1 stars, last pushed 1mo ago), licensed MIT. It adds 1,020 tokens to every session, about $0.0051 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-31.
Other instructions, from other repositories
Soroka CLAUDE.md
Instructions for AndyShaman/Soroka, covering soroka and session-start rule.
mcp-documentation-server copilot-instructions.md
Instructions for andrea9293/mcp-documentation-server, covering mcp documentation server - ai coding agent instructions, architecture overview, core components, server entry point (src/server.ts) and embedding providers (src/embedding-provider.ts).
mentedb copilot-instructions.md
Instructions for nambok/mentedb, covering mentedb development instructions, project overview, workspace structure, build, test, and lint and key types.
remindb CLAUDE.md
Instructions for radimsem/remindb, covering claude.md, project at a glance, code map, where to read first — don't grep, don't ls and tread carefully — pause before implementing.
agents-remember AGENTS.md
Instructions for Foxfire1st/agents-remember, covering agents remember source checkout instructions, start here — route by role, memory and onboarding, memory retrieval strategies and source layout.
Binder AGENTS.md
Instructions for mpazik/Binder, covering binder, tech stack, monorepo structure, testing and development.