codex-multi-auth: Instructions file for Codex

AGENTS.md

codex-multi-auth AGENTS.md is an instructions file for Codex, OpenCode from ndycode/codex-multi-auth. It costs 6,249 tokens per session, scanned B, original, MIT.

A project knowledge-base document containing a repository's purpose, structure, conventions, and known pitfalls.

In plain words
What is it for?
Use it when working on the codex-multi-auth project, especially for account management, command wrappers, storage, routing, and release-related changes.
Why use it?
It gives coding agents a shared map of the codebase so they can find the right files and follow project-specific rules.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: reads $CODEX_HOME, but also the file is AGENTS.md. Also seen: reads ~/.codex paths; mentions AGENTS.md; mentions Codex.

This is ndycode/codex-multi-auth's own configuration. It tells Codex and OpenCode how to work on codex-multi-auth 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 codex-multi-auth configures →

Reuse

Borrowing it

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

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 codex-multi-auth AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/ndycode/codex-multi-auth/agents-md"><img src="https://agentmods.dev/badge/instructions/ndycode/codex-multi-auth/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 6,249 This file is loaded in full into every session.
When invoked 6,249 The same file — it is already loaded in full.
Security scan B 1 finding. 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.06249 $0.06249
Opus 5.5 $0.02500 $0.02500
Sonnet 5.5 $0.01250 $0.01250
Haiku 4.5 $0.00625 $0.00625

Measured 6d ago against content hash 1f97c98d5961, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

codex-multi-auth AGENTS.md scanned grade B 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 6d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- Official Codex state: `~/.codex/auth.json`, `~/.codex/accounts.json`, `~/.codex/config.toml` (`cli_auth_credentials_store="file"` is enforced top-level; opt out `CODEX_MULTI_AUTH_ENFORCE_CLI_FILE_AUTH_STORE=0`).
AGENTS.md · 210 lines

How it starts

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

PROJECT KNOWLEDGE BASE

Generated: 2026-10-11 Commit: 40c1e2e7 Branch: main Package version: 2.24.0

OVERVIEW

codex-multi-auth is a Codex CLI-first OAuth account manager and optional forwarding wrapper for the official Codex CLI. The architecture is manager-first: the codex-multi-auth bin (scripts/codex-multi-auth.js) owns the account-management CLI — 31 subcommands dispatched through lib/codex-manager.ts (runCodexMultiAuthCli), codex-multi-auth login ≡ codex-multi-auth auth login. The codex-multi-auth-codex bin (scripts/codex.js) owns explicit wrapper forwarding to the official Codex CLI plus shadow CODEX_HOME and runtime-rotation-proxy setup; mcodex is a launcher-only convenience wrapper over scripts/codex.js; codex-multi-auth-app-launcher is a reversible OS launcher routing helper. Runtime rotation is default-on: forwarded Responses/model traffic routes through a loopback-only account-rotation proxy (provider id codex-multi-auth-runtime-proxy). Local governance (usage ledger, budget guards, account policies, routing profiles, quota cache, local bridge tokens) stays file-backed under the multi-auth root. index.ts remains the exported plugin-host compatibility entry, but the primary product surface is the account manager, optional wrapper, storage, runtime proxy, governance commands, and repair tooling.

STRUCTURE

