Borrowing it
Nothing to install: this file belongs to beyond5959/acp-adapter. 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/beyond5959/acp-adapter/master/CLAUDE.mdgit clone --depth 1 https://github.com/beyond5959/acp-adapterWrote 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/beyond5959/acp-adapter/claude-md)<a href="https://agentmods.dev/instructions/beyond5959/acp-adapter/claude-md"><img src="https://agentmods.dev/badge/instructions/beyond5959/acp-adapter/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/beyond5959/acp-adapter/claude-md"><img src="https://agentmods.dev/badge/instructions/beyond5959/acp-adapter/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.01226 | $0.01226 |
| Opus 5.5 | $0.00490 | $0.00490 |
| Sonnet 5.5 | $0.00245 | $0.00245 |
| Haiku 4.5 | $0.00123 | $0.00123 |
Grade A, and why
acp-adapter 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 1mo 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 — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
本文件是 Claude Code 在此仓库工作的行为规范。所有约束优先于默认行为。
0. 最高优先级约束(MUST)
-
stdout 严格纯净
- 适配器 stdout 只能输出 ACP JSON-RPC 消息。任何日志/调试输出必须写 stderr。
- 不得在任何代码路径中把非 ACP 消息写入 stdout。
-
下游必须走 Codex App Server
- 不得直接解析
codexCLI 文本输出。必须通过子进程codex app-server(stdio JSONL)通信。
- 不得直接解析
-
Schema 驱动
internal/codex/schema/由make schema生成,不得手写并提交。- 每次改动涉及 App Server 协议字段时,必须重新运行
make schema。
-
安全 fail-closed
- 未通过
session/request_permission的情况下,禁止执行:写盘、命令执行、网络访问、MCP 副作用工具。
- 未通过
-
并发约束
- 每个 session 同时最多 1 个 active turn。
session/cancel必须快速生效且不泄漏 goroutine。
-
测试门槛
- 每次代码改动后必须确保
go test ./...通过,不得跳过。
- 每次代码改动后必须确保
1. 开工前必读
在开始任何实现或修改前,必须先阅读以下文件(以这些文件为准,不依赖上下文记忆):
PROGRESS.md:当前进度、已完成/未完成验收条目、下一步计划docs/DECISIONS.md:关键技术决策与取舍(为什么这么做)docs/KNOWN_ISSUES.md:已知问题/坑位/规避方式docs/SPEC.md:完整技术方案(权威来源)docs/ACCEPTANCE.md:逐条验收清单
2. 收尾时必更
完成一个功能块后,必须更新:
PROGRESS.md:勾选已完成的验收条目,记录下一步docs/DECISIONS.md:记录新增/改变的关键决策(ADR 格式,含替代方案与理由)docs/KNOWN_ISSUES.md:记录新发现的坑、限制、复现/规避步骤
3. 工程规范
- Go 版本:Go 1.24+
- Module 路径:
github.com/beyond5959/acp-adapter(所有内部导入必须用此前缀) - 目录分层:
internal/acp、internal/codex、internal/bridge、internal/config、internal/observability,不得随意新增顶层目录 - 错误处理:优先显式处理;不得吞错;对外错误必须带上下文(sessionId/threadId/turnId)
- 日志:结构化 JSON 写 stderr;不得用
fmt.Println等打到 stdout
4. 禁止事项(MUST NOT)
- 不得把任何日志/调试文本写到 stdout
- 不得引入 LSP 的 Content-Length framing
- 不得在未通过 permission 的情况下执行写盘/命令/网络/副作用工具
- 不得修改
go.mod的 module 路径 - 不得绕过
go test ./...(除非用户明确要求)
5. 运行与调试
# 常规测试
go test ./...
# 真实 app-server e2e(需本机有 codex 及认证)
E2E_REAL_CODEX=1 go test ./... -run TestE2EReal -count=1
# 压力回归(100 turns)
make stress-j1
# Schema 生成与校验
make schema
# 构建二进制
go build -o ./bin/acp ./cmd/acp
6. 关键架构速查
ACP Client (Zed/etc)
↕ ACP stdio newline-delimited JSON-RPC
acp (--adapter codex|claude) ← cmd/ 入口委托 pkg/codexacp / pkg/claudeacp
↕ App Server stdio JSONL JSON-RPC
codex app-server (子进程)
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.
- 1mo ago First seen · 102 lines · 1,226 tokens per session scan A da1de9f71e2c
acp-adapter CLAUDE.md is an instructions file published in the GitHub repository beyond5959/acp-adapter (20 stars, last pushed 6mo ago), licensed MIT. It adds 1,226 tokens to every session, about $0.0049 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.