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/dtzp555-max/ocp/agents-mdgit clone --depth 1 https://github.com/dtzp555-max/ocpWrote 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/dtzp555-max/ocp/agents-md)<a href="https://agentmods.dev/instructions/dtzp555-max/ocp/agents-md"><img src="https://agentmods.dev/badge/instructions/dtzp555-max/ocp/agents-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.12555 | $0.12555 |
| Opus 5 | $0.06277 | $0.06277 |
| Sonnet 5 | $0.02511 | $0.02511 |
| Haiku 4.5 | $0.01256 | $0.01256 |
Grade A, and why
ocp AGENTS.md scanned grade A with 1 finding 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 today.
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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
Two cautions from getting this wrong while writing it down. **A loud failure is not evidence of the category** — M3's `` `(' `` shell error is emitted by `sh` in a **child** (`spawnSync`) and reaches the suite as an ordi How it starts
The opening of the file, as written. The whole thing — 217 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Inherits: @~/.cc-rules/AGENTS.md
OCP — Open Claude Proxy — Agent Guidelines
Scope: the dtzp555-max/ocp repository.
Audience: any AI coding agent (Claude Code / Cursor / OpenCode / Copilot / Codex / Gemini) touching OCP source.
What this project is
OCP (Open Claude Proxy) is an open-source HTTP gateway that sits between the Claude Code CLI (cli.js) and Anthropic's public API. It forwards, observes, and multiplexes traffic that cli.js already emits — it is explicitly not an extension layer. A secondary role: registering OCP as a local provider inside OpenClaw (a sibling IDE-agnostic tool), so that users running OpenClaw against OCP see the same model list as native Claude Code.
Runtime: Node.js (ESM, .mjs throughout). No build step. No bundler. server.mjs is the single executable entrypoint; ocp and ocp-connect are CLI wrappers.
Stack
- Node.js 22.13+ (or 23.4+ on the 23 line), native ESM modules —
keys.mjsimportsnode:sqliteat module load and nothing on any launch path passes--experimental-sqlite; seescripts/lib/node-floor.mjs http/httpsbuilt-ins for the proxy core (no Express, no Fastify)models.jsonas the single source of truth for model metadata- GitHub Actions for CI (
alignment.yml,release.yml) ghCLI assumed for PR creation and release automation- No TypeScript. No test framework beyond
test-features.mjs(run vianpm test; CI workflow.github/workflows/test.yml). Keep dependencies minimal.
Key files to know
server.mjs— the proxy itself; every request path lives here. Governed byALIGNMENT.md.models.json— single source of truth for model IDs, aliases, and context windows. See ADR 0003.models.schema.json— the schemamodels.jsondeclares in its$schema. CI validates the SPOT against it (test-features.mjs) using the repo's ownvalidateJsonSchema, so a malformed entry fails the build instead of surfacing downstream in OpenClaw.setup.mjs— first-time installer; readsmodels.jsonto derive bootstrap config.scripts/sync-openclaw.mjs— idempotent OpenClaw registry sync invoked byocp update. See ADR 0004.ocp— user-facing CLI (install, update, start, stop, status, logs, etc.).scripts/b2-key-snapshot.mjs+docs/governance/b2-response-keys.json— the per-release record of every grandfathered Class B.2 endpoint's response key set, read from the wire.npm testboots a realserver.mjs, probes every B.2 endpoint+method pair inALIGNMENT.md's inventory, and fails on any key-path difference from the snapshot. If you add a field to a B.2 response, the suite goes red until you regenerate the snapshot (node scripts/b2-key-snapshot.mjs --write) — and regenerating is not authorization: ADR 0012 condition 5 still requires the field names in the PR body and the CHANGELOG. A removed or renamed key is not covered by ADR 0012 at all and needs its own ADR. Introduced by #346 to replace a CHANGELOG grep that could only ever see additions whose author wrote the marker. Since #357 there are TWO configuration profiles (scripts/b2-key-snapshot.mjs§B2_PROFILES), each with its own snapshot block, its own two-boot stability check and its ownALIGNMENT.mdcoverage check:probes(the default fleet configuration) andprobesTuiPool(CLAUDE_TUI_MODE=true,OCP_TUI_POOL_SIZE=1,CLAUDE_SKIP_PERMISSIONS=true), which is what guards/health'stui.poolcounter bag. Neither profile ever runs a realclaudepane:OCP_TUI_TMUX_BINpoints at a stubtmuxthat logs its argv and exits 1, and the suite asserts from that log that the only invocation islist-sessions— established by feeding a faketmuxto the realreapStaleTuiSessions: with the realtmuxa TUI-mode boot cankill-sessiona live legacy-namedocp-tui-<8hex>session, and reacheskill-serveronly when no ordinary session is present (lib/tui/session.mjs's!othersRemaingate). The stub is justified by the reachablekill-session, not by the stronger claim. The snapshot's ownnotCoveredblock states what it cannot see; read it before treating a green run as coverage.scripts/lib/install-dir.mjs— the single answer to "where is this OCP installed?", resolved from the code's own location (fileURLToPath(import.meta.url)) rather than$HOME.doctor.mjsandupgrade.mjseach used to answer it withjoin(homedir(), "ocp"), which is wrong on any install not at$HOME/ocp— and the one host that isn't is the hardened one, relocated to/optunder an unprivileged user to close #328's escalation chain, so hardening moved it off the only path the updater could see. NamedresolveInstallDir, notresolveOcpDir:keys.mjsalready owns that name for the~/.ocpdata directory. Introduced by #350 (#348).lib/claude-capability.mjs— the boot-time capability gate for theclaudeCLI (#455/#462). OCP spawnsclaudeon every request and had no version or capability gate; #453 made that sharper by depending on--system-prompt-file, whichclaude --helpdoes not list.classifyCapabilityProbe()is pure and returns three verdicts, and the asymmetry is the design: only an observederror: unknown option '--x'isabsentand refuses the boot; a missing binary, a blown budget or an unrecognised message isinconclusive, which warns and boots, so the gate cannot brick a fleet on an ambiguous reading.server.mjsdoes the spawn and theprocess.exit, followinglocalToolsSafetyError/lib/host-gate.mjs. The probe's argv comes frombuildCliArgs, never a hand-written list — that is the #339 shape, and mutation M5 (hardcode it) reddens on--tools.claudeparses options before validating their values, so pointing--system-prompt-fileat a missing path gives the two outcomes cleanly — and both exit 1, so the message discriminates and the exit code does not. Costs no quota (no model turn). Opt out withOCP_SKIP_CAPABILITY_PROBE=1; budget viaCLAUDE_CAPABILITY_PROBE_TIMEOUT_MS.ltBootsets the skip in its base env before the...envspread, deliberately unlikeOCP_TUI_TMUX_BIN— the tests that pin the gate have to be able to turn it back on.lib/spawn-token.mjs— the spawn-token decision extracted fromserver.mjs'sresolveSpawnToken(#429/#343):makeResolveSpawnToken({ isExpiring, now })applies the 5-minute expiry gate to CACHED creds on every spawn (the #146 forever-stale-token shape). The gate is mutation-proven by a fixed-nowcontrast test; production binds no injection, so behaviour is identical to the inline original.scripts/release-notes.mjs+scripts/lib/release-notes.mjs— what goes in a GitHub Release body, decided in a placenpm testcan reach..github/workflows/release.ymlused to pipe the CHANGELOG section verbatim intogh release create --notes-file; GitHub caps a body at 125 000 characters, v3.29.3's section is 169 670 bytes bywc -con the awk's output (169 669 throughBuffer.byteLengthon what the extractor now returns — the awk appended one trailing newline, and knowing which instrument produced a figure is the difference between the two numbers you will see in this commit), so the API answered422 … body is too longand v3.29.3 shipped with no Release (#441). The body is now the section when it fits — byte-identical, so nothing changes for a normal release — and otherwise a prefix cut at a block boundary (^#{1,6}or a top-level list marker) plus a pointer toCHANGELOG.mdat the tag;assertWithinLimitthen refuses loudly rather than letting the API be the only size check. The budget is counted in UTF-8 bytes although the cap is in characters, because a byte count is never smaller than a character count, so passing in bytes passes under either meaning — it costs headroom, never correctness. The workflow'srun:body deliberately contains no${{ }}:test-features.mjsslices it out between the#441anchors and executes it verbatim, which is the only thing that can catch release.yml no longer calling any of this — a release step is otherwise untestable except by cutting a tag, and a tag is not re-cuttable.ALIGNMENT.md— the constitution. Binding for anyserver.mjschange. See ADR 0002..github/workflows/alignment.yml— CI blacklist grep; fails the build on known-hallucinated tokens.CLAUDE.md— Claude-Code-specific session instructions + release_kit overlay (Iron Rule 5.5).docs/adr/— Architecture Decision Records. Read these before proposing governance or SPOT changes. Seedocs/adr/README.mdfor the index.docs/superpowers/plans/— active spec-kit plans.docs/superpowers/plans/shipped/archives plans that have been delivered (don't propose changes against shipped plans — they're history).docs/superpowers/specs/holds long-lived design documents that other code references (e.g., the SSE heartbeat design referenced fromserver.mjs).memory/constitution.md— spec-kit's project constitution (its standardmemory/location). Distinct from~/.cc-rules/memory/(cross-machine personal memory) and from this repo'sALIGNMENT.md(the OCP code-level constitution).
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.
- today Changed · +15 lines · +1,423 tokens per session 3b6f8e57e411
- 4d ago First seen · 202 lines · 11,132 tokens per session scan A 11b33b0078a1
ocp AGENTS.md is an instructions file published in the GitHub repository dtzp555-max/ocp (105 stars, last pushed 2d ago), licensed MIT. It adds 12,555 tokens to every session, about $0.0628 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
lyra-ai CLAUDE.md
Instructions for ahkedia/lyra-ai, covering claude code — lyra (lyra-ai), mandatory: git before/after work and project context.
inference-x AGENTS.md
Instructions for coeusyk/inference-x, covering openspec agent instructions for inferencex, working agreement, agent tooling (mandatory — token efficiency), two command paths only — no third and rtk proxy (rtk-ai/rtk).
lyra-ai AGENTS.md
Instructions for ahkedia/lyra-ai, covering agents.md - your workspace, git workflow (cursor, claude code, automation), two repos — public/private split (mandatory routing), session startup and memory.
inference-x CLAUDE.md
Instructions for coeusyk/inference-x, covering claude.md — inferencex, tooling (mandatory every session), two paths only — no third, token-savior mcp (if present) and why.
bridgenode-skill AGENTS.md
AGENTS.md instructions for bridgenode-ai/bridgenode-skill, covering agents.md — bridgenode skill & examples, what bridgenode is, how an agent pays (x402 flow, 4 steps), quick start (buyer side) and curl — full flow in examples/.
bridgenode-mcp AGENTS.md
AGENTS.md instructions for bridgenode-ai/bridgenode-mcp, covering agents.md, commands, structure, conventions and rules.