codex-buddy CLAUDE.md

Project instructions for codex-buddy, a macOS command-line and menu-bar tool for running Codex with different accounts. It keeps each account’s credentials and session data separate while switching the active account through links.

In plain words
What is it for?
Use it when changing account switching, parallel runs, Codex configuration directories, authentication files, session history, or the command-line and menu-bar parts.
Why use it?
It documents the account-isolation rules and shared source of truth, helping changes avoid stale credentials or duplicated logic between Rust and Swift.

Instructions file

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/codeprometheus/codex-buddy/claude-md
Clone the repo
git clone --depth 1 https://github.com/CodePrometheus/codex-buddy
Per session 1,174 This file is loaded in full into every session.
When invoked 1,174 The same file — it is already loaded in full.
Security scan A 0 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.01174 $0.01174
Opus 5 $0.00587 $0.00587
Sonnet 5 $0.00235 $0.00235
Haiku 4.5 $0.00117 $0.00117

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

Security

Grade A, and why

codex-buddy 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 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.

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

How it starts

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

codex-buddy

A macOS CLI to switch between and run Codex CLI accounts in parallel. Logic lives in crates/core; crates/cli is a thin shell. apps/tray is a SwiftUI menu-bar app (work in progress) that reuses core through crates/ffi's uniffi bindings — same invariants, same source of truth, no logic duplicated into Swift.

How it works (the invariant everything rests on)

Each account keeps one real auth.json in ~/.codex-buddy/<alias>/. ~/.codex/auth.json is a symlink to the active account's file. Switching only repoints that symlink; auth files are never copied. This sidesteps OAuth refresh-token rotation: a credential exists as exactly one file, refreshed in place, so there is never a stale copy that would force a re-login.

  • Switched (per account; ~/.codex/<entry> symlinks to the active account's copy): auth.json, sessions/, history.jsonl.
  • Isolated (per account, never shared or linked): all sqlite (sqlite/ dir, *.sqlite*).
  • Shared (symlinked back to ~/.codex): everything else — config.toml, AGENTS.md, rules, ...
  • Parallel = run codex with CODEX_HOME=<account dir>; switch = repoint the switched symlinks.

Hard requirement: codex's cli_auth_credentials_store must be file (keyring / auto / ephemeral move or delete auth.json and break the scheme). config_check enforces this.

Layout

  • crates/core — all logic, no CLI or interactive IO. Modules: paths, error, auth, registry, layout, config_check, init, ops, doctor, usage, history, recommend, transfer, remote, running. Unit tests live in src/<module>/tests.rs.
  • crates/cli — arg parsing (pico-args), prompts, output; delegates everything to core. New command families live under src/commands/, while reusable JSON/output DTOs live in src/output.rs; keep main.rs focused on dispatch and shared presentation.
  • crates/ffi — uniffi bindings over core for the Swift tray (list_accounts, switchAccount, addAccount, ...). Thin: no business logic, just type conversion. core and cli stay free of any FFI dependency.
  • crates/ffi-bindgen — a separate uniffi-bindgen binary crate that generates the Swift bindings from the built codex-buddy-ffi library. Split out so its uniffi/cli feature (pulls in clap) never ends up in the shipped cdylib's dependency graph.
  • apps/tray — the SwiftUI menu-bar app (Swift Package, not part of the Cargo workspace). Run apps/tray/Scripts/build-ffi.sh first to build the xcframework + generate the Swift bindings (both gitignored, regenerated from crates/ffi), then swift build inside apps/tray.

Read the full file on GitHub · 73 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 · 73 lines · 1,174 tokens per session scan A f28c21539d2a

Subscribe to this mod's changes

codex-buddy CLAUDE.md is an instructions file published in the GitHub repository CodePrometheus/codex-buddy (2 stars, last pushed 26d ago), licensed MIT. It adds 1,174 tokens to every session, about $0.0059 per session on Opus 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-31.