codex-with-chatgpt
Skill2 starsChanged 2 months agoMITView on GitHub
Use ChatGPT (web) as the planning and review brain for Codex coding sessions, while Codex keeps full execution ownership. Use when the user says "使用 Codex with ChatGPT ..." / "Set up Codex with ChatGPT" / "用 ChatGPT 规划", when they ask to connect ChatGPT to the current workspace, disconnect it, or run a task through the ChatGPT planning loop.
- Reads credentials
- Installs packages
3 other projects use a version of this, 3 of them edited.
Adopted by
Most recently taken up by
- zhouycheng/skillsedited, first seen Oct 13, 2026
- G0K0U/agents-with-chatgptedited, first seen Oct 6, 2026
- XiaoDuoYa/codex-with-chatgptedited, first seen Oct 1, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 3
- XiaoDuoYa/codex-with-chatgpt★ 7k96% same
- G0K0U/agents-with-chatgpt★ 488% same
- zhouycheng/skills★ 186% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- c2c-routerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
87 rules. 18 are common, 20 are distinctive, and 49 are very specific to this project.
18
Common
Most of the 3 edited versions we read keep these.
20
Distinctive
This author's own choices. Worth a look.
49
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 23
NEVER paste file contents, diffs, or logs into ChatGPT.
- Common: line 24
NEVER show the user technical internals (MCP, OAuth, PKCE, tunnel, ports, localhost).
- Common: line 29
Never touch OAuth tokens, cookies, or session storage.
- Very specific: line 30
If something fails, run c2c doctor and repair silently.
- Very specific: line 33
Before the first ChatGPT connection on this machine, c2c prefs --json:
- Common: line 36
Do not start ChatGPT configuration until they answer.
- Common: line 50
ALWAYS use the built-in in-app browser (iab) for every ChatGPT step.
- Very specific: line 51
Follow In-app browser (ChatGPT) below.
- Common: line 57
If the user asks to run ChatGPT in their own browser, refuse politely and explain: "Codex 需要持续调用 ChatGPT 和配置连接,这会频繁操作页面,可能影响 …
- Very specific: line 75
After first-time setup, never ask the user to approve writing C2C's local settings directory.
- Very specific: line 81
Doctor gate: After c2c doctor --json, do not goto ChatGPT and do not send [C2C] until local is green — except the reconnect settings pages …
- Common: line 90
Do not Delete the ChatGPT connector — the address did not change)
- Very specific: line 92
Do not c2c start, do not Delete the connector, do not treat it as chatgptRepair.
- Very specific: line 94
If doctor is already green and chatgptRepair.needed is false, do not c2c restart, do not start a second tunnel, and do not Delete the …
- Very specific: line 111
One tab: Create the ChatGPT tab once (tabs.new()).
- Common: line 121
Never close this tab. Finished, waiting for the user, or timed out: leave it marked (standby).
- Common: line 134
Never click Reconnect / Refresh on an existing connector.
- Common: line 145
After an action, one cheap DOM check.
- Very specific: line 186
All commands support --json for parsing.
- Very specific: line 187
If the checkout has no node_modules or no dist/, first run corepack pnpm install && corepack pnpm build inside it.
- Very specific: line 193
Do not add -w to machine-wide commands: update-check, sandbox-allow, prefs, tunnel login.
- Very specific: line 196
Never run c2c route setup yourself.
- Distinctive: line 202
Never run them for work that stays with Codex alone.
- Common: line 210
If already allowlisted, this is a no-op and does not trigger elevation.
- Very specific: line 237
Ask this before the public address exists (c2c setup / first doctor --fix that starts a tunnel).
- Very specific: line 242
If needsChoice is false: do not ask again.
- Very specific: line 243
If needsChoice is true: tell the user exactly userPrompt and wait.
- Very specific: line 250
If they said they have an account but gave no domain: ask once for the domain.
- Very specific: line 252
If fallback is true: tell them userMessage and continue on the temporary address.
- Common: line 254
Never put connection credentials in the project.
- Very specific: line 260
If cloudflared is missing on macOS run brew install cloudflared.
- Very specific: line 262
If the c2c repo has no node_modules, run pnpm install && pnpm build in it.
- Very specific: line 263
Run c2c sandbox-allow --json, then Connection choice, then c2c setup -w <workspace> --json.
- Very specific: line 275
If setupMode is null: tell the user exactly setupChoicePrompt.
- Common: line 277
Do not open ChatGPT settings and do not start automatic configuration until they answer.
- Very specific: line 279
If they later ask to switch: same c2c prefs set --setup-mode command.
- Common: line 280
Do not re-ask on a later workspace or on reconnect.
- Very specific: line 291
Never record it as off. If creating the connector later says developer mode is required, open this page, enable it, save --developer-mode, …
- Common: line 298
If that exact name exists: Delete it, then create it again.
- Common: line 300
If it does not exist: create one with that exact name.
- Common: line 301
Never rename, delete, or edit a connector that belongs to another workspace.
- Very specific: line 306
Only then run c2c pair --json and type that code.
- Very specific: line 316
Only then save the chat URL with c2c session set (see Conversation management).
- Common: line 332
If a login wall appears (ChatGPT, Cloudflare): stop, tell the user the ONE thing to do ("请登录 ChatGPT,完成后告诉我'好了'"), then continue.
- Very specific: line 344
Stop automating ChatGPT settings.
- Very specific: line 347
Do not change the saved setupMode when this is a failure fallback.
- Very specific: line 357
If developerModeEnabled is not true: ask them to open https://chatgpt.com/#settings/Security and enable 开发人员模式.
- Very specific: line 361
Ask them to open https://chatgpt.com/plugins.
- Very specific: line 363
Ask them to open https://chatgpt.com/plugins#settings/Connectors?create-connector=true&redirectAfter=%2Fplugins and create the exact …
- Very specific: line 369
Ask them to Connect / Authorize.
- Distinctive: line 371
When they report Connected / authorized / pairing accepted, resume the normal setup/reconnect flow at its ChatGPT verification step.
- Distinctive: line 384
Never match a Project or a chat by display name.
- Very specific: line 391
Find it: if conversation.reuseSavedChat and conversation.chatUrl, goto that URL (foreground + markHandoff) and continue there.
- Very specific: line 393
Save it: after boot + workspace_info, and the reply names this workspace, c2c session set -w <ws> --mode long-chat --url <url> --title "C2C …
- Distinctive: line 395
If the name does not match, do not overwrite a previously saved URL.
- Very specific: line 396
Update it: after each EXECUTED/DONE, c2c session set -w <ws> --task <id> --iteration <n> --state <STATE> plus checkpoint flags from the …
- Distinctive: line 401
Switch it: ONLY when (a) the user asks for a new chat, (b) the current chat visibly lags, or (c) this conversation is Work.
- Very specific: line 427
If you already saved a ChatGPT chat URL earlier in THIS Codex conversation: goto that URL.
- Distinctive: line 435
If this Codex thread is continuing a previous C2C task, send HANDOFF right after the boot prompt.
- Distinctive: line 441
Wrong collection: do not guess another Project.
- Distinctive: line 445
If the collection 404s or the new chat is not inside the Project, same choice.
- Distinctive: line 453
Do this for a new workspace, or when an existing user asks to switch to Project.
- Very specific: line 467
Wait for「好了」/ the collection page.
- Distinctive: line 473
Do not click 分享. Do not add 来源 / files.
- Distinctive: line 477
Never write the public / temporary address into 指令.
- Very specific: line 521
Do not invent STATE: RESUME.
- Very specific: line 522
All control messages start with [C2C].
- Very specific: line 544
If the task was started by the router (--routed-by router) and doctor reports chatgptRepair.needed or namedRepair.needed, ask once: …
- Distinctive: line 581
Do not execute, send, or INIT until the user answers.
- Very specific: line 585
After it is visible: c2c session set -w <ws> --protocol-state EXECUTED_SENT --waiting-for GPT_REVIEW --next-step "wait for PLAN or DONE", …
- Distinctive: line 601
Never re-pair, never recreate the connector, and never rewrite Project instructions just to resume.
- Very specific: line 604
If c2c route returned a controlMessage for this task (MODE: REVIEW or MODE: DEBUG), send that text exactly instead of the INIT below, then …
- Very specific: line 628
Wait for ChatGPT's STATE: PLAN reply (In-app browser §8 — short DOM checks, same tab.
- Very specific: line 630
Read GOAL/ACTIONS/TESTS/SUCCESS_CRITERIA.
- Distinctive: line 653
If this iteration ran a test / build / lint / typecheck command, also pass that command's output.
- Very specific: line 659
If the CLI says the output was not released, still send EXECUTED.
- Very specific: line 714
Never request elevated permissions for c2c route.
- Distinctive: line 716
Never paste route JSON to the user.
- Distinctive: line 732
If the user pastes an API key into chat: do not repeat it, do not use it, and tell them to run setup in their terminal and rotate that key.
- Distinctive: line 767
If that exact name exists on the plugins hub: Delete it.
- Distinctive: line 779
If the name is already gone, skip Delete and only create.
- Distinctive: line 787
If the reply names this workspace: continue there.
- Distinctive: line 788
If workspace_info fails, times out, or cannot read the name: do not keep retrying that old URL.
- Very specific: line 794
If the ChatGPT conversation was lost: same as the failure path in step 4.
- Very specific: line 795
No file re-uploading (the workspace lives in MCP).
- Very specific: line 803
If namedRepair.needed, tell the user namedRepair.userMessage, run c2c tunnel login --json, then doctor again.
- Very specific: line 805
If chatgptRepair.needed, follow reconnect after address reclaim, then doctor again.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Codex with ChatGPT
ChatGPT thinks. Codex works.
You (Codex) own execution: editing, shell, git, tests, recovery. ChatGPT owns high-level reasoning: understanding, planning, review, debug strategy. The C2C Bridge gives ChatGPT read-only MCP access to the current workspace, so control messages between you and ChatGPT stay tiny (< 1 KB) — ChatGPT pulls whatever data it needs by itself.
Golden rules
- NEVER paste file contents, diffs, or logs into ChatGPT. ChatGPT reads them through MCP.
- NEVER show the user technical internals (MCP, OAuth, PKCE, tunnel, ports, localhost). Speak in terms of "连接 ChatGPT / 安全连接 / 配对". The only exception is the guided manual ChatGPT setup below: expose only the exact settings field labels/values the user must enter, without explaining internals.
- The pairing code is the ONLY credential you may ever type into a browser. Never touch OAuth tokens, cookies, or session storage.
- If something fails, run
c2c doctorand repair silently. Only involve the user for logins, CAPTCHA, 2FA, explicit consent screens, or guided manual ChatGPT setup below — and then give them ONE action. Before the first ChatGPT connection on this machine,c2c prefs --json:setupModemissing: tell the user exactlysetupChoicePrompt, wait for 「1」or「2」, thenc2c prefs set --setup-mode auto|manual --json. Do not start ChatGPT configuration until they answer. Do not guess.setupModeismanual: skip automatic ChatGPT settings. Use guided manual from the start (chosen, not a failure).setupModeisauto: automatic browser setup. Two explicit failures of the same configuration step after repair then enter guided manual. A browser/js timeout, a page still loading/generating, or waiting for user login/2FA does NOT count as a failure. Do not change the savedsetupModewhen falling back.developerModeEnabled: truemeans skip#settings/Securityuntil a connector create fails because developer mode is required. Then open that page, enable it, andc2c prefs set --developer-mode --json. These prefs are for this machine, not per workspace. Do not ask again on reconnect or a second repo. A new computer (empty prefs) asks/checks once.
- ALWAYS use the built-in in-app browser (iab) for every ChatGPT step.
Follow In-app browser (ChatGPT) below. NEVER Computer Use (no
screenshot-click). NEVER launch or control a third-party/external browser
(Chrome, Safari, Edge…), and never use
open <url>to hand off to one.- The ONLY exception: the user explicitly says the Cloudflare login must use their own browser session — that single Cloudflare login step may go through their browser; everything else stays in the built-in browser.
- If the user asks to run ChatGPT in their own browser, refuse politely and explain: "Codex 需要持续调用 ChatGPT 和配置连接,这会频繁操作页面,可能影响 你浏览器的正常使用。ChatGPT 只能跑在内置浏览器里。" Only if the user replies with an explicit "我愿意承担影响" may you proceed in their browser; otherwise keep ChatGPT in the built-in browser, every time they ask.
- Conversation reuse depends on
c2c session --json→conversation.mode(see Conversation management). Do not invent a second mode.- long-chat (legacy session file, or the user opted out): ONE ChatGPT conversation per workspace. Never silently start a new chat.
- project (new workspaces, or an existing workspace that opted in):
ONE ChatGPT Project (collection) per workspace. Same Codex conversation
reuses the ChatGPT chat URL saved in THIS thread. A new Codex
conversation opens a new chat from the Project collection page — never
gotohttps://chatgpt.com/to create it, and never reuse another Codex conversation's chat URL just becausesession.urlexists. Each workspace also has exactly ONE ChatGPT connector. Do not create a second connector for the same workspace. Other workspaces may have their own connectors — never edit those.
- After first-time setup, never ask the user to approve writing C2C's local
settings directory. Run
c2c sandbox-allow --json(idempotent). If it fails with EPERM / Operation not permitted, request elevated permissions and retry ONCE. After{ "alreadyAllowed": true }or{ "added": true }, stay silent. - ChatGPT pages: only the URLs in In-app browser (ChatGPT). Never start from chatgpt.com and click through menus.
- Doctor gate. After
c2c doctor --json, do notgotoChatGPT and do not send[C2C]until local is green — except the reconnect settings pages whenchatgptRepair.neededis true. Not green:report.bridge.okis not truereport.mcp.okis not true (unauthenticated local/mcpmust be 401)- sandbox / state-dir write failed (EPERM)
- this workspace used to have a public URL and the tunnel is down
chatgptRepair.neededis true (fix the connector first, then doctor again)namedRepair.neededis true (user must log in to Cloudflare, then doctor again. Do not Delete the ChatGPT connector — the address did not change)report.bridgesays 状态无法确认: the local bridge may still be running. Do notc2c start, do not Delete the connector, do not treat it aschatgptRepair. Wait and run doctor again. If doctor is already green andchatgptRepair.neededis false, do notc2c restart, do not start a second tunnel, and do not Delete the connector. ChatGPT/IAB-only errors are not permission to churn the public address. A ChatGPT-side 401 after a sent message is different: repair then, do not treat it as permission to skip this gate next time.
In-app browser (ChatGPT)
Official skill: control-in-app-browser. These C2C rules override defaults
that close the tab, hide the window, or stall on the settings page.
- Surface. Once per Codex session:
setupBrowserRuntime(), thenconst iab = await agent.browsers.get("iab"). Reuseiab. Do not re-readdocumentation()if it is already bound. NevergetDefault(),getForUrl(), or Computer Use. - One tab. Create the ChatGPT tab once (
tabs.new()). After that, onlytab.goto(...)to switch URLs. If the tab still exists, claim it — never open a second ChatGPT tab. Do notgotothe URL you are already on. - Foreground + keep (standby). Right after opening or claiming the tab:
await (await iab.capabilities.get("visibility")).set(true)— first-time setup and ChatGPT chatting stay in front of the user so they can watch.await tab.markHandoff()immediately, then again at the start and end of every turn. After setup succeeds or the C2C chat is open, alsoawait tab.markDeliverable(). Never close this tab. Finished, waiting for the user, or timed out: leave it marked (standby). Do not let default turn cleanup close it.
- URLs only (same tab,
goto— never hunt menus):- 开发人员模式:
https://chatgpt.com/#settings/Security(skip whenc2c prefs --jsonhasdeveloperModeEnabled: true) - 插件总管:
https://chatgpt.com/plugins - 加插件:
https://chatgpt.com/plugins#settings/Connectors?create-connector=true&redirectAfter=%2Fplugins - 新对话 (long-chat only, and only if no saved chat):
https://chatgpt.com/ - Saved C2C chat:
conversation.chatUrl/session.url(long-chat, or the chat already bound in THIS Codex conversation) - Saved Project collection:
conversation.projectUrl(https://chatgpt.com/g/g-p-…/project) Never click Reconnect / Refresh on an existing connector. The old address is dead and that page hangs on "This site cannot be reached". When the address changed: Delete THIS workspace'sconnectorNameonly, then create it again via the 加插件 URL (same name, new Server URL). Do not put that public address into Project instructions — write the connector name only.
- 开发人员模式:
- Do not wait for 8 tools on the settings page. "Connected" / authorize
success / pairing accepted is enough. Confirm tools in the conversation with
workspace_info. - Batch. Fill a known form in one Playwright /
jsscript when you can. After an action, one cheap DOM check. Do not screenshot-poll. One conversation, Chat mode. The first ChatGPT chat is the C2C conversation. Chat and Work (聊天 / 工作) are separate: a Work conversation cannot become Chat. On every NEW conversation, if a Chat/Work switcher is visible (often top-left), confirm Chat is selected before the boot prompt. If it is Work, do not continue there — Switch to a new Chat conversation (HANDOFF). If no switcher is visible, do not hunt menus; continue. Send the boot prompt and the workspace_info check in that Chat conversation. Confirm the reply names the current workspace before saving or replacing the session URL. If validation fails, keep the old saved URL. Do not open a throwaway verify chat and later another C2C chat.
A collection or chat page that shows only
Retry/重试is a navigation error, not generation and not a pairing failure. Reuse the same iab tab. Try Retry once. If it stays Retry-only,gotothe last working chat URL from this thread (orsession.urlif that is the only saved chat), then click the on-pageOpen … project/打开“… ”项目link — that same-site hop is allowed. Do not treat the URLs-only rule as forbidding this link. On the collection, require the project chat list and new-chat composer before continuing. Keep the old saved URL/checkpoint until the replacement chat passes workspace_info. Do notsession clear. Do not use Computer Use.- Wait for a ChatGPT reply (do not hold one long browser wait). After you
send INIT, EXECUTED, boot, or the workspace_info check:
markHandoff, keep the tab foreground, and stay in this same task. Do notwaitFor5 minutes and do not screenshot-poll. Every 20–30 seconds, one cheap DOM check:- still generating → wait again (do not type, do not resend);
STATE: PLAN/DONE/BLOCKED/ the verify workspace name → read it and continue the existing protocol;- visible error → repair; do not start a new chat. A browser/js timeout is not failure. Claim the same tab, read the page, keep standby. If ChatGPT is still thinking, keep polling. Never open a second tab and never resend INIT/EXECUTED just because a wait timed out.
Locations
- The codex-with-chatgpt checkout lives at:
<ACTUAL_CHECKOUT_PATH>(installer/update MUST replace this line in the installed Skill with the user's actual checkout path.) - CLI: let
<checkout>mean the path on the previous line; runnode "<checkout>/bin/c2c.js" <command>(orc2c <command>if globally linked). All commands support--jsonfor parsing. - If the checkout has no
node_modulesor nodist/, first runcorepack pnpm install && corepack pnpm buildinside it. - For commands that act on the user's project (
setup,doctor,session,restart,start,stop,status,pair,unpair,logs,workspace,record,route,tunnel status,tunnel choose), pass-w <workspace root>(the project the user is working on, NOT the c2c repo). - Do not add
-wto machine-wide commands:update-check,sandbox-allow,prefs,tunnel login. They still accept and ignore-w, so a leftover flag must not fail the command.c2c route prefsis machine-wide too. - Never run
c2c route setupyourself; the user runs it in their own terminal.
Daily update check
At the START of every workflow below (before anything else) — for a task started
by c2c route, only once it actually engages ChatGPT — run these two commands.
Never run them for work that stays with Codex alone. (Both are cheap / cached;
never mention them unless an update exists.)
c2c update-check --json(do not pass-w)c2c sandbox-allow --json(do not pass-w) — writes the C2C state directory into Codex's sandboxwritable_roots(macOS:~/Library/Application Support/codex-with-chatgpt; Windows:%LOCALAPPDATA%\codex-with-chatgpt; config file is~/.codex/config.tomlon both, or%USERPROFILE%\.codex\config.tomlon Windows). If already allowlisted, this is a no-op and does not trigger elevation.
{ "updateAvailable": false }→ continue silently. Never mention the check.{ "updateAvailable": true }→ tell the user one line: "检测到 Codex with ChatGPT 有新版本,我先更新一下(约 1 分钟),随后继续你的任务。" Then run the update workflow below, and CONTINUE the original task afterwards.
Workflow: update("更新 Codex with ChatGPT",or triggered by the daily check)
Inside the checkout directory (see Locations):
git pull --ff-only. If it fails (local edits, diverged branch, no tracking branch), skip the update silently and continue the task. Nevergit stash.corepack pnpm install && corepack pnpm build.- Re-install the Skill: copy
skill/SKILL.mdto~/.codex/skills/codex-with-chatgpt/SKILL.md, then fix the "checkout lives at:" line in the copy to the actual checkout path. Also, if~/.codex/skills/c2c-router/exists, copyrouter-skill/SKILL.mdthere and fix its checkout path line the same way. c2c sandbox-allow --json(so existing installs pick up the sandbox allowlist), thenc2c restart -w <workspace>so the bridge runs the new code, thenc2c update-check --force --jsonto refresh the cache (should now report up to date).- Tell the user "✓ 已更新到最新版本" — then resume whatever task triggered this. (The updated SKILL.md takes effect from the next Codex session; that's expected.)
Connection choice (once per workspace)
Ask this before the public address exists (c2c setup / first doctor --fix
that starts a tunnel). Do not mention tunnels, wrangler, DNS, or hostnames.
Speak only of 临时地址 / 固定域名 / 登录 Cloudflare.
c2c tunnel status -w <workspace> --json- If
needsChoiceis false: do not ask again. - If
needsChoiceis true: tell the user exactlyuserPromptand wait.- 没有账号 / 没有域名 / 临时 / 不用 →
c2c tunnel choose -w <ws> --mode quick --json - 有域名(例如 example.com)→ first tell them
loginPrompt, thenc2c tunnel choose -w <ws> --mode named --zone <domain> --json. This may open the user's own browser (the Cloudflare exception in Golden rule 5). Wait until the command finishes. If they said they have an account but gave no domain: ask once for the domain. If the command returnsneed: "zone", ask once and retry. Iffallbackis true: tell themuserMessageand continue on the temporary address. Do not retry named unless they ask.
- 没有账号 / 没有域名 / 临时 / 不用 →
- Never put connection credentials in the project. The CLI stores them in the C2C state directory.
Workflow: first-time setup("使用 Codex with ChatGPT 完成首次配置")
- Detect prerequisites yourself:
node --version(>= 20), and checkcloudflared.- If cloudflared is missing on macOS run
brew install cloudflared; on Windows usewinget install Cloudflare.cloudflared. Do this yourself; don't ask.
- If cloudflared is missing on macOS run
- If the c2c repo has no
node_modules, runpnpm install && pnpm buildin it. - Run
c2c sandbox-allow --json, then Connection choice, thenc2c setup -w <workspace> --json.sandbox-allowedits Codexconfig.tomlonly — it adds C2C's state directory to[sandbox_workspace_write].writable_rootsso later chats can write logs without elevation. If the write is denied, request approval and retry once. → returns{ mcpUrl, pairingCode, workspaceName, connectorName, ... }.connectorNameis this workspace's plugin title (legacy installs stayCodex with ChatGPT; additional workspaces getCodex with ChatGPT · <name>). Pairing codes expire in ~5 minutes. Do not mint one until the ChatGPT Authorize / pairing form is on screen: runc2c pair --jsonthen type that code immediately. Doctor does not pre-mint a code. c2c prefs --json(this machine, not this workspace).- If
setupModeis null: tell the user exactlysetupChoicePrompt. Wait for「1」or「2」. Thenc2c prefs set --setup-mode autoor--setup-mode manual. Do not open ChatGPT settings and do not start automatic configuration until they answer. Do not default to auto. - If they later ask to switch: same
c2c prefs set --setup-modecommand. Do not re-ask on a later workspace or on reconnect. setupMode: "manual": skip step 5's automatic ChatGPT settings. Go to Guided manual ChatGPT setup (chosen). Opening line:接下来用手动教学配置。一次只需要做一个操作。Do not say 自动配置没有成功.setupMode: "auto": continue with step 5. Keep the two-failure fallback.
- If
- Open ChatGPT on the ONE iab tab (see In-app browser). Foreground +
markHandoff immediately. Same tab,
gotoonly:- 开发人员模式: skip
https://chatgpt.com/#settings/SecuritywhendeveloperModeEnabledis true. Otherwise open it, enable 开发人员模式 ("Developer mode") if it is off, thenc2c prefs set --developer-mode. Never record it as off. If creating the connector later says developer mode is required, open this page, enable it, save--developer-mode, and retry create — do not skip that recovery. - 已有该
connectorName:https://chatgpt.com/plugins— Delete it (never Reconnect). Thengotothe 加插件 URL below. - 还没有 / 刚删掉:
https://chatgpt.com/plugins#settings/Connectors?create-connector=true&redirectAfter=%2FpluginsOperate ONLY onconnectorNamefrom step 3:- If that exact name exists: Delete it, then create it again. Never Reconnect, never edit-in-place, never open the old Server URL.
- If it does not exist: create one with that exact name.
- Never rename, delete, or edit a connector that belongs to another workspace.
- Description:
Securely connect ChatGPT to the current Codex workspace for planning and review. - Server URL: the
mcpUrlfrom step 3 - Authentication: OAuth
Fill the known form in one script when you can. Then Connect / Authorize.
Only then run
c2c pair --jsonand type that code. As soon as it shows Connected / authorized / pairing accepted, continue — do NOT wait for 8 tools on this page.
- 开发人员模式: skip
- Same tab: open the first C2C chat per Conversation management
(Project collection for a new workspace;
https://chatgpt.com/only in long-chat). Confirm Chat mode per In-app browser §7 (if it is Work, open a new Chat conversation instead). Send the boot prompt fromdocs/protocol.md§Boot Prompt, then (same chat) send:Use the "<connectorName>" connector: call workspace_info and read hello-style top-level file. Reply with the workspace name.Confirm the reply matchesworkspaceName(wait per In-app browser §8). Only then save the chat URL withc2c session set(see Conversation management). If the name does not match, do not save. markDeliverable. - Report to the user exactly in this shape (no internals):
Codex with ChatGPT
✓ 当前项目已识别
✓ Workspace Bridge 已启动
✓ 安全连接已建立
✓ ChatGPT 已连接
✓ 文件读取测试通过
Ready.If a login wall appears (ChatGPT, Cloudflare): stop, tell the user the ONE thing to do ("请登录 ChatGPT,完成后告诉我'好了'"), then continue.
Guided manual ChatGPT setup
Enter this path when setupMode is manual (chosen at the start), or when
automatic ChatGPT browser configuration fails twice at the same explicit
setup/reconnect step after c2c doctor / repair. Do NOT enter the failure
path for a browser/js timeout without a visible error, a page that is
still loading/generating, or while waiting for login / 2FA / CAPTCHA.
A chosen manual path does not wait for those two failures.
Stop automating ChatGPT settings. Keep the current local C2C state and the
current mcpUrl, pairingCode, workspaceName, and connectorName. Do not
silently fall back to Codex-only execution and do not permanently disable C2C.
Do not change the saved setupMode when this is a failure fallback.
Opening line:
- Chosen (
setupMode: "manual"):接下来用手动教学配置。一次只需要做一个操作。 - Failure fallback:
自动配置没有成功,我来带你手动完成。一次只需要做一个操作。
Then guide ONE action at a time, waiting for the user to say「好了」before the next action:
- If
developerModeEnabledis not true: ask them to openhttps://chatgpt.com/#settings/Securityand enable 开发人员模式. After they say「好了」,c2c prefs set --developer-mode. If it is already remembered, skip this step. - Ask them to open
https://chatgpt.com/plugins. If the exactconnectorNameexists, delete only that connector. Never ask them to touch another workspace's connector. - Ask them to open
https://chatgpt.com/plugins#settings/Connectors?create-connector=true&redirectAfter=%2Fpluginsand create the exactconnectorNamewith:- Description:
Securely connect ChatGPT to the current Codex workspace for planning and review. - Server URL: the current
mcpUrl - Authentication: OAuth
- Description:
- Ask them to Connect / Authorize. Then run
c2c pair --jsonand give them only that pairing code. If it expires before they finish, run pair again. - When they report Connected / authorized / pairing accepted, resume the normal setup/reconnect flow at its ChatGPT verification step. If automatic browser verification then hits the same explicit failure twice, stop and report the exact failed step; do not loop indefinitely and do not continue without C2C.
Conversation management
c2c session -w <ws> --json → { session, conversation }.
conversation.mode is the only switch. Missing / legacy files with a chat URL
and no Project stay long-chat. Do not ask those users to migrate. If they
later say they want a Project, run Bind Project. A brand-new workspace
(no session file) is project.
Never match a Project or a chat by display name. Never upload the repo to Project sources. Never click 分享 / Share. Do not rename ChatGPT chats.
long-chat (do not rewrite this path)
ONE ChatGPT conversation per workspace. Same as before.
- Find it: if
conversation.reuseSavedChatandconversation.chatUrl,gotothat URL (foreground + markHandoff) and continue there. - Save it: after boot + workspace_info, and the reply names this workspace,
c2c session set -w <ws> --mode long-chat --url <url> --title "C2C <workspace name>". If the name does not match, do not overwrite a previously saved URL. - Update it: after each EXECUTED/DONE,
c2c session set -w <ws> --task <id> --iteration <n> --state <STATE>plus checkpoint flags from the coding workflow (--protocol-state,--waiting-for,--goal,--next-step,--known-issues, or--clear-checkpointon DONE). Do not put logs or diffs in those fields. - Switch it ONLY when (a) the user asks for a new chat, (b) the current
chat visibly lags, or (c) this conversation is Work. Then:
- Same iab tab:
gotohttps://chatgpt.com/, confirm Chat mode (In-app browser §7), then send the boot prompt. - Send a HANDOFF (
docs/protocol.md) — goal, progress, state, issues, next step. Never paste files. - workspace_info check; only then
c2c session set --url. On failure, leave the old saved URL unchanged.
- Same iab tab:
- Saved chat 404s: treat as a switch. Reconstruct HANDOFF from
session.checkpoint(goal, progress, issues, next step). If there is no checkpoint, usetask/iteration/lastStateandexecution_summarymetadata only. Never paste logs or output bodies.
project (new workspaces)
One ChatGPT Project per workspace. Mapping:
- Same Codex conversation (this thread still has context) → same ChatGPT
chat URL.
gotothat URL directly. Do not open the collection first. - Same workspace, a new Codex conversation → new ChatGPT chat from the
collection page (
conversation.projectUrl). Ignoresession.urlunless you already saved it earlier in THIS Codex thread. - Different workspace → different Project and different connector.
Open a chat in this Codex thread
- If you already saved a ChatGPT chat URL earlier in THIS Codex conversation:
gotothat URL. Continue. No new chat. No HANDOFF. - Else if
conversation.projectReady:gotoconversation.projectUrl. On that page, use the on-page composer (「{项目名}中的新聊天」 / "New chat in …"). Do not use the sidebar and do notgotohttps://chatgpt.com/. Confirm Chat mode (In-app browser §7). Boot prompt, then workspace_info with the exactconnectorName. After the reply names this workspace,c2c session set -w <ws> --mode project --project-url <collection> --url <chat> --connector-name "<connectorName>" --title "C2C <workspace name>". If this Codex thread is continuing a previous C2C task, send HANDOFF right after the boot prompt. - Else: Bind Project first.
Update it: same c2c session set --task / --iteration / --state as long-chat.
Wrong collection: do not guess another Project. Tell the user the expected
workspace name, ask them to open the right collection, then say「已找到」.
Also offer「继续用长对话」. If they pick long-chat:
c2c session set -w <ws> --mode long-chat and use the long-chat path.
If the collection 404s or the new chat is not inside the Project, same choice.
Saved chat 404s (this thread): goto the collection, open a new chat
there, boot + HANDOFF from session.checkpoint (no logs) + workspace_info,
then save the new chat URL. Keep --project-url.
Bind Project (user creates the collection once)
Do this for a new workspace, or when an existing user asks to switch to Project. Do not click the ChatGPT sidebar to create the Project (Computer Use is forbidden; IAB must not hunt that menu).
- Tell the user exactly this (fill in the workspace name):
请在 ChatGPT 里新建一个项目,名字用「<workspaceName>」,记忆请选「仅限项目记忆」。
如果侧栏里看不到「项目」:把鼠标放在「聊天」上,点右边出现的三个点,选择「按项目整理」。
建好后会打开合集页面。看到页面后跟我说「好了」。- Wait for「好了」/ the collection page. Same iab tab: read the address bar.
It must look like
https://chatgpt.com/g/g-p-…/project. If it does not, ask them to open that project until it does. Then:c2c session set -w <ws> --mode project --project-url <url> --connector-name "<connectorName>". - On that same collection page only, open 右上角 … → 项目设置.
Do not click 分享. Do not add 来源 / files.
- 记忆: 仅限项目记忆 (project-only). Leave 库访问权限 disabled.
- 指令: paste Project instructions below (fill
{{…}}fromworkspace_info/ setup). Use the exactconnectorNamefrom setup. Never write the public / temporary address into 指令. Save and close settings.
- Still on the collection page, create the first chat with the on-page composer, then boot + workspace_info as in setup step 5. Save the chat URL.
Project instructions (paste into 项目设置 → 指令)
You are the planning and review layer for one local workspace. Codex executes.
This Project is bound only to:
- Workspace name: {{workspace_name}}
- Kind: {{project_type}} ({{languages}} / {{frameworks}})
- Connector (use this one only): {{connector_name}}
When you call tools, use ONLY that connector. Do not use any other
Codex with ChatGPT connector. If workspace_info names a different
workspace, stop. Do not plan. Do not use this Project's memory.
Read code, git, diffs, and any released command output through that
connector. Never ask anyone to paste file bodies, diffs, or logs. After
EXECUTED, call execution_output (list, then read) when a readable item
exists; if status is restricted, review from git instead. Never upload
the repo into this Project's files or sources.
When facts conflict, trust this order:
1. Current code from the connector
2. A HANDOFF in this chat (this task's goal, progress, next step)
3. These instructions
4. This Project's memory (durable architecture only; stale memory loses)
This Project's memory is only for this workspace. On HANDOFF, trust the
brief, re-read code through the connector, and resume at NEXT_EXPECTED_STEP.
Be substantive: why, which file, what to test. No empty one-liners and
no 40-step epics. Use C2C control messages.Workflow: coding task("使用 Codex with ChatGPT 完成 XXX")
Protocol states sent to ChatGPT: INIT → PLAN → EXECUTING → EXECUTED → REVIEW → (PLAN | DONE | BLOCKED).
Local checkpoint states (session only, never a ChatGPT STATE: line):
INIT, PLAN_RECEIVED, EXECUTING, EXECUTED_LOCAL, EXECUTED_SENT, DONE, BLOCKED.
Do not invent STATE: RESUME. If the original chat is gone, send HANDOFF.
All control messages start with [C2C]. Keep Codex→ChatGPT messages under 1 KB.
ChatGPT's replies are expected to be substantive (see step 3). Docs: docs/protocol.md.
c2c tunnel status -w <workspace> --json. IfneedsChoice, follow Connection choice first (existing installs: ask once, then remember). Thenc2c doctor -w <workspace> --json(auto-repairs). Doctor gate: if local is not green, do not open ChatGPT and do not send INIT. IfnamedRepair.neededis true, tell the usernamedRepair.userMessage, runc2c tunnel login --json(their browser; Cloudflare exception), then doctor again. IfchatgptRepair.neededis true, tell the userchatgptRepair.userMessage(one paragraph, no internals), run Workflow: reconnect after address reclaim, then doctor again and only continue when the gate is green. Generate task id:c2c_+ 4 random hex chars — unless a checkpoint already has one (reuse that id; do not mint a second task). Routing: ifc2c routealready gave this task ataskId, reuse it. For an explicit request (this workflow triggered by the user's words), first runc2c route intake -w <ws> --explicit chatgpt --request "<goal>" --json; ifenabled:true, use itstaskId(routing features below apply to this task; when a checkpoint exists it returns that checkpoint's id); otherwise continue exactly as below. If the resume rules in step 1 clear the checkpoint because the user does not want to continue it, run that explicit intake again to get a freshtaskIdfor the new request. If the task was started by the router (--routed-by router) and doctor reportschatgptRepair.neededornamedRepair.needed, ask once: 「这个任务需要先重新连接 ChatGPT(约 1 分钟),现在连接吗?」 — unless the user already agreed to reconnect for this task (ac2c routeconnection_consentorreconnect_consentquestion); then repair without asking again. If they decline:c2c route pin -w <ws> --task <id> --route codex --jsonand finish the task yourself.c2c session -w <workspace> --json. Open ChatGPT on the same iab tab per Conversation management forconversation.mode(foreground + markHandoff). long-chat: saved chat, orhttps://chatgpt.com/if none. project: this thread's chat URL, or the collection page for a new chat, or Bind Project ifprojectReadyis false. On a NEW conversation confirm Chat mode (In-app browser §7), then send the boot prompt fromdocs/protocol.md§Boot Prompt and the workspace_info check (name the exactconnectorName). Confirm the reply names the current workspace before saving the session URL. Do not use the browser to re-read code MCP already provides. After sending a control message, wait per In-app browser §8.Resume from
session.checkpointbefore any INIT. Missing checkpoint (legacy session): continue as a normal new/continued loop. A browser/js timeout is not a lost task — claim the original tab; do not INIT, re-run, or resend EXECUTED just because a wait timed out.EXECUTED_SENT+waitingFor=GPT_REVIEW: do not INIT, do not re-run, do not resend EXECUTED. Stay on the saved chat and wait for review. If that chat 404s: HANDOFF from checkpoint fields (no logs), then wait.EXECUTED_LOCAL: local work is done; only send EXECUTED (record first if this iteration has no record yet). Do not re-run.EXECUTING: not finished. Continue the current PLAN if you still have it; otherwise HANDOFF and ask ChatGPT to restate the last PLAN. Do not treat it as done and do not INIT a new task.PLAN_RECEIVED+waitingFor=none: execute that plan. Do not INIT.INIT/waitingFor=GPT_PLAN: claim the tab and wait. Do not resend INIT.DONE: summarize to the user if needed;c2c session set --clear-checkpoint.BLOCKED: surface ChatGPT's reason; do not INIT for this task. A different new task may clear it after the user confirms.- Any state +
waitingFor=USER: ask the saved question (knownIssues) again. Do not execute, send, or INIT until the user answers. EXECUTED_LOCAL+initMode=REVIEW+ iteration 1: ChatGPT has not seen this task. SendcontrolMessagefromc2c route message review-init -w <ws> --task <id> --json, not EXECUTED. After it is visible:c2c session set -w <ws> --protocol-state EXECUTED_SENT --waiting-for GPT_REVIEW --next-step "wait for PLAN or DONE", then continue from step 7.EXECUTING+closeLocal=true: ChatGPT already said DONE. Finish its FOLLOWUPS locally, then step 9. Never send EXECUTED or HANDOFF (unlessc2c route failurereturnsescalate_chatgpt).routedBy=router, or the checkpoint is older than 24 h, and the user's new message is a different task: do not resume silently. Ask once: 「上次让 ChatGPT 协作的任务「<goal>」还没结束,要继续吗?」 No →c2c session set -w <ws> --clear-checkpoint, then handle the new request.- HANDOFF from
initMode=REVIEWwhile the checkpoint iteration is ≤ 1, or frominitMode=DEBUGat iteration 0: use the PROGRESS and NEXT_EXPECTED_STEP wording in docs/protocol.md §HANDOFF. At a later iteration the task is an ordinary PLAN loop: use the normal HANDOFF. The rules that nameinitMode,closeLocalorwaitingFor=USERwin over the plain state rules above them. Never re-pair, never recreate the connector, and never rewrite Project instructions just to resume.
- Send INIT with the user's goal (skip when the checkpoint says not to).
If
c2c routereturned acontrolMessagefor this task (MODE: REVIEW or MODE: DEBUG), send that text exactly instead of the INIT below, then write the checkpoint itsnextgives you.
[C2C]
STATE: INIT
TASK_ID: c2c_f81a
ITERATION: 0
GOAL:
<user's goal, one paragraph>
INSTRUCTION:
Inspect the connected workspace through the Codex with ChatGPT MCP connector.
Produce a C2C PLAN message.Confirm the INIT message is visibly in that ChatGPT conversation (one cheap
DOM check). If the page is Retry-only, recover per In-app browser §7
first. Do not write the waiting checkpoint, and do not wait for PLAN, until
that message is visible.
Then:
c2c session set -w <ws> --task <id> --iteration 0 --state INIT --protocol-state INIT --waiting-for GPT_PLAN --goal "<short goal>" --next-step "wait for PLAN"
3. Wait for ChatGPT's STATE: PLAN reply (In-app browser §8 — short DOM
checks, same tab; do not treat a 5-minute browser timeout as failure).
Read GOAL/ACTIONS/TESTS/SUCCESS_CRITERIA.
A good PLAN also carries RATIONALE and concrete natural-language edit
suggestions (which file, what to change, why). If the reply is a bare
one-liner with no rationale or file-level guidance, ask once:
"Please expand the plan with rationale and concrete per-file suggestions."
Task started by the router: if the PLAN deletes data or files, drops or
rewrites tables, rewrites git history, or force-pushes, and the user did not
ask for that, ask the user (one line) before executing.
Then:
c2c session set -w <ws> --protocol-state PLAN_RECEIVED --waiting-for none --next-step "execute PLAN"
4. Execute the plan yourself with your own harness (your tools, your judgment;
ChatGPT does not micro-manage tool calls).
Before you start:
c2c session set -w <ws> --protocol-state EXECUTING --waiting-for none --next-step "finish PLAN then record"
Routing enabled for this task: when a test/build/typecheck/lint command
fails, save its output to a temp file and run c2c route failure -w <ws>
--task <id> --command "<cmd>" --output-file <tmp> --exit-code <n> --json
(as in the c2c-router skill). escalate_chatgpt here means: stop fixing, go
to step 5 with --exit-status failed plus that command's
--command/--output-file/--exit-code, and send EXECUTED. Other routes:
follow next.
5. Record the execution so ChatGPT can read it via MCP. Metadata always:
c2c record -w <ws> --task c2c_f81a --iteration 1 --changed-files "src/a.ts,src/b.ts" --tests "27 passed" --exit-status ok
If this iteration ran a test / build / lint / typecheck command, also
pass that command's output. Write stdout/stderr to a local temp file first,
then:
c2c record … --command "pnpm test" --output-file <temp> --exit-code <n>
Record both success and failure. Do not record shell history, .env,
keys, or unrelated dumps. Never paste that file (or any log) into ChatGPT.
If the CLI says the output was not released, still send EXECUTED; ChatGPT
reviews from git. Then:
c2c session set -w <ws> --iteration 1 --state EXECUTED --protocol-state EXECUTED_LOCAL --waiting-for none --next-step "send EXECUTED"
6. Send EXECUTED (no diffs, no logs). Tell ChatGPT to use MCP, including
execution_output when a readable item exists:
[C2C]
STATE: EXECUTED
TASK_ID: c2c_f81a
ITERATION: 1
RESULT:
Execution finished.
CHANGED_FILES:
4
TESTS:
27 passed
Please independently inspect the workspace and current git diff through MCP.
If execution_output lists a readable item for this iteration, list then read it.
If status is restricted, ignore it and review from git_diff.Routing enabled for this task: add this final line to EXECUTED:
If only minor follow-ups remain that need no further review, reply STATE: DONE and list them under FOLLOWUPS:.
Then:
c2c session set -w <ws> --protocol-state EXECUTED_SENT --waiting-for GPT_REVIEW --close-local false --next-step "wait for PLAN or DONE"
(--close-local false: an EXECUTED sent back to ChatGPT ends any local
DONE follow-up phase.)
7. ChatGPT reviews via MCP (git_diff, read_file, test_status,
execution_output) and replies DONE / PLAN (next iteration) / BLOCKED.
8. Loop. Respect maxIterations (.c2c.json maxIterations, default 12). At the
limit, pause and ask: 「已完成 <n> 轮协作,仍有未解决问题,是否继续?」
(<n> = that limit).
9. On DONE with a FOLLOWUPS: section (routing enabled): save that section to a
temp file (from your browser script if it can write files; otherwise write it
yourself) and run c2c route reply -w <ws> --task <id> --iteration <n> --followups-file <tmp> --json;
follow next instead of the rest of this step (it carries its own
checkpoint commands). Otherwise summarize the result to the user in plain language.
c2c session set -w <ws> --state DONE --clear-checkpoint
10. On BLOCKED: read ChatGPT's reason, fix what you can, or surface the single
decision the user must make.
c2c session set -w <ws> --protocol-state BLOCKED --waiting-for USER --known-issues "<short reason>"
Smart routing
Optional and off by default (docs/routing.md). Routing is enabled for a task
when c2c route gave it a taskId with "enabled": true.
c2c routeoutput is advisory for ChatGPT steps only; everything else in this skill still applies.- Print
sayverbatim, at most one routing line per turn. - Never request elevated permissions for
c2c route. Never ask for or read the TypeSafe key. - Never paste route JSON to the user.
- A
c2c routecall that fails, times out, or returns"ok": false: continue without it and never mention it. In step 9 that means applying the FOLLOWUPS as the next iteration, then steps 5–6 (never skip the review).
| user says | run |
| 这次/这个任务 让 ChatGPT 来规划 | c2c route pin -w <ws> --task <id> --route chatgpt --json, follow next |
| 别找 ChatGPT / 不用 ChatGPT,你自己做 | c2c route pin -w <ws> --task <id> --route codex --json |
| 让 ChatGPT 看看 / 复核一下 | c2c route review-gate -w <ws> --task <id> --tests <status> --user-asked-review --json, follow next |
| 以后优先省 Codex 额度 / 优先快一点 | c2c route prefs set --bias economy --json / --bias speed |
| 关闭 / 开启自动切换 | c2c route prefs set --mode off --json / --mode auto (if it fails, follow next) |
| 这个项目别自动找 ChatGPT | c2c route disable -w <ws> --json |
| 刚才不该找 ChatGPT / 刚才应该找 ChatGPT | c2c route feedback -w <ws> --last --verdict wrong --json |
| 开启智能切换 / 设置 TypeSafe | Tell the user (with the real path): 「请在你自己的终端里运行:node "<checkout>/bin/c2c.js" route setup(Key 只在终端里输入,不经过聊天)」 |
If the user pastes an API key into chat: do not repeat it, do not use it, and tell them to run setup in their terminal and rotate that key.
Workflow: disconnect("断开 ChatGPT")
c2c unpair -w <workspace>(revokes all tokens immediately).- Optionally remove the connector on the same iab tab via
https://chatgpt.com/plugins(foreground + markHandoff). Only touch this workspace'sconnectorName. - Tell the user: "已断开 ChatGPT 对该项目的访问。"
Workflow: reconnect after address reclaim(全关掉以后地址失效)
This is the normal case when the user quit Codex / the terminal / the machine:
the previous public address is gone. Doctor already started a new one.
connectorAction: "update" means Delete + create again — not Reconnect.
c2c doctor --json will look like:
{ "chatgptRepair": { "needed": true, "connectorAction": "update", "connectorName": "...", "userMessage": "...", "mcpUrl": "...", "pages": { ... } } }
- Tell the user exactly
chatgptRepair.userMessage. Then you repair. Do not ask them to click around ChatGPT unless a login wall appears. Do not open the C2C chat and do not send[C2C]until this repair finishes and a follow-up doctor is green. Never "try a message first to see if it works". Reusec2c prefs --json. Do not re-ask setup mode. IfsetupModeismanual, use Guided manual ChatGPT setup (chosen) instead of automating. - Same one iab tab as setup (foreground + markHandoff). Settings URLs only
until Connected — never hunt menus:
- 开发人员模式: skip
https://chatgpt.com/#settings/SecuritywhendeveloperModeEnabledis true. If create/delete then says developer mode is required, open it, enable,c2c prefs set --developer-mode. - 插件总管(只用来 Delete):
https://chatgpt.com/plugins - 加插件(Delete 之后必走):
https://chatgpt.com/plugins#settings/Connectors?create-connector=true&redirectAfter=%2Fplugins
- 开发人员模式: skip
- Operate ONLY on
chatgptRepair.connectorName. Never touch another workspace's connector.- If that exact name exists on the plugins hub: Delete it. Confirm the delete if ChatGPT asks. Never click Reconnect, Refresh, Connect, or Edit on the old card — the old Server URL is dead and the page will hang on "This site cannot be reached".
- Then
gotothe 加插件 URL and create that sameconnectorName(do not invent a second name):- Description:
Securely connect ChatGPT to the current Codex workspace for planning and review. - Server URL:
chatgptRepair.mcpUrl - Authentication: OAuth
Then Connect / Authorize. Only then run
c2c pair --jsonand type that code. Continue as soon as it is Connected — do not wait for 8 tools on the settings page.
- Description:
- If the name is already gone, skip Delete and only create.
c2c doctor --jsonagain. Same tab: only after the Doctor gate is green, reopen the chat this Codex thread was already using (session.url/ the URL you saved earlier in THIS thread). Do not rewrite Project instructions — they store the connector name, which did not change. In that same chat, send the workspace_info check from setup step 6 (exactconnectorName). Doctor green is not enough: the old conversation may still be bound to the deleted connector.- If the reply names this workspace: continue there. Save the URL if needed.
- If workspace_info fails, times out, or cannot read the name: do not
keep retrying that old URL. project → collection page, new chat in this
Project, boot + HANDOFF from
session.checkpoint(no logs) + workspace_info, thenc2c session set --urlonly after the name matches. long-chat → Conversation management switch, same checks. Keep the old saved URL until the new chat passes.
- If the ChatGPT conversation was lost: same as the failure path in step 4.
No file re-uploading (the workspace lives in MCP). If tools point at
the wrong connector, open 项目设置 and confirm 指令 still names
connectorName(never paste the new public address).
Workflow: repair(anything looks broken)
c2c doctor -w <workspace> --json. Doctor gate: do not open ChatGPT / send[C2C]until local is green, except reconnect settings pages.- If
namedRepair.needed, tell the usernamedRepair.userMessage, runc2c tunnel login --json, then doctor again. Do not Delete the connector. - If
chatgptRepair.needed, follow reconnect after address reclaim, then doctor again. - Otherwise apply the recovery map. Only involve the user for login / 2FA / CAPTCHA — one action.
Recovery map
| Symptom | Action |
| Bridge not running | c2c start (doctor does this automatically) |
| Tunnel dead / URL unreachable / 全关掉后连接失效 | c2c doctor → if namedRepair.needed, login to Cloudflare and doctor again (do not Delete). If chatgptRepair.needed, tell the user the message, then Delete THIS workspace's connector only (connectorName) and create it again. Never Reconnect. After recreate, re-check workspace_info in the saved chat; if it still fails, new chat in the same Project (or long-chat switch) + HANDOFF. |
| Collection page shows only Retry | Same iab tab: Retry once, then open the last working chat and click its Project link. Do not write INIT/EXECUTED waiting checkpoints until the message is visible. |
| ChatGPT says tool call failed / 401 | token expired or revoked → re-pair (new pairing code + authorize) |
| Pairing code rejected/expired | c2c pair --json for a fresh code |
| Same explicit ChatGPT setup/reconnect browser configuration step fails twice after repair | Stop automating ChatGPT settings and use Guided manual ChatGPT setup fallback. Do not count browser/js timeout, loading/generating, or login/2FA waiting as failures. |
| Port conflict | handled automatically; never surface to the user |
| Every new chat “repairs” / cannot write the log or settings directory | c2c sandbox-allow --json (once). Do not ask the user. |
| cloudflared missing | install it yourself (brew/winget), then retry |
| Sidebar has no「项目」 | Ask the user to hover「聊天」, click the …, choose「按项目整理」 |
| Collection page is the wrong Project | Ask the user to open the named collection and say「已找到」, or accept long-chat |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

