# Claude Code, Codex, and acpx: setup and usage rules

## When to use acpx vs the CLIs directly

The default is neither one. Your main assistant (Grok Bot) and Cursor cloud agents do the everyday work. Claude Code and Codex come in only when someone asks for them, or for these cases:

- **Second opinion or review.** One agent reviews a diff or plan another one wrote. acpx is the right path here because it's headless and the output is structured.
- **Head-to-head.** The same task goes to both agents and you compare results. acpx can drive both with the same flags.
- **Asked by name.** "Have Claude do X" or "ask Codex." Use acpx, scoped to one repo folder.
- **Use the CLIs directly** for one-off administration, like logins, `claude update`, `codex login`, and checking versions, or when a human wants to take over an interactive session. acpx adds nothing there.
- **Never** route routine chat, research, or browsing through them. Don't use them to get around a block on another tool, and don't let them push, merge, or deploy unless asked. Give them write access only inside a scratch checkout.

## Copy-paste setup prompt

```
Set up Claude Code, Codex CLI, and acpx on your computer, and add rules for when to use them.

Install
- Install everything under ~/.local so it survives computer updates. Don't use sudo or put anything in /usr.
- Claude Code: use the native installer (curl -fsSL https://claude.ai/install.sh | bash). Make sure ~/.local/bin is on PATH.
- acpx needs Node 22.13 or newer. If the system node is older, download a portable Node 22 .tar.gz to ~/.local/node22 and put its bin folder on PATH in ~/.bashrc and ~/.profile.
- Codex: npm i -g @openai/codex --prefix ~/.local (use Node 22's npm).
- acpx: npm i -g acpx --prefix ~/.local. Then replace the ~/.local/bin/acpx symlink with a small sh wrapper that runs Node 22's node on acpx's dist/cli.js. Delete the symlink first so you don't overwrite cli.js.
- gh: if it's missing, install the standalone binary to ~/.local/bin.

Logins (interactive, I'll do these)
- Stop and tell me when each login is ready for me to take over on your desktop: claude (claude.ai account), codex (ChatGPT sign-in), and gh auth login if gh isn't already authenticated.
- Afterward, verify with claude auth status, codex login status, and gh auth status.

Validate
- In a temp folder, run: acpx --cwd <tmp> --approve-reads --non-interactive-permissions deny claude exec "Reply with exactly: OK". Then run the same command with codex. Both should return OK and exit 0.

Keep updated
- Write ~/.local/bin/update-ai-clis to update all three (and rewrite the acpx wrapper afterward). Create a daily routine that runs it, reinstalls anything missing, never touches logins, and only messages me if something breaks or a version changes.

Usage rules (save to memory)
- Don't use Claude Code, Codex, or acpx by default. My normal assistant and Cursor agents handle everyday work.
- Use them on request, or for second-opinion reviews, head-to-head comparisons, or when I ask for one by name.
- Prefer acpx for any automated or headless run. Use the CLIs directly only for logins, updates, and interactive sessions I take over.
- Keep each run scoped to one repo or scratch folder. Allow reads only unless I approve writes. Never push, merge, deploy, or send anything through them.
- Show me what they produced and say which agent produced it.
```
