· By the ToolNav Team · 5 min read OpenAI Codex CLI Agentic Coding Developer Tools CLI Desktop Automation

Codex CLI 0.138.0: Desktop Handoff Lands on macOS and Windows

TL;DR

OpenAI shipped Codex CLI 0.138.0 on June 8, 2026, adding a new `/app` command that hands off a live CLI thread into Codex Desktop on macOS and native Windows. The release also exposes saved image file paths to the model for follow-up edits, adds account token-usage visibility for app-server integrations, and expands plugin automation with structured JSON output. Two alpha builds (0.139.0-alpha.1 and alpha.2) followed on June 9. If you're already using Codex CLI for agentic coding, this update meaningfully extends what agents can do without leaving the terminal.

0.138.0

Codex CLI version shipped June 8, 2026 — confirmed on the OpenAI Codex GitHub releases page

/app

New command that hands off a live CLI thread into Codex Desktop on macOS and native Windows

2

Alpha builds (0.139.0-alpha.1 and alpha.2) shipped on June 9, within hours of the stable release

--json

New plugin automation flag enabling structured JSON output with marketplace source and default prompts

Desktop handoff is the headline change. The new `/app` command lets a running CLI thread hand off directly into Codex Desktop — the GUI application — on both macOS and native Windows. In practice this means an agent working inside the terminal can escalate into a desktop session without restarting the conversation or losing context. For operators running multi-step agentic workflows, the `/app` bridge removes a meaningful friction point: previously, switching from CLI to desktop meant abandoning the current thread entirely.

Image file paths now reach the model. Local image attachments and standalone image generations now expose their saved file paths to the model as part of the context. This is a targeted but useful improvement — if an agent generates or references a visual asset, it can now receive the actual file path back, enabling follow-up edits, file operations, or downstream pipeline steps that need to reference the same asset. Previously the model saw image content but not the on-disk location.

Token usage visible in app-server integrations. App-server integrations can now read account token usage via the Codex auth layer, which also adds support for v2 personal access tokens. For operators running Codex agents as a backend service — billing against usage, enforcing limits, or monitoring spend — this closes a gap that previously required separate API calls or external tracking.

Plugin automation gets structured output. Plugin automation now supports `--json` output, along with marketplace source metadata and default prompts. For teams building on the plugin system programmatically, structured JSON output is the difference between reliable parsing and brittle string matching. This makes Codex more composable as a component in a larger toolchain — particularly relevant if you're comparing it to alternatives like Cursor or GitHub Copilot for agentic pipeline integration.

Performance and stability improvements round out the release: TUI startup is faster via reused discovery results, session restoration now hits the state DB first, and large MCP/Ollama streams plus long message histories process significantly faster. There are also fixes for multiline paste in `/goal edit`, forked threads now correctly preserve user-renamed titles, and workspace instruction loading is more accurate for remote and symlinked workspaces.

Alpha track moved quickly. Two alpha builds — 0.139.0-alpha.1 (June 9, 00:12) and 0.139.0-alpha.2 (June 9, 04:13) — shipped within hours of 0.138.0. The rapid alpha cadence suggests active development on the next minor version; operators who track the alpha channel should expect changes within days.

Why It Matters

Codex CLI is closing the gap between terminal agents and desktop GUI workflows. The `/app` handoff command is the clearest signal yet that OpenAI is treating CLI and desktop as a unified surface rather than separate products — agents can now move between them mid-task without losing state. For operators building agentic coding pipelines, this matters on two levels: first, it expands what a CLI-based agent can do (hand off to a desktop session for tasks that benefit from a GUI); second, it signals the architectural direction OpenAI is taking with Codex as a platform. The plugin JSON output and token-usage visibility additions are smaller but operationally meaningful — they make Codex more reliable to run as a backend component and easier to instrument for cost management. See how it compares to other tools in the Best AI Coding Tools roundup.

Who's Affected

  • Developers using Codex CLI for agentic workflows — the `/app` handoff command is immediately usable on macOS and native Windows; upgrade to 0.138.0 and test the CLI-to-desktop bridge on any existing multi-step agent workflow
  • Operators running Codex as an app-server integration — account token usage is now readable via the integration layer; instrument this if you're tracking spend or enforcing usage limits across API calls
  • Teams building on Codex's plugin system — `--json` output is available now; if you're parsing plugin output programmatically, switch to structured output to eliminate brittle string-matching in your pipeline
  • Windows users specifically — desktop handoff now works on native Windows (not just macOS), making the `/app` command a cross-platform capability rather than a Mac-first feature

What To Do Now

  1. 1. Run `npm install -g @openai/codex@0.138.0` or your equivalent upgrade path and test the `/app` command on macOS or Windows — verify that your existing CLI thread state (conversation history, context) carries over correctly into the desktop session before relying on it in production workflows
  2. 2. If you're billing or monitoring Codex agent usage, wire up the new account token-usage endpoint in your app-server integration now — this gives you visibility that previously required separate API instrumentation, and v2 personal access tokens are supported in the same update
  3. 3. Audit any plugin automation code that parses CLI output as plain text — switching to `--json` output will make your parsing more reliable; the update also includes marketplace source and default prompt metadata you may want to use
  4. 4. Watch the 0.139.0 alpha track — two alpha builds shipped within 5 hours of 0.138.0 going stable, which is unusually fast; if you run a staging environment on the alpha channel, expect a 0.139.0 stable release within days

More on this topic — Best AI Coding Tools

Independent Review

GitHub Copilot

Pricing, pros and cons, real-world verdict — no affiliate spin.

Read the GitHub Copilot review

The AI Hustle Playbook Newsletter

Get one practical AI playbook each week.

Tools, workflows, and side-income ideas — curated for people who want to build, not browse forever.

No spam. Unsubscribe anytime. We respect your privacy.