./
├── scripts/
│   ├── codex-multi-auth.js    # `codex-multi-auth` bin: standalone account-manager CLI entrypoint
│   ├── codex.js               # `codex-multi-auth-codex` bin: official-CLI forwarder, shadow CODEX_HOME + runtime proxy setup
│   ├── mcodex.js              # `mcodex` bin: launcher only — forwards to codex.js; optional --monitor / --tmux
│   ├── codex-app-launcher.js  # `codex-multi-auth-app-launcher` bin: reversible Windows/macOS/Linux launcher routing
│   ├── codex-routing.js       # auth-subcommand routing + compatibility alias normalization
│   ├── codex-bin-resolver.js  # official Codex binary discovery (env override → npm → prefix roots → PATH)
│   ├── codex-app-router.js    # detached persistent localhost router behind `rotation bind-app` (shipped, not a bin)
│   ├── postinstall.js         # notice-only npm hook; real setup is lib/runtime/first-run.ts
│   ├── preuninstall.js        # shipped but not an npm hook; `uninstall` subcommand replicates it
│   ├── install-codex-auth-utils.js  # installer helpers (install-codex-auth.js is repo-only, not shipped)
│   ├── repo-hygiene.js        # `clean`/`check` repo hygiene + Windows retry helpers
│   ├── copy-oauth-success.js, generate-config-schema.mjs  # build tooling
│   ├── check-pack-budget.mjs + -lib.js                    # package size budget check
│   ├── test-model-matrix.js, benchmark-*.mjs, bench-format/, test-all-models.sh, validate-model-map.sh  # matrix/bench tooling
│   └── audit-dev-allowlist.js, update-vendor-provenance.mjs, verify-vendor-provenance.mjs  # audit/vendor tooling
├── index.ts                  # plugin-host compatibility entry (`.` export: OpenAIOAuthPlugin)
├── lib/                      # core runtime logic (see lib/AGENTS.md)
│   ├── auth/                 # OAuth flow, PKCE, dual-bind callback server, device auth, token utils
│   ├── storage.ts + storage/ # V3 account pool: load/save, three-way snapshot merge, dedup, backups/WAL, flagged pool, file/json-store locks
│   ├── accounts.ts + accounts/ # pool facade, health scoring, cooldowns, per-account rate limits
│   ├── runtime-rotation-proxy.ts + runtime/ # loopback Responses/model proxy; app bind, first-run, native binding, selection, quota, checks
│   ├── request/              # request transform, headers, SSE handling, failover/backoff policy
│   ├── policy/               # runtime policy composition + hot-path store caches
│   ├── usage/                # append-only local usage ledger, pricing, redaction
│   ├── codex-cli/            # official Codex CLI state sync + writer helpers
│   ├── codex-manager.ts + codex-manager/ # CLI dispatcher, command modules, settings hub, login menus
│   ├── prompts/              # model-family prompts, GitHub ETag cache
│   ├── context-budget*/ + context-overflow.ts  # proactive budget guard + reactive overflow → synthesized replies
│   ├── oc-chatgpt-*.ts       # oc-chatgpt multi-auth interop (target detect, import adapter, sync orchestrator)
│   ├── recovery/             # conversation recovery state
│   ├── tools/                # hashline helper tools
│   ├── ui/                   # TUI rendering, menus, copy, theme, select
│   └── (flat modules)        # governance stores, quota, refresh machinery, rotation, config, schemas, utils
├── test/                     # vitest suites (see test/AGENTS.md) — 424 files incl. property/ + chaos/
├── docs/                     # user docs + reference/, releases/ (~87), development/ runbooks, audits/, design/, benchmarks/
├── config/                   # pluginConfig templates (modern/legacy/minimal) + generated JSON schema
├── vendor/                   # vendored codex-ai-plugin + codex-ai-sdk type-only shims (+ provenance.json)
├── assets/                   # static assets (icons, hero image)
├── bench/                    # format benchmark harness
├── skills/                   # codex-auth-setup skill (referenced by plugin manifest; not in files[])
├── .github/                  # CI workflows, issue/PR templates, plugin scanner fixtures
└── dist/                     # build output (generated, do not edit)

Read the full file on GitHub · 210 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. 6d ago Changed 1f97c98d5961
  2. 10d ago Changed e08e902a427f
  3. 12d ago Changed 10f94c699239
  4. 15d ago Changed · +2 tokens per session c617a923fc74
  5. 20d ago Changed · +3 tokens per session e729a8390ed4
  6. 24d ago Changed · -2 tokens per session 8608492b58d7
  7. 27d ago Changed · +8 tokens per session 63902feb5fb2
  8. 28d ago Changed · +65 lines · +3,471 tokens per session 872da7f309ff
  9. 29d ago Changed 124f795a3a68
  10. 1mo ago First seen · 145 lines · 2,767 tokens per session scan B c11f5c9f5b72

Subscribe to this mod's changes

codex-multi-auth AGENTS.md is an instructions file published in the GitHub repository ndycode/codex-multi-auth (556 stars, last pushed 7d ago), licensed MIT. It adds 6,249 tokens to every session, about $0.0250 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). 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

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,715 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,786 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens