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

Share this project:

Updates

posted an update

Here are the results from the prompt I put in on the video. Sorry for the last minute video and poor script and obvious script reading. The due date for me was 7PM and if you look at the time. I was cutting it extremely close as I always do haha... Still working on getting actual good results but the concept and execution is extremely cool and I think with enough tweaking this can become something legitimately useful. Stay tuned for more updates on actual statistics on token saving or solution improvement.

Sol findings

  • [Medium] MCP fallback instructs Sol to call an unavailable toolsrc/cowork/controller.mjs:29, bin/cowork-mcp.mjs:48

Foreign-thread resumes use MCP controls named cowork_accept, cowork_decline, and so on, but both the injected instructions and proposals require cowork_control. This can prevent explicit proposal decisions.

Current MCP integration tests exercise only cowork_status. Expose cowork_control through MCP or generate transport-aware instructions, with an accept/decline integration test.

  • [Medium] Resume transport selection ignores the stored transportsrc/runtime/launcher.mjs:124, src/cowork/controller.mjs:442

The registry stores controlTransport, but the launcher checks only whether an entry exists. A thread previously resumed through MCP—or launched with Cowork off—is subsequently treated as dynamic, although no dynamic tool was attached to that thread.

Read the stored transport and select dynamic only for dynamic-origin threads. Add MCP-to-auto and off-to-auto resume tests.

  • [Medium] The promised recovery after skills/changed cannot occursrc/cowork/controller.mjs:395, src/cowork/controller.mjs:1469

The notification invalidates the privacy lock and tells the user to start another turn, but #mcpConfigRequested remains true. No new inventory request occurs, while #mcpConfigLoaded = false permanently blocks the watcher.

Reset or rerun preflight on the next turn and test successful recovery.

  • [Low] Signal exits are collapsed to status 128src/runtime/launcher.mjs:215

SIGINT, SIGTERM, and SIGHUP all return 128 instead of the conventional 130, 143, and 129. This obscures the shutdown cause for shells and supervisors.

Map the signal number and add launcher lifecycle coverage.

Cowork findings

  • [High] MCP isolation becomes stale after initial preflightsrc/cowork/controller.mjs:554

A newly added or enabled MCP server is absent from later background-thread deny configurations.

Refresh or revision-bind the capability lock before every background-thread start, and test post-preflight configuration changes.

  • [High] Skill discovery can omit a requested root without failing closedsrc/cowork/skill-isolation.mjs:10

Validation compares entry counts rather than exact canonical roots. Duplicate /watcher results were accepted for expected /watcher and /repo roots, potentially leaving repository skills enabled.

Reject duplicate, missing, and unexpected roots.

  • [Medium] Free-form trace fields bypass redactionsrc/cowork/trace.mjs:4, src/cowork/controller.mjs:882

reason, error, and message can persist verbatim user-derived text.

Use allowlisted operational codes or redact all free-form strings. Add nested canary tests.

  • [Medium] Benchmark containment is symlink-bypassablesrc/workspace.mjs:9, src/evaluator.mjs:9

path.resolve provides only lexical containment.

Canonicalize paths with realpath, recheck them after creation, and reject symlinked seed paths.

  • [Medium] Nested fields can deanonymize blinded resultssrc/blinding.mjs:41

Nested metrics and checks can contain strategy, condition, or model identities.

Enforce strict recursive schemas and add nested identity canaries.

Combined conclusion

Not release-ready.

The two high-severity privacy-boundary defects should block release. The fallback and resume control defects also undermine documented core behavior.

A fresh npm test run passed all 81 unit tests and 7 integration tests, confirming that these are coverage gaps rather than existing test failures. Live, cost-bearing App Server smoke tests were not run.

No files were modified. The pre-existing executable-bit changes to bin/cowork.mjs and bin/cowork-eval.mjs remain unchanged.

Log in or sign up for Devpost to join the conversation.