opencodex AGENTS.md

A set of instructions for working on opencodex, a local proxy that lets coding tools use different AI providers through one service. It explains the repository layout and rules for keeping optional parts separate from the core runtime.

In plain words
What is it for?
Use it when working on opencodex source code, tests, its dashboard, documentation, release scripts, or architecture.
Why use it?
It gives an agent the background needed to change or review the right part of the project without confusing the active TypeScript system with retired or optional code.

Instructions file for CodexOpenCode

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/lidge-jun/opencodex/agents-md
Clone the repo
git clone --depth 1 https://github.com/lidge-jun/opencodex

Made for: Codex, OpenCode.

Per session 4,317 This file is loaded in full into every session.
When invoked 4,317 The same file — it is already loaded in full.
Security scan C 2 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.04317 $0.04317
Opus 5 $0.02159 $0.02159
Sonnet 5 $0.00863 $0.00863
Haiku 4.5 $0.00432 $0.00432

Measured yesterday against content hash 208bb1792a7f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

opencodex AGENTS.md scanned grade C with 2 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 yesterday.

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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

curl -fsSL https://bun.sh/install | bash # installs ~/.bun/bin/bun

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -fsSL https://bun.sh/install | bash # installs ~/.bun/bin/bun
AGENTS.md · 344 lines

How it starts

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

AGENTS.md

Guidance for AI agents (and humans) working on or reviewing this repository.

What this project is

opencodex (ocx) is a universal provider proxy for OpenAI Codex and Claude Code: one local proxy that lets Codex CLI/App/SDK and Claude Code use many LLM providers (Claude, Gemini, Grok, DeepSeek, Ollama, and more). The runtime is Bun-native TypeScript with no separate server compile step.

Repository layout

  • src/ — proxy runtime: routing, provider adapters, config, management API.
  • tests/ — flat Bun tests (tests/*.test.ts); shared fixtures in tests/helpers/, broader scenarios in tests/e2e-style/.
  • gui/ — React + Vite dashboard; packaged output is served from gui/dist.
  • docs-site/ — public docs (Astro + Starlight), deployed to GitHub Pages.
  • go/ — retired Go native-runtime experiment; kept only where the TypeScript runtime still references it. New work does not go here.
  • structure/ — maintainer invariants and architecture notes; read before changing shared subsystems.
  • scripts/ — release and maintenance tooling; scripts/release.ts is the release authority.
  • devlog/ — planning and investigation notes, tracked in this repository. See "The devlog directory" below for what may and may not go there.

Read the nearest nested AGENTS.md before changing files in a scoped directory (src/, gui/, docs-site/, scripts/, .github/).

Optional subsystems stay off the core path

src/lab/ (Compatibility Lab) is opt-in. A user who configures one provider and one model — no routing profile, no Lab — must execute no Lab code and start no Lab timer.

Three files carry every such user's request path and must not reach src/lab/, directly or transitively:

  • src/router.ts
  • src/server/lifecycle.ts
  • src/server/responses/core.ts

tests/core-lab-boundary.test.ts enforces this by walking the runtime import graph and printing the offending chain on failure. It is not a style rule: the original violation hid in a six-hop chain (assemble → quota → auth-api → native-main-admission → lifecycle → lab) where no single file looked wrong, and it pulled ~69 Lab modules into every install.

Read the full file on GitHub · 344 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. yesterday First seen · 344 lines · 4,317 tokens per session scan C 208bb1792a7f

Subscribe to this mod's changes

opencodex AGENTS.md is an instructions file published in the GitHub repository lidge-jun/opencodex (12,581 stars, last pushed yesterday), licensed MIT. It adds 4,317 tokens to every session, about $0.0216 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.