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/zelixag/ai-memex-cli/agents-mdgit clone --depth 1 https://github.com/zelixag/ai-memex-cliWhat 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.02380 | $0.02380 |
| Opus 5 | $0.01190 | $0.01190 |
| Sonnet 5 | $0.00476 | $0.00476 |
| Haiku 4.5 | $0.00238 | $0.00238 |
Grade A, and why
ai-memex-cli AGENTS.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 2d 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 — 174 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.
项目概述
ai-memex-cli(命令名 memex)是一个用于构建和维护持久化 LLM wiki 的 CLI 工具。它的核心定位是“机械层”:只做文件操作、frontmatter 校验、关键词匹配、链接检查等纯机械工作;所有语义决策(写什么内容、如何综合知识)都交给外部 LLM agent 通过 shell 调用来完成。
技术栈
- 运行时:Node.js >= 20
- 语言:TypeScript 5.4(严格模式
strict: true) - 模块系统:ES Modules(
"type": "module"),内置模块导入需带node:前缀 - CLI 框架:
cac - 测试框架:
vitest(globals: true,environment: 'node') - 依赖库:
gray-matter、chokidar、picocolors - 包管理器:pnpm
- 构建工具:
tsc直接编译,输出到dist/
编码规范
- 文件命名:命令文件使用 kebab-case(如
link-check.ts),模块文件使用 camelCase(如wiki-index.ts) - 导出约定:每个命令文件导出
*Command异步函数(如distillCommand);核心模块导出具体函数而非默认导出 - 类型命名:接口/类型使用 PascalCase(如
DistillOptions、WikiPage) - 导入顺序:Node 内置模块(带
node:前缀)→ 第三方依赖 → 项目内部模块 - 路径风格:内部统一使用正斜杠(
/),normalizePath()处理 Windows 反斜杠 - 禁止项:禁止引入与现有设计重复的大型框架
项目结构
src/
cli.ts # CLI 入口,使用 cac 注册所有命令
commands/ # 各命令实现(init、distill、ingest、watch、glob、inject、lint、search、new、log、install-hooks、status、link-check)
core/ # 核心领域逻辑(无 side effect 的纯函数优先)
vault.ts # Vault 路径解析
config.ts # 配置读写(~/.llmwiki/config.json)
schema.ts # Frontmatter 解析与校验
wiki-index.ts # Wiki 页面索引构建、[[link]] 提取
globber.ts # 关键词评分与页面筛选
linker.ts # 孤儿页、断链检测
distiller.ts # JSONL 解析与机械提取
injector.ts # @include 指令解析
utils/
fs.ts # 文件系统封装(readFileUtf8、writeFileUtf8、listMarkdownFiles 等)
exec.ts # 子进程调用封装
logger.ts # 终端日志(info / success / warn / error)
templates/ # AGENTS.md 与 wiki 页面模板(concept、entity、source、summary)
tests/
core/ # 核心模块单元测试
fixtures/
mock-vault/ # 完整 mock vault 结构,供测试使用
docs/ # PRD 与设计文档
dist/ # tsc 编译输出(.gitignore 忽略)
Vault 目录规范
Vault 分两层:默认 wiki(~/.llmwiki/,旧版可能仍为 ~/.llmwiki/global/)与 local(<project>/.llmwiki/local/)。所有路径在 CLI 内部统一归一化为正斜杠。
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.
- 2d ago First seen · 174 lines · 2,380 tokens per session scan A 8922dba70963
ai-memex-cli AGENTS.md is an instructions file published in the GitHub repository zelixag/ai-memex-cli (9 stars, last pushed 3mo ago), licensed MIT. It adds 2,380 tokens to every session, about $0.0119 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
zenwiki CLAUDE.md
Claude Code instructions for ChenXplorer/zenwiki, covering 1. think before coding, 2. simplicity first, 3. surgical changes and 4. goal-driven execution.
pi-llm-wiki AGENTS.md
Instructions for zosmaai/pi-llm-wiki, covering agents.md, project, tech stack, file layout and conventions.
synto CLAUDE.md
Instructions for kytmanov/synto, covering claude.md, commands, install (editable, auto-detects uv/pip), dependencies and tests (all offline, no ollama required).
mindbase-llm-wiki CLAUDE.md
Claude Code instructions for frankchu91/mindbase-llm-wiki, covering mindbase — north star for claude code, product thesis (one paragraph), the 3-layer architecture (from karpathy), the 3 operations (from karpathy) and special files (from karpathy).
zissa-wiki CLAUDE.md
Instructions for MetamusicX/zissa-wiki, covering claude.md — research wiki schema, identity, architecture, folder conventions and raw/.
MindOS AGENTS.md
Instructions for GeminiLight/MindOS, covering agent 协作规则, 代码规范, spec 模板, spec and 目标.