ego-chat 0.2.40

Portable launcher for durable Codex, ZCode, Claude Code, and ChatGPT review loops through Ego Browser
# Ego Chat

Ego Chat lets your coding agent talk to ChatGPT for you.

You work in Codex, ZCode or Claude Code. Now and then you want a second opinion from ChatGPT's
strongest model: on a plan, a design, or a code change. Without Ego Chat you copy the question into
ChatGPT, wait, and copy the answer back. With Ego Chat your agent does it. Ego Chat types the
question into your ChatGPT chat in the Ego Lite browser, waits for the whole answer, even when
ChatGPT thinks for an hour, and hands the answer back to your agent.

```text
you ──> your coding agent ──> Ego Chat (runs in the background on your Mac)
                                  └──> Ego Lite browser ──> your ChatGPT chat
ChatGPT's answer comes back the same way, into the same task.
```

## What it can do

- **Ask ChatGPT and bring the answer back.** One question, one answer, straight into the task
  your agent is working on. No switching windows, no copy and paste.
- **Keep using the same chat.** Ego Chat remembers your ChatGPT chat, so later questions go to the
  same chat and ChatGPT keeps the whole history.
- **Pick up a chat you started yourself.** Give your agent the link of a ChatGPT chat
  (`https://chatgpt.com/c/...`) and it carries on from ChatGPT's latest answer.
- **Review until it's done.** Your agent makes a change, ChatGPT reviews it, your agent fixes what
  ChatGPT found, and they repeat until ChatGPT has nothing left to block. With Codex this loop can
  run on its own in the background, overnight too.
- **Always use the best model.** Before every message Ego Chat picks ChatGPT's strongest model and
  its highest thinking effort, and checks them again right before it presses Send. If ChatGPT
  quietly switches to a weaker model or a lower thinking level, you get a warning. An optional
  "Pro only" setting goes further: it sends only with GPT-6 Pro, or GPT-5.6 Sol Pro once GPT-6 Pro
  is used up, and otherwise stops without sending ([TECH.md]TECH.md#pro-only-opt-in). Ego Chat
  also warns once when its own Pro use nears your plan's limits, and under Pro only it tells you
  when ChatGPT says GPT-6 Pro comes back.
- **No accidental double sends.** If something breaks halfway, Ego Chat looks at the chat to see
  what really happened before it does anything else. When it can't tell, it stops and asks you
  rather than send again.
- **Give up cleanly.** If the ChatGPT page stays broken, Ego Chat keeps trying for up to 90
  minutes, then stops and tells you that nothing was sent.
- **Keep going through restarts.** Ego Chat runs in the background on your Mac. If your agent's
  app closes, Ego Chat keeps waiting for the answer. If Ego Chat itself restarts, it picks up
  where it stopped.
- **Handle chats that get too long.** A ChatGPT chat can only hold so much. When a chat is full,
  Ego Chat notices before it sends anything. A review loop then moves to a fresh chat in the same
  project by itself and carries a short summary across. Review loops also move to a new chat
  early, once a chat reaches 120 messages, except in your main chat (`ego-chat-main`), which
  stays one chat until it is actually full. A single question stops and tells you, so you can
  start a new chat.
- **Tell you when it needs you.** It stops and sends a Mac notification when only a person can
  help: you are signed out of ChatGPT, ChatGPT shows a "prove you're human" check, or you have
  reached your usage limit.
- **Work with several apps at once.** Codex, ZCode and Claude Code share one Ego Chat. Their
  questions take turns in the browser, so they never type over each other.

## Real-life examples

**A second opinion on a plan.** You are in Claude Code and type: *"Use Ego Chat to ask ChatGPT
whether this database migration plan is safe."* Claude sends the plan to ChatGPT, waits, and
shows you ChatGPT's answer in the same conversation. You never open the browser.

**A pull request reviewed overnight.** Before bed you tell Codex: *"Review PR #42 with ChatGPT
until it's settled."* Codex fixes what ChatGPT flags and sends the new version back, again and
again. In the morning you read the final review. If the chat got too long during the night, the
loop carried on in a new chat by itself.

**A chat you started on your phone.** You brainstormed a feature with ChatGPT on your phone. At
your desk you paste the chat link into ZCode: *"Continue this ChatGPT chat with Ego Chat:
https://chatgpt.com/c/..."* ZCode reads ChatGPT's latest answer and starts building.

**A long think without the waiting cost.** ChatGPT's top model can think for half an hour or
more. Your agent makes one call and stays quiet until the answer is ready, instead of spending
tokens asking "is it done yet?".

**A daily scheduled job.** Every morning a scheduled task asks ChatGPT to check a report in the
same chat and saves the answer. If a run breaks, Ego Chat finishes it, or checks the chat to see
whether the message went out before anything is tried again.

## What it does not do

- It only carries text: your questions and ChatGPT's answers. It does not upload files, push
  code, merge, or deploy. Your agent does those, and only with your permission.
- It does not run inside the ChatGPT desktop or phone app. It works through the Ego Lite browser;
  you bring an app chat in by pasting its link.
- It cannot wake an agent task that has already finished. The answer is kept, and your agent can
  collect it later.
- It is not a new chat app. You still read long discussions in ChatGPT itself.

## What you need

- A Mac with [Ego Lite]https://github.com/citrolabs/ego-lite, signed in to your ChatGPT account.
- Node.js 24 or newer, and Rust 1.88 or newer to install Ego Chat.
- At least one of Codex, ZCode, or Claude Code (2.1.203 or newer).

## Install

```sh
cargo install ego-chat --locked
ego-chat setup          # for Codex
ego-chat setup-zcode    # for ZCode
ego-chat setup-claude   # for Claude Code
```

Run only the setup lines for the apps you use, then restart those apps. To check that everything
is in place, run `ego-chat doctor` (or `doctor-zcode`, `doctor-claude`).

## How to use it

Ask your agent in plain words. The Ego Chat skill that setup installs picks the right tool.

> Use Ego Chat to ask ChatGPT to review this change.

> Use Ego Chat to review this with ChatGPT until the acceptance criteria are settled.

> Use Ego Chat to continue this ChatGPT chat: https://chatgpt.com/c/...

While a question is in progress, leave that ChatGPT chat alone in Ego Lite. You can still use
other Spaces in Ego Lite.

## Your data

- Ego Chat keeps its state in a private folder on your Mac:
  `~/Library/Application Support/Ego Chat`.
- Your questions go only to ChatGPT. In review loops, Ego Chat removes things that look like
  passwords or API keys before it sends. A single question is sent as your agent wrote it, so
  keep secrets out of it.
- One optional feature, **judgments**, asks a small outside AI model (TypeSafe's Jev) to spot a
  review loop that is going round in circles. It is off unless you turn it on. When on, it sends
  short ChatGPT status messages, the loop's goals, and ChatGPT's review text to TypeSafe. See
  [TECH.md]TECH.md#judgments-opt-in-advisory.

## Good to know

- Ego Chat is young. Overnight loops work, but it can still stop and ask for help now and then.
  It stops rather than guess.
- No one has hit ChatGPT's "this chat is full" limit with Ego Chat yet. Ego Chat recognizes it
  from ChatGPT's own code, not from a live test, so the first real one may need a fix.
- ChatGPT changes its website often. `ego-chat ui-check ego-chat-main` checks that the words Ego
  Chat looks for on the page are still there.
- For overnight runs there is an optional watchdog, [Ego Monitor]docs/ego-monitor.md. It
  watches one job and notifies you if the job gets stuck.

## More detail

The full technical reference covers how it works, every safety rule, recovery, limits, and
testing: [TECH.md](TECH.md). The review-loop contract is in
[CONTINUITY.md](https://github.com/xicv/ego-chat/blob/main/CONTINUITY.md).

Ego Chat is released under the [MIT license](LICENSE).