opencodex: Instructions file for Codex

AGENTS.md

opencodex AGENTS.md is an instructions file for Codex, OpenCode from lidge-jun/opencodex. It costs 6,679 tokens per session, scanned C, original, MIT.

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

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions subagents; mentions Claude Code; mentions AGENTS.md.

This is lidge-jun/opencodex's own configuration. It tells Codex and OpenCode how to work on opencodex 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 opencodex configures →

About the project

opencodex is a local proxy that lets OpenAI Codex and other coding tools use language models from different providers through a common interface. It is for people who want to run models such as Claude, Gemini, Grok, DeepSeek, or Ollama with Codex, Claude Code, Claude Desktop, or Grok Build. The catalogue add-on supports workflows built around this proxy.

lidge-jun/opencodex · 18,235 stars · on GitHub · opencodex.me

Reuse

Borrowing it

Nothing to install: this file belongs to lidge-jun/opencodex. 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/lidge-jun/opencodex/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/lidge-jun/opencodex

Made for: Codex, OpenCode.

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 opencodex AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/lidge-jun/opencodex/agents-md"><img src="https://agentmods.dev/badge/instructions/lidge-jun/opencodex/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 6,679 This file is loaded in full into every session.
When invoked 6,679 The same file — it is already loaded in full.
Security scan C 2 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.06679 $0.06679
Opus 5.5 $0.02672 $0.02672
Sonnet 5.5 $0.01336 $0.01336
Haiku 4.5 $0.00668 $0.00668

Measured 7d ago against content hash 8eed3edfe4c1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 7d 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.

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 · 484 lines

How it starts

The opening of the file, as written. The whole thing — 484 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/ — Bun tests in domain directories that mirror src/ (tests/<domain>/*.test.ts; providers/ and adapters/ have one more level for the larger vendors). The explicit map is scripts/test-layout/layout.json plus its explicitShards sibling maps, with regex seeds and migration state in scripts/test-layout/seeds.json; tests/test-layout.test.ts enforces that every file resolves to a domain and sits in it, and only the two layout guards live at the root. Shared helpers in tests/helpers/, fixtures in tests/fixtures/, broader scenarios in tests/e2e-style/. Source-oracle tests resolve the repository through tests/helpers/repo-root.ts (repoRoot(), repoPath(), helperPath(), fixturePath()), never import.meta.dir + "/..". A new test file lands in its domain directory and needs an entry in both layout.json explicit (or its domain shard) and a tests/fixtures/test-layout-expected*.json shard (tests/test-layout-tooling.test.ts names the missing one); the regex seeds in seeds.json place a conventionally named file until then. History: devlog/_fin/260905_test_modularization_and_windows/.
  • gui/ — React + Vite dashboard; packaged output is served from gui/dist.
  • app/ — native macOS WidgetKit extension bundled into the Tauri desktop app; MenuBarCore is its snapshot model/formatting layer. Its tests are executables, not XCTest bundles — Command Line Tools ships neither a usable XCTest module nor the swift-testing runtime.
  • 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. structure/INDEX.md is the reading order and the source-ownership table, and structure/AGENTS.md holds the rules for changing anything in there. Ownership is not advisory: changing an owned source area obliges the same change to update its doc, and bun run structure:check (wired into the suite by tests/ci-workflows/structure-ssot.test.ts) fails on a doc that names a path this tree no longer has, on an invariant whose test is gone, and on a new src/ area nobody claimed.
  • scripts/ — release and maintenance tooling; scripts/release.ts is the release authority.
  • desktop/ — Tauri v2 desktop shell, bootstrap UI, and compiled proxy sidecar preparation.
  • devlog/ — planning and investigation notes, tracked in this repository. See "The devlog directory" below for what may and may not go there.

Read the full file on GitHub · 484 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. 7d ago Changed · +14 lines · +326 tokens per session 8eed3edfe4c1
  2. 9d ago Changed · +5 lines · +121 tokens per session b4d6f1dc4dfe
  3. 23d ago Changed · +8 lines · +133 tokens per session 6cc6ce871cea
  4. 1mo ago Changed · +1 lines · +18 tokens per session ad1bda04b2f7
  5. 1mo ago Changed · +10 lines · +175 tokens per session 80654eab1988
  6. 1mo ago Changed · +13 lines · +123 tokens per session 8aeeadb9b75b
  7. 1mo ago Changed · +49 lines · +675 tokens per session d5c37ad819a0
  8. 1mo ago Changed · +9 lines · +176 tokens per session 01fc2b107a0e
  9. 1mo ago Changed · -3 tokens per session 240dce7a5bf8
  10. 2mo ago First seen · 375 lines · 4,935 tokens per session scan C 8d8c9de6146a

Subscribe to this mod's changes

opencodex AGENTS.md is an instructions file published in the GitHub repository lidge-jun/opencodex (18,235 stars, last pushed 2d ago), licensed MIT. It adds 6,679 tokens to every session, about $0.0267 per session on Opus 5.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.

Related

opencodex AGENTS.md compared with instructions from other repositories

opencodex AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
opencodex AGENTS.mdlidge-jun/opencodexInstructions file18k2d agoMITC6,679Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode