# Make ChatGPT and Claude work for each other

**What it does:** lets one AI hand work to the other and then check it. Claude writes a brief,
runs ChatGPT's Codex CLI against it on the same machine, reads what came back, and gives you one
verdict: agree, disagree, or merged. You get a second opinion from a different model without
retyping anything, and you get it on a plan you already pay for.

**What it saved:** if you pay for both ChatGPT and Claude, one of them is almost certainly sitting
idle. Chores that do not need judgment (utility scripts, parsers, test scaffolding, bulk
drafting, research summaries) move to the idle one, which stretches both plans a long way. It
also catches the thing a single model is worst at: being wrong confidently and alone.

**Shown at:** AI Open House, by Colton Mulligan.

## What you need

| Tool | Cost |
|------|------|
| Claude Code | your existing Claude plan |
| The Codex CLI, signed in with your ChatGPT plan | your existing ChatGPT plan |
| The script in this folder (`pass-to-chat.sh`) | $0 |
| A folder to archive every run | $0 |

Sign Codex in with your **subscription**, not an API key. The CLI supports both, and an API key
bills you per token for work your monthly plan already covers.

## How it works

1. You (or Claude, unprompted) decide a job is a chore rather than judgment.
2. Then Claude writes one self-contained brief as a Markdown file. The brief is all the other
   model sees, so it has to stand alone: the goal, the constraints, and what "done" looks like.
3. Then the script runs the Codex CLI non-interactively in a scratch directory, with a watchdog
   so a hung run dies instead of hanging all night.
4. Then every artifact lands in a dated archive folder: the brief, the full run log, the output,
   and one row in a ledger file. Nothing you asked or got back lives only inside a vendor's web
   interface.
5. Then Claude reads the result, verifies it independently rather than trusting the worker's own
   notes, and tells you one line: agree, disagree, or merged.

## The gotcha that costs everyone an hour

`codex exec` inherits standard input, and with no terminal attached it **hangs forever**: no
output, no error, almost no CPU. Every unattended invocation has to redirect stdin:

```bash
codex exec --skip-git-repo-check --sandbox workspace-write "$PROMPT" </dev/null > run.log 2>&1
```

That `</dev/null` is the whole fix. Without it you will watch a process sit at 0.07 seconds of
CPU time for seven minutes and assume the tool is broken.

## What never gets handed off

Worth writing down before you turn this on, because the temptation is to route everything:

- Anything in your voice. Outbound email, messages, client-facing copy.
- Your standing instructions, your memory files, your rules. One agent editing the other agent's
  brain goes wrong in ways that are hard to unwind.
- Money, credentials, deploys, deletions.
- Any repo or file the other agent currently has open. Two agents editing one file is a merge
  conflict with extra steps.

Everything else is fair game, and should be routed without being asked.

## Two things to expect

- **A throttle is a wait, not a bug.** Consumer plans rate-limit. The script detects it and says
  so loudly, instead of reporting a generic failure. Re-run it later or do that one on Claude.
- **Writing style leaks.** If you have house rules about writing (we ban the em dash), put them
  in the prompt the wrapper sends, and sweep the output anyway. The second model does not know
  your rules.

## The prompt

```text
I pay for both Claude and ChatGPT. I want you (Claude) to be able to hand a chore to ChatGPT's
Codex CLI on this machine, then review what comes back.

Write me a bash script, pass-to-chat.sh, that takes a brief file, a slug, and a timeout in
minutes, and then:
- refuses to run unless Codex is signed in with a subscription login
- copies the brief into a scratch work directory named for the slug
- runs `codex exec` non-interactively in that directory with stdin redirected from /dev/null
  (it hangs forever otherwise) and the output captured to a log
- kills the run and says so if it passes the timeout
- detects a rate-limit or throttle message and reports that distinctly from a real failure
- archives the brief, the log and every output file into a dated archive folder
- appends one row to a LEDGER.md: date, slug, wall time, status
- prints a short summary at the end

Then add this to your own standing instructions: route runbook-reduced coding chores, bulk
drafting where voice does not matter, research summarizing, and second opinions on your own
diagnoses to this worker by default. Never route my memory files, my rules, outbound email,
money, credentials, deploys, deletions, or any file you currently have open. Always verify the
result yourself before showing it to me, and state one verdict line: agree, disagree, or merged.
```

## Stack card

```text
WHAT IT DOES:     Claude briefs ChatGPT's Codex CLI, archives the run, then reviews the result
AI / MODEL:       Claude Code plus the Codex CLI on a ChatGPT subscription login
STACK:            One bash wrapper, a scratch work dir, a dated archive, a Markdown ledger
WHERE IT LIVES:   this recipe plus pass-to-chat.sh in this folder
COST TO RUN:      $0 beyond the two plans you already pay for
TIME SAVED:       A second model's worth of capacity, and one caught mistake per week
TIER SHARED:      working wrapper plus the routing rules
```

Built by Colton: https://builtbycolton.com

From the AI Open House free library: https://aiopenhouse.co/guests/#library
