@christiandoxa/prodex
v0.104.0
Published
Safe multi-account auto-rotate for Codex CLI with isolated CODEX_HOME profiles
Readme
prodex
prodex is a multi-account Codex wrapper with auto-rotation.
Use multiple Codex accounts from one command line. When the active account runs out of quota, prodex can route the next work to another available account.
Contents
- Why prodex
- Requirements
- Installation
- Optional tools
- Quick start
- Daily command:
prodex s - Commands
- Modes
- Profiles
- Local model support
- Utilities and diagnostics
- Advanced behavior
- Documentation
- Support
Why prodex
Use prodex if you want to:
- use multiple Codex accounts from one CLI
- rotate to another account when quota runs out
- keep profile credentials separated
- keep sessions attached to the profile that created them
- run Codex, Caveman mode, Super mode, and Claude Code through the same wrapper
If you only use one Codex account and do not need quota rotation, you probably do not need prodex.
Requirements
You need at least one logged-in Prodex profile.
| Tool | Used by |
|---|---|
| Codex CLI | prodex, prodex run, prodex caveman, prodex super |
| Claude Code | prodex claude |
| Claude-Mem | mem variants |
| RTK | rtk variants and prodex s / prodex super |
Installation
npm
npm install -g @christiandoxa/prodexSource checkout
cargo install --path .If you install from source, make sure the codex binary in your PATH is already installed and up to date.
Optional tools
prodex can run without Claude-Mem, RTK, SQZ, token-savior, claw-compactor, or llm-min docs.
Install them only if you want to use commands such as:
prodex caveman mem
prodex caveman mem rtk
prodex rtk
prodex sqz
prodex tokensavior
prodex clawcompactor
prodex llmmin
prodex s
prodex super
prodex claude mem
prodex claude caveman memClaude-Mem is used by the mem variants.
Recommended install:
npx claude-mem installThen follow the interactive prompts.
You can also install it from inside Claude Code:
/plugin marketplace add thedotmack/claude-mem
/plugin install claude-memAfter installation, restart Claude Code or your coding CLI.
Do not use
npm install -g claude-memas the main install method. That installs the SDK/library only; it does not register the plugin hooks or start the worker service.
RTK is used by the rtk variants and by my daily prodex s / prodex super workflow.
Homebrew
brew install rtkLinux/macOS quick install
curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | shIf it installs to ~/.local/bin, make sure that directory is in your PATH:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrcFor Zsh:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrcCargo
cargo install --git https://github.com/rtk-ai/rtkVerify RTK
rtk --version
rtk gainIf rtk --version works but rtk gain fails, you may have installed a different package named rtk.
Remove it and reinstall from the Git URL:
cargo uninstall rtk
cargo install --git https://github.com/rtk-ai/rtkInitialize RTK
For Codex:
rtk init -g --codexFor Claude Code:
rtk init -gThen restart your coding tool.
Quick start
Import your current Codex login
If your current Codex home is already logged in:
prodex profile import-current mainOr create profiles from scratch
prodex login
prodex profile add second
prodex login --profile secondCheck profiles and quota
prodex profile list
prodex quota --all
prodex session listStart Codex through Prodex
prodexOr run a one-off prompt:
prodex exec "review this repo"prodex profile import copilot
prodex profile import copilot --name copilot-main --activateWhen you import a Copilot profile, Prodex does not move the Copilot token into Prodex-managed storage. It only records the provider identity and API endpoint in its own metadata.
Daily command: prodex s
For daily work, I use:
prodex sprodex s is an alias for:
prodex superThis is the mode I tune and use myself every day.
It combines:
- Caveman mode
- Claude-Mem transcript watching
- RTK shell-command guidance
- full-access launch mode
- Smart Context Autopilot in the runtime proxy
- deterministic/local accommodation for
sqz,token-savior,claw-compactor, andllm-min.txt-style low-token workflows
prodex s
prodex s exec "review this repo"prodex super expands to:
prodex caveman mem rtk sqz tokensavior clawcompactor llmmin --full-accessFull access maps to Codex's sandbox-bypass launch flag. Use it only when you intentionally want Codex to run without the normal approval and sandbox protections.
Super's built-in optimization stack is deliberately local and deterministic. It preloads the existing Caveman, Claude-Mem, and RTK pieces, auto-registers sqz-mcp and token-savior MCP servers when those binaries are already on PATH or in a managed prodex-optimizers checkout, then uses Smart Context Autopilot plus low-token workflow accommodations for targets such as claw-compactor and llm-min.txt.
RTK and SQZ split the token work across different sides of the flow:
- RTK works upstream/input-side. Use
rtk <cmd>for noisy terminal commands before their output enters the model context, such asgit diff,cargo test,npm test, build logs, and package-manager output. - SQZ works downstream/context-side through the auto-registered
prodex-sqzMCP server. Use it for repeated workspace reads, large text blobs, and long-session context reuse instead of emitting the same full content again.
Managed optimizer checkouts are discovered from PRODEX_OPTIMIZERS_HOME, $XDG_DATA_HOME/prodex-optimizers, then ~/.local/share/prodex-optimizers.
Commands
prodex
prodex s
prodex exec "review this repo"
prodex quota --all
prodex profile list
prodex session listprodex
prodex run
prodex run --profile main
prodex run --dry-run
prodex exec "review this repo"prodex s
prodex s exec "review this repo"
prodex super
prodex super --profile main
prodex super --dry-runprodex quota --all
prodex quota --all --once
prodex quota --all --auth no-auth --onceprodex session list
prodex session current
prodex session current --include-subagentsprodex update --helpprodex update passes through to codex update directly. It does not use Prodex profile selection, quota preflight, or the local runtime proxy.
prodex run 019c9e3d-45a0-7ad0-a6ee-b194ac2d44f9
printf 'context from stdin' | prodex run exec "summarize this"Unknown top-level Codex subcommands remain managed Codex launches.
For example:
prodex remote-controlis equivalent to:
prodex run remote-controlunless Prodex explicitly owns that command.
Modes
| Mode | Command | Description |
|---|---|---|
| Normal Codex | prodex or prodex run | Managed Codex launch with profile selection and quota routing. |
| Caveman | prodex caveman | Runs Codex with a temporary overlay CODEX_HOME. |
| Super | prodex s or prodex super | Daily mode with Caveman, Claude-Mem, RTK guidance, full access, and deterministic/local token optimizations. |
| Claude Code | prodex claude | Runs Claude Code through Prodex-managed state. |
prodex
prodex run
prodex run --profile main
prodex exec "review this repo"prodex caveman
prodex caveman mem
prodex caveman mem rtk
prodex rtk
prodex sqz
prodex tokensavior
prodex clawcompactor
prodex llmmin
prodex caveman --dry-run
prodex caveman --profile main
prodex caveman exec "review this repo in caveman mode"
prodex caveman 019c9e3d-45a0-7ad0-a6ee-b194ac2d44f9prodex caveman runs Codex with a temporary overlay CODEX_HOME, so the base profile home stays unchanged after the session ends.
If you use the mem variant, Prodex points an existing Claude-Mem Codex setup to the active Prodex session path instead of the default ~/.codex/sessions.
Add optimizer prefixes before Codex args when you want Prodex to inject a specific launch overlay for that session: mem, rtk, sqz, tokensavior, clawcompactor, or llmmin. Top-level shortcuts such as prodex rtk and prodex sqz map to prodex caveman <prefix>.
RTK is still an external binary. Install it separately if rtk gain is unavailable.
prodex s
prodex s exec "review this repo"
prodex super
prodex super --profile main
prodex super --dry-run
prodex super 019c9e3d-45a0-7ad0-a6ee-b194ac2d44f9prodex s is the short alias for prodex super.
This is my daily mode. It is the path I keep tuning for normal work: Caveman enabled, Claude-Mem transcript watching enabled, RTK guidance enabled, full access available, and context handling handled by the runtime proxy.
Super mode uses Prodex's slim Claude-Mem Codex schema by default to avoid storing full assistant/tool output in recall context.
Use --mem-super-slim to store prompt summaries/references instead of full prompt bodies:
prodex super --mem-super-slimUse --mem-full when you need the full transcript schema:
prodex super --mem-fullSuper also enables Smart Context Autopilot in the runtime proxy.
It keeps exact pass-through for continuation-sensitive requests. When safe, it uses adaptive token budgeting, artifact-backed large tool outputs, duplicate suppression, blob/noise detection, stable cache-friendly context framing, and critical-signal self-checks to reduce token load without dropping failure details.
The Super optimization stack is meant to stay deterministic and local by default. It auto-registers sqz-mcp and token-savior MCP servers when those binaries are already on PATH or in a managed prodex-optimizers checkout, and accommodates claw-compactor and llm-min.txt-style workflows with local compaction, stable references, and lower-token context shaping rather than hidden remote summarization.
RTK handles upstream/input command output before it enters the context window. SQZ handles downstream/context reuse after content is already in the session, using prodex-sqz when the MCP server is available.
Managed optimizer checkouts are discovered from PRODEX_OPTIMIZERS_HOME, $XDG_DATA_HOME/prodex-optimizers, then ~/.local/share/prodex-optimizers.
prodex claude -- -p "summarize this repo"
prodex claude mem -- -p "recall past work on this repo"
prodex claude caveman
prodex claude caveman mem
prodex claude caveman -- -p "summarize this repo briefly"
prodex claude caveman mem -- -p "summarize this repo briefly"
prodex claude --profile second caveman -- -p "review the latest diff briefly"
prodex claude --profile second -- -p --output-format json "show the latest diff"prodex claude uses the normal Claude Code flow while keeping state under Prodex-managed configuration.
prodex claude caveman enables Caveman for that session while keeping state under the Prodex-managed CLAUDE_CONFIG_DIR, not the global ~/.claude.
prodex claude caveman mem combines Caveman and Claude-Mem.
prodex claude is only supported with the default OpenAI/Codex provider.
Profiles
prodex profile list
prodex profile add second
prodex profile import-current main
prodex login --profile second
prodex use --profile main
prodex logout --profile mainprodex profile import copilot
prodex profile export
prodex profile remove second
prodex profile remove --allLocal model support
Prodex can launch Super mode against a local OpenAI-compatible server:
prodex super --url http://127.0.0.1:8131You can use this with a local server such as llama-server.
By default, Prodex:
- injects a temporary
prodex-localCodex provider - appends
/v1when the URL has no path - disables non-function native tools that local servers commonly reject
- advertises a conservative 16k local context window
- skips quota/proxy routing for that launch
The default local model id is:
unsloth/qwen3.5-35b-a3bOverride it with --model:
prodex super --url http://127.0.0.1:8131 --model local/qwenUse --context-window and --auto-compact-token-limit if your local server is configured with a larger context window.
See LOCAL.md for self-hosted model setup and testing.
Utilities and diagnostics
prodex info
prodex doctor --runtime
prodex doctor --bundle ./prodex-doctor.json --redacted
prodex context audit
prodex context compress ~/.codex/AGENTS.md --dry-run
git diff | prodex context compact-output --kind git-diff| Command | Description |
|---|---|
| prodex info | Shows effective runtime tuning values after environment, policy, and default resolution. |
| prodex doctor --runtime | Runs runtime diagnostics. |
| prodex doctor --bundle PATH --redacted | Writes a shareable JSON diagnostic bundle without stored auth tokens or headers. |
| prodex context audit | Reports approximate token weight for shared instruction and memory files. |
| prodex context compress | Compresses Markdown/text context files and writes an .original.md backup. |
| prodex context compact-output | Compacts copied command output such as git status, git diff, rg, grep, find, tree, or long logs. |
For full policy keys, environment overrides, and runtime log path resolution, see docs/runtime-policy.md.
Advanced behavior
Managed Prodex profiles keep account credentials isolated per profile, but Codex-owned shared state uses the native Codex home by default.
On Unix-like systems, this is usually:
~/.codexIn practice, profile history.jsonl, sessions, config.toml, environments.toml, plugins, skills, and related shared files link to the same Codex home that direct Codex uses.
This matches direct Codex behavior: logging out or switching accounts does not hide chat history.
Older Prodex state from $PRODEX_HOME/.codex is merged into the native Codex home on the next managed-profile launch.
Set PRODEX_SHARED_CODEX_HOME only when you intentionally want a different shared Codex root.
Auto-rotate and quota checks apply to supported OpenAI/Codex profiles.
If a profile's config.toml sets model_provider to a non-OpenAI backend such as amazon-bedrock, prodex run and prodex caveman launch Codex directly without quota preflight or the local auto-rotate proxy.
Bedrock quota, credentials, regions, and provider errors are handled by Codex and the upstream provider, not by Prodex.
prodex quota is not available for those profiles.
Prodex respects system and environment proxy settings for upstream OpenAI quota, auth, and runtime HTTP by default, including:
HTTP_PROXY
HTTPS_PROXY
NO_PROXYRuntime WebSocket upstream connections also honor HTTPS_PROXY and https_proxy via HTTP CONNECT and respect NO_PROXY and no_proxy.
The local Codex-to-Prodex broker connection always receives NO_PROXY entries for:
127.0.0.1
localhost
::1This prevents a user proxy from intercepting the local runtime proxy.
Use --no-proxy on prodex run, prodex caveman, prodex super, or prodex claude only when you explicitly want Prodex upstream requests to bypass proxy settings.
This repository is a Cargo workspace.
The binary crate stays at the root, while reusable leaf crates live under crates/ to reduce rebuild scope when those components change.
Contributor testing guidance lives in docs/testing.md, including the fast/serial split and runtime parallel-safety assumptions.
Documentation
- QUICKSTART.md — longer walkthrough
- LOCAL.md — self-hosted local model setup and testing
- docs/runtime-policy.md — runtime policy keys, environment overrides, and runtime log path resolution
- docs/testing.md — contributor testing guidance
Support
If you find prodex useful and want to support its development, you can donate here:
