Borrowing it
Nothing to install: this file belongs to KonghaYao/peri. 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/KonghaYao/peri/main/CLAUDE.mdgit clone --depth 1 https://github.com/KonghaYao/periWrote 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/konghayao/peri/claude-md)<a href="https://agentmods.dev/instructions/konghayao/peri/claude-md"><img src="https://agentmods.dev/badge/instructions/konghayao/peri/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/konghayao/peri/claude-md"><img src="https://agentmods.dev/badge/instructions/konghayao/peri/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.01681 | $0.01681 |
| Opus 5.5 | $0.00672 | $0.00672 |
| Sonnet 5.5 | $0.00336 | $0.00336 |
| Haiku 4.5 | $0.00168 | $0.00168 |
Grade A, and why
peri 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 11d 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 — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
Peri 是终端 AI 编程助手:用户交付任务,Agent 推进工作,过程可理解、可介入,结果可核对。长期可维护性是设计目标。
项目大目标
v4 分阶段推进存算分离。阶段状态以代码、契约测试及 active spec 为准。
- 单机本地:已完成。 本地 Agent、会话与工具形成可用闭环。
- 单机服务化:未完成。 TS SDK 负责服务入口、进程与跨主 Agent 管理;Peri 负责 ACP 后端、Agent 执行、Store 直连和 MCP Client。进程重启后保留历史会话加载与正常续聊,不恢复旧 Agent 执行。
- 集群化 / Serverless 化:未完成。 推进多实例协调与接管、工具环境独立驻留及云端部署;计算核心减少重型依赖,支持实例替换,Agent 决策、模型推理和工具执行可分开部署。
- Harness:RCRA(Receive → Compact → Reason → Act)循环执行,hook 扩展生命周期,Middleware 承载业务能力。
- Sessions:存储会话、消息、配置及冻结上下文,不持久化 Agent 执行恢复状态;后端可替换;会话、任务运行与计算实例具有独立生命周期。
- Resources:文件系统工具、Skill、Cron 等能力经 MCP Middleware 接入;工作区与工具环境可独立于计算实例驻留。
- Orchestration:基于同构 Agent,管理 Subagent、Multitask 与 Workflow 的任务关系、协调与当前运行期等待;不恢复旧执行。Middleware 提供接入,编排生命周期不绑定某个活跃 Harness 实例。
- Endpoint:ACP 是统一出口协议,stdio 是本地传输方式;传输层可自定义,客户端复用同一业务语义。
内部依赖走 MCP,外部出口走 ACP:依赖按能力消费方向定义,与部署位置无关;MCP 能力边界不强制对应独立进程,部署隔离按信任边界和生命周期确定。 减少文件系统依赖,推崇网络依赖:文件系统依赖转移到 mcp-packages 层以下,不可外溢。
核心工程原则 v1.5
- 架构与领域优先:编码前明确目标、领域边界、职责、依赖方向和数据流。复用型抽象等第二个真实用例再提取;协议隔离、依赖反转和确定的可替换边界可在首个用例建立接口,须说明当前需要。
- 模块封装复杂度:接口精简、稳定,文件按职责拆分;规模限制及验证遵循
STD-SIZE-001。 - 显式表达领域语义。 命名与类型表达职责、身份、状态和错误;所有权和副作用可见,避免字符串约定与隐式共享。
- 边界与数据流清晰:协议、领域、持久化与视图模型各守边界;在边界校验和转换,避免跨层共享可变状态。
- 保留维护上下文:记录决策原因、影响与风险,临时方案注明移除条件;技术债务关联任务,关键决策同步文档,不留无上下文的
TODO。 - 删除优于兼容:内部重构删除过时实现,不新增兼容层、deprecated shim 或双写;对外兼容义务按协议评估。
- 业务规则单一权威:同一领域规则只维护一份实现;允许多个存储后端和协议 adapter 封装适配差异,共用业务规则与契约。
- 优先验证完整行为:先验证用户可观察的行为,再按风险补齐回归、失败和生命周期测试;遵循
testing.md。 - 在授权范围内主动闭环。 依据仓库证据处理常规选择;澄清目标、权限或不可逆结果的歧义。异议须说明代价和替代方案。
- 修复一类问题,而不是一个问题
- 暴露异常优于简单掩盖:如果没有任何说明,默认的错误处理方式都是抛出,并在日志中留下记录。
- 数据库表结构须经用户明确批准:变更前说明表及结构的合理性,由用户裁决。
行事风格
- 像研究员一样判断,像工程师一样交付。 区分观察、推断和假设,以代码、复现或实验支持结论;说明局限,不补造数字,不把命令启动当成完成。
- 汇报风格:用户有阅读障碍,减少字数,多用 order list 结构化表达。
事实源与任务路由
先读 标准索引,区分现状与目标。按 docs/code-index/ 核实入口、同步变更。Peri loader 不继承父目录,须显式读取模块指引。
| 任务 | 先读 |
|---|---|
| Agent loop、Compact、provider、session | peri-agent/CLAUDE.md + architecture/rust |
| ACP host、stdio、prompt、event、caps | peri-acp/CLAUDE.md + architecture/rust |
| Controller/Runtime、cancel、Langfuse | architecture/rust + 对应 code-index |
| MCP(含内置实例)、plugin、skills、subagent、HITL、工具 | middlewares 与 mcp-packages/CLAUDE.md + architecture/rust |
| Workflow | middleware guide + docs/code-index/peri-workflow.md |
| TUI | peri-tui/CLAUDE.md + tui/rust;集成用例 docs/verification/tui-integration-cases/ |
| E2E | e2e/CLAUDE.md + testing |
| 交付验证 | scripts/check-changed.sh、scripts/verify-async.sh(开工先读 read) |
| 文档站 | peri-cool/CLAUDE.md + documentation |
| 历史学习 | .claude/skills/learn-from-history/SKILL.md |
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.
- 11d ago Changed · +1 lines · +14 tokens per session e7a6a060cc7f
- 17d ago Changed · -4 lines · -12 tokens per session f395a585db1a
- 1mo ago Changed · +6 lines · +4 tokens per session 463d28ae357b
- 1mo ago Changed · +9 lines · +487 tokens per session af724281c3a2
- 1mo ago Changed · -3 tokens per session 038640354ff8
- 1mo ago Changed · +12 tokens per session e0a7719ace82
- 1mo ago First seen · 62 lines · 1,179 tokens per session scan A 4d13022357f3
peri CLAUDE.md is an instructions file published in the GitHub repository KonghaYao/peri (247 stars, last pushed today), licensed Apache-2.0. It adds 1,681 tokens to every session, about $0.0067 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.
Other instructions, from other repositories
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).
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.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
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.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).
vscode model-prompts.instructions.md
Model-specific prompt authoring and registry guidelines.