openapi: Instructions file for Claude Code

CLAUDE.md

openapi CLAUDE.md is an instructions file for Claude Code from longbridge/openapi. It costs 1,265 tokens per session, scanned A, original, Apache-2.0.

A set of project instructions for keeping the Longbridge OpenAPI software library consistent across Rust, C, C++, Java, Node.js, and Python. It explains which files to update and which checks to run after changes.

In plain words
What is it for?
Use it when adding or changing API endpoints, data types, enums, or fields, and when modifying Rust or one of the supported language libraries.
Why use it?
Changes to one language layer can leave the others out of sync. These instructions provide a checklist for updating related layers and generated files correctly.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md.

This is longbridge/openapi's own configuration. It tells Claude Code how to work on openapi itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything openapi configures →

Reuse

Borrowing it

Nothing to install: this file belongs to longbridge/openapi. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/longbridge/openapi/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/longbridge/openapi

Made for: Claude Code.

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 openapi CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/longbridge/openapi/claude-md/github.svg)](https://agentmods.dev/instructions/longbridge/openapi/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/longbridge/openapi/claude-md"><img src="https://agentmods.dev/badge/instructions/longbridge/openapi/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.

agentmods 80×15 button for openapi CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/longbridge/openapi/claude-md"><img src="https://agentmods.dev/badge/instructions/longbridge/openapi/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,265 This file is loaded in full into every session.
When invoked 1,265 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.01265 $0.01265
Opus 5.5 $0.00506 $0.00506
Sonnet 5.5 $0.00253 $0.00253
Haiku 4.5 $0.00127 $0.00127

Measured 2mo ago against content hash b5b3d39a2e35, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

openapi 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 2mo 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 · 119 lines

How it starts

The opening of the file, as written. The whole thing — 119 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent Guidelines

SDK layers — update ALL of them when adding/changing an API or type

This repo ships the SDK in six language layers. The Rust core is the source of truth; every other layer is a hand-written binding that mirrors it. When you add a new API endpoint, type, enum, or field, you must propagate the change to every layer below — it is easy to forget the C++ and Java layers, so treat this list as a checklist:

  1. Rust core (rust/src/) — the source of truth.
  2. C (c/src/) — FFI structs (*Owned + ToFFI), enums, extern "C" fns. Header c/csrc/include/longbridge.h is auto-generated by cbindgen.
  3. C++ (cpp/) — wraps the C layer. Update cpp/include/*.hpp (public types/methods), cpp/src/convert.hpp (C↔C++ conversions), and cpp/src/*_context.cpp.
  4. Java (java/) — JNI. Update the Rust JNI layer (java/src/*.rs) and the Java classes (java/javasrc/src/main/java/com/longbridge/).
  5. Node.js (nodejs/src/) — napi. index.d.ts / index.js are auto-generated by npm run build:debug.
  6. Python (python/src/) — PyO3. Keep the hand-maintained stub python/pysrc/longbridge/openapi.pyi in sync.

After modifying Rust code

Run the following commands from the workspace root:

cargo clippy --all --all-features
cargo +nightly fmt --all

Note: cargo +nightly fmt may reflow doc comments (e.g. /// @param … lines). Do not revert those changes — they are intentional formatting output and should be committed as-is.

After modifying the Node.js SDK (nodejs/)

Build the native .node binary from the nodejs/ directory:

npm run build:debug

nodejs/index.d.ts and nodejs/index.js are auto-generated by npm run build:debug — never edit them by hand.

After updating the proto submodule (rust/crates/proto/openapi-protobufs/)

Run the following command from the workspace root to regenerate the Rust proto source files (e.g. rust/crates/proto/src/longbridge.control.v1.rs, rust/crates/proto/src/longbridge.quote.v1.rs, rust/crates/proto/src/longbridge.trade.v1.rs):

Read the full file on GitHub · 119 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. 2mo ago First seen · 119 lines · 1,265 tokens per session scan A b5b3d39a2e35

Subscribe to this mod's changes

openapi CLAUDE.md is an instructions file published in the GitHub repository longbridge/openapi (465 stars, last pushed yesterday), licensed Apache-2.0. It adds 1,265 tokens to every session, about $0.0051 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.

Related

openapi CLAUDE.md compared with instructions from other repositories

openapi CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
openapi CLAUDE.mdlongbridge/openapiInstructions file465yesterdayApache-2.0A1,265Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode