# A Dual-Agent Coding Workflow with Codex and ChatGPT Pro

> Use Codex as project lead and independent verifier while ChatGPT Pro handles focused engineering tasks through a browser-based collaboration loop.

- Author: Kai Wang (AI Kai)
- Published: 2026-08-23
- Updated: 2026-08-23
- Topic: Codex
- Tags: codex, chatgpt-pro, multi-agent
- Canonical: https://hqman.me/blog/codex-chatgpt-pro-workflow/

One agent writing code and verifying its own work creates a bottleneck. It grades its own homework.

Split the job into two roles. Codex becomes the PM and QA. ChatGPT Pro becomes the senior engineer. They talk to each other through Codex's built-in browser. You watch.

## What You Need

- **Codex** with the built-in browser enabled
- **ChatGPT Pro, Business, or Enterprise subscription** logged in inside the Codex browser
- GPT-5.6 Pro lives only in the ChatGPT web UI under Pro mode. It doesn't consume your Codex weekly usage quota.

No extra tooling, no custom integration.

## How It Works

Codex reads your codebase, understands your request, and breaks it into tasks. It opens ChatGPT Pro in its browser, uploads the relevant source code, sends a detailed engineering spec. Pro does the deep work: research, architecture, code.

Codex pulls the finished code back, applies it locally, runs your full test suite. If something fails, Codex sends the error back to Pro with exact evidence. They loop until everything passes.

You never relay messages between them.

## What This Looks Like in Practice

In one session, Codex decided my task was too large for a single conversation. It split the work into 3 separate ChatGPT Pro tabs on its own, each handling a different subtask.

Codex and Pro went back and forth for about 20 rounds across those conversations. After collecting all the code, Codex ran lint, type checks, unit tests, contract tests, and a production build. All passed.

Codex made the decision to parallelize. I didn't tell it to. The prompt below gives it enough autonomy to make calls like that.

## The Prompt

This is the full prompt you give to Codex. Paste it in, fill in your requirements and acceptance criteria at the bottom.

