acp-adapter CLAUDE.md

acp-adapter CLAUDE.md is an instructions file for coding agents from beyond5959/acp-adapter. It costs 1,226 tokens per session, scanned A, original, MIT.

Repository instructions for the beyond5959/acp-adapter project. They define how the adapter communicates with Codex App Server, handles permissions, manages generated schemas, supports concurrent sessions, and tests changes.

In plain words
What is it for?
Use them when changing the Go adapter, its JSON-RPC communication, permissions, sessions, generated schema, or tests.
Why use it?
They prevent protocol messages from being mixed with logs and require unsafe actions to be denied unless permission is granted.

Instructions file

Install

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.

agentmods
npx agentmods add instructions/beyond5959/acp-adapter/claude-md
Clone the repo
git clone --depth 1 https://github.com/beyond5959/acp-adapter

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 acp-adapter CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/beyond5959/acp-adapter/claude-md.svg)](https://agentmods.dev/instructions/beyond5959/acp-adapter/claude-md)
Your own site
<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="Measured on agentmods" height="20"></a>
Per session 1,226 This file is loaded in full into every session.
When invoked 1,226 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 $0.01226 $0.01226
Opus 5 $0.00613 $0.00613
Sonnet 5 $0.00245 $0.00245
Haiku 4.5 $0.00123 $0.00123

Measured 5d ago against content hash da1de9f71e2c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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 5d 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 · 102 lines

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)

  1. stdout 严格纯净

    • 适配器 stdout 只能输出 ACP JSON-RPC 消息。任何日志/调试输出必须写 stderr。
    • 不得在任何代码路径中把非 ACP 消息写入 stdout。
  2. 下游必须走 Codex App Server

    • 不得直接解析 codex CLI 文本输出。必须通过子进程 codex app-server(stdio JSONL)通信。
  3. Schema 驱动

    • internal/codex/schema/make schema 生成,不得手写并提交。
    • 每次改动涉及 App Server 协议字段时,必须重新运行 make schema
  4. 安全 fail-closed

    • 未通过 session/request_permission 的情况下,禁止执行:写盘、命令执行、网络访问、MCP 副作用工具。
  5. 并发约束

    • 每个 session 同时最多 1 个 active turn。
    • session/cancel 必须快速生效且不泄漏 goroutine。
  6. 测试门槛

    • 每次代码改动后必须确保 go test ./... 通过,不得跳过。

1. 开工前必读

在开始任何实现或修改前,必须先阅读以下文件(以这些文件为准,不依赖上下文记忆):

  • PROGRESS.md:当前进度、已完成/未完成验收条目、下一步计划
  • docs/DECISIONS.md:关键技术决策与取舍(为什么这么做)
  • docs/KNOWN_ISSUES.md:已知问题/坑位/规避方式
  • docs/SPEC.md:完整技术方案(权威来源)
  • docs/ACCEPTANCE.md:逐条验收清单

2. 收尾时必更

完成一个功能块后,必须更新:

  1. PROGRESS.md:勾选已完成的验收条目,记录下一步
  2. docs/DECISIONS.md:记录新增/改变的关键决策(ADR 格式,含替代方案与理由)
  3. docs/KNOWN_ISSUES.md:记录新发现的坑、限制、复现/规避步骤

3. 工程规范

  • Go 版本:Go 1.24+
  • Module 路径github.com/beyond5959/acp-adapter(所有内部导入必须用此前缀)
  • 目录分层internal/acpinternal/codexinternal/bridgeinternal/configinternal/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 (子进程)

Read the full file on GitHub · 102 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. 5d ago First seen · 102 lines · 1,226 tokens per session scan A da1de9f71e2c

Subscribe to this mod's changes

acp-adapter CLAUDE.md is an instructions file published in the GitHub repository beyond5959/acp-adapter (18 stars, last pushed 4mo ago), licensed MIT. It adds 1,226 tokens to every session, about $0.0061 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