Inspiration
The moment that inspired Codex Cowork felt a little like science fiction.
I was lying in bed with my partner, watching TV, while building software from my phone. Termux connected me to DevPods, my self-hosted remote development environment running in a container on my PC. Inside that terminal, Codex could inspect files, design architecture, write code, run tests, coordinate agents, analyze benchmarks, and manage Git.
I was doing serious end-to-end development without sitting at a desk or even touching my computer. It felt magical—but it also exposed a limitation.
A Codex session moves between very different kinds of work: ambiguous planning, repository exploration, research, implementation, debugging, testing, review, and synthesis. Yet we normally select one model and one reasoning effort for the entire prompt.
The GPT-5.6 family already contains models with different strengths. Sol can lead difficult, ambiguous work. Terra can execute focused supporting work efficiently. Luna can react quickly and handle bounded analysis. I wanted these models to cooperate seamlessly inside the Codex CLI instead of requiring the user to manually open separate sessions, copy context, and coordinate everything.
That became Codex Cowork.
What it does
Codex Cowork turns the Codex CLI into a customizable GPT-5.6 model-delegation pipeline while preserving one native, user-controlled workflow.
Sol remains the lead agent and final authority. A persistent Luna watcher observes only new user-visible session activity and looks for bounded work that another model can own.
When Luna identifies an opportunity, it sends Sol a visible proposal containing:
- The exact scope of work
- Why the work is separable
- Expected benefit and coordination cost
- Permissions and write boundaries
- Acceptance and evidence requirements
- Which model would perform the work
Sol must explicitly accept, decline, narrow, or cancel the proposal. Prose alone cannot transfer ownership.
After acceptance, Cowork starts an isolated Luna or Terra worker with a single-owner lease and a structured result contract.
Cowork currently supports four collaboration modes:
- Reasoning Transfer: Sol surrenders an unresolved reasoning branch and pauses while Luna investigates it. Luna returns a compact conclusion, evidence, uncertainty, and recommended next action—never raw chain-of-thought.
- Scout: A read-only worker performs research or repository investigation.
- Assist: A worker implements a bounded change inside an isolated Git worktree, verifies it, and returns a patch for guarded integration.
- Takeover: Sol waits while a worker receives exclusive ownership of one bounded unit.
The native Codex experience remains intact: model selection, approvals, streaming, history, slash commands, and session resume still belong to Codex. Cowork adds orchestration, visibility, controls, isolation, recovery, and per-model measurements around that experience.
How I built it
Codex Cowork is a Node.js application built around the official Codex App Server protocol.
A local loopback proxy sits between the official Codex terminal interface and App Server:
Official Codex TUI
↕
Cowork proxy and controller
↕
Official Codex App Server
├── persistent Luna watcher
├── isolated Luna reasoner
└── isolated Luna or Terra executor
The controller maintains an exact stream of user-visible events. The watcher receives chronological deltas instead of the complete hidden Codex context. Its thread is reused and periodically compacted, allowing Luna to understand an evolving session without restarting from zero after every message.
Background agents are isolated from inherited skills, MCP servers, apps, memories, hooks, goals, and nested agents. The watcher cannot use tools. Workers receive only the accepted work packet and the capabilities required for that scope.
Cowork also implements:
- Explicit Sol approval through a client-handled control tool
- Stale-proposal expiration
- Single-owner leases
- Interruption, cancellation, and timeout recovery
- Read-only and workspace-write isolation
- Path-aware patch integration
- Structured trust validation
- Safe ownership return after failures
- Persistent but redacted local traces
- Separate input, cached-input, output, and reasoning-output accounting for Sol, the Luna watcher, the Luna reasoner, and Terra
I used GPT-5.6 through Codex for the entire development process. Codex helped me:
- Develop and challenge the original product idea
- Research current Codex extension and App Server capabilities
- Compare several possible architectures
- Implement the proxy, controller, leases, trust boundaries, and model workers
- Create original benchmark repositories and hidden evaluators
- Run parallel implementation and testing agents
- Diagnose live protocol and handoff failures
- Find and repair subtle cursor, schema, timeout, and ownership defects
- Analyze token usage by model and token class
- Write the documentation and submission materials
- Prepare and publish the sanitized GitHub release
Most of this happened through a phone terminal while DevPods kept the development environment and Codex session running remotely. Disconnecting or putting the phone down did not stop the work. I could return to the same terminal and continue where I left off.
Challenges I faced
Preserving the real Codex CLI
The easiest approach would have been to build a new chat interface. That would also discard the Codex experience I wanted to improve.
Cowork instead had to preserve native streaming, approvals, model selection, history, resume behavior, and slash commands while adding an orchestration layer around the official protocol.
Delegation can easily become duplication
Starting another model is easy. Ensuring that the worker actually replaces work is much harder.
Early experiments showed Luna or Terra working in parallel while Sol continued investigating the same problem. That increased total tokens without meaningfully reducing Sol’s reasoning.
This led to explicit ownership contracts and Reasoning Transfer. Sol must agree not to reproduce an accepted reasoning branch, and its control call remains pending while Luna owns that branch.
Privacy and inherited context
A background model should not automatically inherit system prompts, private account information, unrelated skills, external integrations, or raw hidden reasoning.
Cowork therefore constructs isolated threads and fails closed when it cannot verify the background capability boundary.
Knowing whether orchestration actually helps
Multi-agent systems can look impressive while quietly becoming slower and more expensive.
I built a benchmark suite containing nine original mini-repositories, isolated agent workspaces, evaluator-only hidden checks, blinded paired trials, and detailed token accounting.
The central economic question is:
Delegation value = Sol work displaced − (watcher cost + worker cost + coordination cost)
The first held-out comparison did not produce a cost or correctness improvement. Cowork’s worker result was rejected because it crossed its trust boundary. I published that negative result instead of hiding it.
The failure directly influenced the next design: Cowork should transfer ownership of reasoning before Sol performs it, rather than simply adding more parallel activity.
What I learned
The most important part of model orchestration is not routing—it is ownership.
A useful handoff must answer:
- What exact question does the worker own?
- What must Sol stop doing?
- What evidence must the worker return?
- How will the result be verified?
- When should ownership return?
- Did the handoff displace enough expensive work to justify its overhead?
I also learned that deterministic filters can suppress valuable opportunities, while completely unrestricted AI watchers can spend too many tokens. The current design uses semantic Luna decisions, persistent context, adaptive backoff, explicit Sol approval, and visible economics rather than pretending one generic routing rule will fit every prompt.
Finally, I learned how capable the Codex workflow becomes when combined with a persistent remote environment. Building from a phone through DevPods was not merely a novelty—it shaped the product. Cowork had to remain terminal-native, resumable, visible, and controllable because that is how I was actually using it.
What I’m proud of
- A working customizable pipeline across GPT-5.6 Sol, Luna, and Terra
- Native Codex CLI compatibility instead of a replacement interface
- Persistent semantic opportunity detection
- Explicit, visible user and Sol control
- Reasoning Transfer with complementary Luna ownership and Sol abstention
- Isolated workers and guarded patch integration
- Detailed privacy and recovery boundaries
- 79 unit tests and 7 integration tests
- Original benchmark repositories with hidden evaluation
- Model-by-model token and cost measurement
- Honest publication of negative experimental results
- An end-to-end build completed through Codex, much of it from a phone
What’s next
The next step is broader live evaluation of Reasoning Transfer on difficult tasks where baseline Sol naturally performs substantial investigation and reasoning.
Future versions will tune model choice and effort using measured quality, latency, token displacement, and price. The long-term goal is not to delegate as often as possible. It is to create a seamless Codex pipeline where every accepted handoff has a clear owner, measurable value, and trustworthy result.
Built With
- codex
- git
- github
- gpt-5.6
- javascript
- luna
- mcp
- node.js
- sol
- terra
- websockets
- zod
Log in or sign up for Devpost to join the conversation.