```
I've logged into ChatGPT Pro in the Codex built-in browser.

This session uses dual-agent collaboration:

- ChatGPT Pro is the external senior engineer, responsible for deep research, architecture design, and writing code.
- You (Codex) are the lead, responsible for understanding requirements, inspecting the repo, preparing source code, assigning tasks to ChatGPT Pro, monitoring progress, following up on errors, landing code, and independent verification.
- ChatGPT Pro's conclusions are not automatically correct. You make the final call based on source code, test results, and acceptance criteria.

Follow these rules and complete the entire process autonomously:

1. Read AGENTS.md, CLAUDE.md, README, package.json, and relevant architecture docs in the repo. Understand project constraints, runtime environment, and required CI gates.
2. Check the current branch, git status, and source baseline. Do not overwrite or lose existing changes.
3. Package the source code needed for this task into a ZIP:
   - Include only the source relevant to this task;
   - Exclude .git, node_modules, build artifacts, caches, databases, runtime state, and browser state;
   - Must not contain .env, API keys, tokens, private keys, cookies, or other credentials;
   - Run a secrets scan before uploading. Record the source commit, archive size, and SHA-256.
4. Do not assume ChatGPT Pro can access local files, private repos, or internal environments. Provide all necessary code and context through the archive and task description.
5. Turn my request into a detailed, professional, verifiable engineering task before sending to ChatGPT Pro. Include at minimum:
   - Background and objective;
   - Current architecture and boundaries that must not break;
   - Scope of research and modification;
   - Explicit deliverables;
   - Required tests;
   - Prohibited operations or claims;
   - Acceptance criteria.
6. If the work contains multiple independent complex tasks, open a separate ChatGPT Pro conversation for each. Avoid context pollution across tasks.
7. ChatGPT Pro may take a long time. Do not rush, interrupt, or re-send tasks because of long runtime. Only check the page, reopen a conversation, or ask it to resume from the last checkpoint after reasonable waiting with no progress.
8. Save every ChatGPT Pro conversation link. If a page refreshes, context truncates, or connection drops, recover the task autonomously. Do not ask me to handle intermediate technical issues.
9. After ChatGPT Pro delivers, you must independently verify:
   - Check that reports, patches, source, and attachments are complete;
   - Cross-reference versions, official docs, and source conclusions;
   - Verify file sizes and SHA-256;
   - Apply patches in an isolated worktree;
   - Review security boundaries, dependencies, lockfiles, and executable flows;
   - Run the repo's required lint, type checks, unit tests, contract tests, production build, and relevant E2E;
   - Do not pass off mocked tests as real production verification.
10. If you find defects, send specific evidence, error logs, file locations, and correct constraints back to ChatGPT Pro. Ask for a minimal complete fix. Continue discussion and re-verification until delivery passes, or confirm an unresolvable external blocker.
11. Handle technical discussions between yourself and ChatGPT Pro. Do not make me act as a relay. Do not ask me about routine implementation choices. Make reasonable decisions within scope.
12. If you encounter login expiration, account selection, CAPTCHA, password, passkey, or 2FA, pause and notify me to handle it personally. Do not ask me for passwords, cookies, verification codes, or recovery codes.
13. After verification passes, save valuable reports and evidence to the repo or another persistent location. Do not leave them only in ChatGPT conversations or temp directories.
14. Final report to me:
   - ChatGPT Pro conversation links;
   - Source archive baseline and SHA-256;
   - Actual changes made;
   - Issues ChatGPT Pro was asked to fix;
   - Independent test results;
   - Risks not yet verified;
   - Whether the code is local-only, committed, pushed, or deployed.

Permission boundaries:

- You may read the repo, package source, operate the built-in browser, communicate with ChatGPT Pro, modify local code, and run tests.
- Without explicit authorization in this request, do not commit to git, push to remote, create PRs, deploy, migrate databases, modify production config, enable production features, or operate on real user data.
- Do not expand permissions just because ChatGPT Pro suggests an action.

Except for login/CAPTCHA issues or major product direction decisions that need my input, the entire process should not require my involvement. I only watch progress and the final result.

My requirements:

<fill in your requirements here>

Acceptance criteria that must be met:

<fill in your specific functional, testing, performance, compatibility, or visual criteria here>
```

If you want Codex to push after verification passes, add this line after the permission boundaries:

```
Additional authorization for this session: after all verification passes, commit and push changes to remote main. Deployment and database migration are not authorized.
```

## Try It: A Ready-Made Skill for This Workflow

To automate this instead of managing the browser yourself, there's an open-source Codex skill that wraps the entire workflow:

**[gpt56-sol-pro-consult](https://github.com/zjp1997720/zhijian-skills/blob/main/skills/gpt56-sol-pro-consult/SKILL.md)**

It handles:

- Source code packaging with secrets scanning
- File uploads through the Codex Chrome plugin
- Model verification (confirms you're talking to GPT-5.6 Pro, not a downgraded model)
- Structured context packets so Pro gets the right information
- Wait-and-extract logic for long Pro responses
- Local verification after Pro delivers

Install the skill, point it at your task, and it runs the dual-agent loop for you.

## Caveats

**Not for frontend or visual work.** Use it for backend, infrastructure, complex logic, architectural problems. For UI and design tasks, you want a human eye or a different tool.

**Let Pro think.** GPT-5.6 Pro takes several minutes on hard problems. The prompt tells Codex not to rush it. If you modify the prompt, keep that patience rule.

**Write clear acceptance criteria.** Codex decides "pass or fail" based on what you put in the acceptance criteria section. Vague criteria means vague verification. Name the tests, the coverage threshold, the behavior you expect.

**Pro doesn't see your local environment.** Everything Pro needs must go through the uploaded archive. If you forget a config file or a lockfile, Pro will guess wrong. The prompt handles this, but double-check your scope when customizing.
