cmux

A terminal for working with coding agents on macOS.

Tagged builds isolate app identities and sockets so agents do not control the wrong running application.

Documents

├── 
├──  · symlink → CLAUDE.md
├── .github
│   └── review-bot-rules
│       └── 
├── cmux-browser
│   └── 
├── cmux-tui
│   ├── 
│   └── 
├── ios
│   ├── 
│   └── 
├── Packages
│   └── iOS
│       ├── 
│       └── 
├── skills
│   ├── *
│   │   └── SKILL.mdTask-specific contributor skills
│   └── cmux-browser
│       └── 
└── web
    ├── 
    └──  · imports AGENTS.md

The file, explained

What makes it useful

cmux centers its instructions on isolated development builds, explicit verification, and shared behavior across UI and CLI surfaces. A tag identifies the application, socket, and build output; companion helpers remove ambient terminal context before targeting that build. The guide also calls out ways a green test run can miss coverage and routes component work to contributor skills. AGENTS.md symlinks to this CLAUDE.md.

Techniques in this file

Quoted passages are verbatim. Open one to see it in the source.

01 / Behavioral framing

Isolate the complete development identity

The build tag controls more than the filename. It isolates the bundle ID, socket, and derived data, allowing development builds to coexist with the user's main application.

Source excerpt starting at line 16.
A tag gives the app its own name, bundle ID, socket, and derived data path, so it runs side-by-side with the user's main app. Report the build to the user as a markdown link to `http://127.0.0.1:17320/<tag>`. Never put a `file://` URL, a raw `.app` path, or `/tmp/cmux-<tag>/...` in chat output.

02 / Hard prohibitions

Remove ambient routing state

The debug helper refuses an unspecified tag and strips inherited terminal identifiers before selecting the tagged socket. This makes the target explicit instead of depending on whichever build was launched most recently.

Source excerpt starting at line 51.
The helper refuses to run without `CMUX_TAG`, targets `/tmp/cmux-debug-<tag>.sock`, and uses the matching tagged CLI from DerivedData. It scrubs ambient cmux terminal context (`CMUX_SOCKET`, `CMUX_SOCKET_PASSWORD`, workspace/surface/tab/panel IDs, cmuxd socket, debug log), then sets `CMUX_SOCKET_PATH`, `CMUX_BUNDLE_ID`, and `CMUX_BUNDLED_CLI_PATH` for the tag.

03 / Verification by change type

Expose the failing regression test in history

The instructions ask for the test and fix in separate commits so CI can show the transition from failure to success.

Source excerpt starting at line 112.
Two commits, so CI proves the test catches the bug: commit 1 adds the failing test only (CI red), commit 2 adds the fix (CI green). This is visible in the PR Commits tab.

04 / Verification by change type

Check whether tests are wired into the target

The file describes a silent failure mode: a Swift test file can exist without Xcode project entries and a successful invocation can execute no tests. It names the guard that checks this wiring.

Source excerpt starting at line 136.
- **Test wiring** (`cmux-testing`): a `.swift` file in `cmuxTests/` without a `PBXFileReference` + `PBXSourcesBuildPhase` entry is silently skipped, and both `xcodebuild test` and bot reviews pass with "Executed 0 tests". `workflow-guard-tests` runs `./scripts/lint-pbxproj-test-wiring.sh` to catch it.

05 / Verification by change type

Reproduce on the reporter's platform

A documented Foundation difference explains how maintainer machines can miss a bug affecting an older macOS release. The instruction makes the reporter's version part of reproduction.

Source excerpt starting at line 140.
- **Foundation, SwiftUI, AttributeGraph, and WebKit semantics change between macOS major versions.** `URL(fileURLWithPath: "/").deletingLastPathComponent().path` returns `"/.."` on macOS 14 and 15 but `"/"` on macOS 26 (https://github.com/manaflow-ai/cmux/issues/4529); CI and maintainer machines were all on the fixed side while every reporter was on the broken side. Test on the reporter's macOS before declaring a repro disproven. AWS M4 Pro builders (`aws-m4pro-1..6`) run macOS 15.7.4.

06 / Pointing at the source of truth

Give all entry points one behavior owner

Shortcuts, menus, CLI, and settings must use the same action path. Optimistic updates also share one mutation path and reconcile against the authoritative result.

Source excerpt starting at line 144.
When a behavior is exposed through multiple entrypoints (shortcut, command palette, context menu, CLI, settings, debug menu), implement one shared action path and verify every entrypoint. Do not patch one surface and leave the others with duplicated logic.

Put it to work

Borrow this for your repo

  1. Isolate runtime identifiers as well as build output in parallel development.
  2. Make control helpers reject an unspecified target and scrub inherited routing context.
  3. Verify that added test files are actually part of the test target.
  4. Reproduce platform-sensitive failures on the reported operating-system version.
  5. Route UI and CLI entry points through the same action implementation.

How the file is organized

  1. 01Setup
  2. 02Build and reload
  3. 03Shared Mac fleet capacity
  4. 04Tag-bound debug CLI
  5. 05iOS UI follows the Apple HIG
  6. 06iOS builds open on the iPhone by default
  7. 07All fleet slots are general-purpose
  8. 08Cross-tag Mac access for DEV iPhone builds
  9. 09iOS dev auth
  10. 10Regression test commits
  11. 11First pass, then dogfood
  12. 12Pitfalls
  13. 13Shared behavior policy
  14. 14Remote CLI relay authorization (GHSA-9vmv-3hjw-j28c)
  15. 15Skills
Read this revision on GitHub ↗

Context your instructions cannot carry

cmux's file tells an agent how the codebase works. It cannot tell it which bug three customers hit this week. Modem keeps that context current and attaches it to the work.

Try Modem