Skip to content
Development
Skill

/cmux-socket-policy

Socket command threading and focus policy for cmux CLI/socket work. Use when adding or changing socket commands, CLI commands, telemetry commands, focus/select/open/close/send-key behavior, or automation that could steal app focus.

From plugin
cmux
29k25 skills7 commands

Claude Code

$ npx -y skills add manaflow-ai/cmux --skill cmux-socket-policy --agent claude-code

SKILL.md

cmux-socket-policy.SKILL.md
name: cmux-socket-policy
description: "Socket command threading and focus policy for cmux CLI/socket work. Use when adding or changing socket commands, CLI commands, telemetry commands, focus/select/open/close/send-key behavior, or automation that could steal app focus."

cmux Socket Policy

Threading policy

  • Do not use `DispatchQueue.main.sync` for high-frequency socket telemetry commands such as `report_*`, `ports_kick`, status/progress updates, or log metadata updates.
  • For telemetry hot paths, parse and validate arguments off-main.
  • Dedupe and coalesce off-main first.
  • Schedule minimal UI/model mutation with `DispatchQueue.main.async` only when needed.
  • Commands that directly manipulate AppKit/Ghostty UI state are allowed to run on the main actor.
  • If adding a new socket command, default to off-main handling and require an explicit reason in code comments when main-thread execution is necessary.

Focus policy

  • Socket/CLI commands must not steal macOS app focus.
  • Do not activate the app or raise windows unless the command has explicit focus intent.
  • Only explicit focus-intent commands may mutate in-app focus/selection.
  • Explicit focus-intent commands include `window.focus`, `workspace.select/next/previous/last`, `surface.focus`, `pane.focus/last`, browser focus commands, and v1 focus equivalents.
  • All non-focus commands should preserve the current user focus context while still applying data/model changes.
  • Open commands (`vm`/`cloud` shell, tui, open, new, base, workspace new/open, agent; `surface open`/`new-terminal`; `cmux open`; `cmux ssh`) focus only when run interactively and stay in the background when run by an agent or script (`defaultFocusForUserOpen`); `--focus` opts in, `--no-focus` opts out. Their socket methods default `focus` to false, and a pane opened without focus is marked unread.

Remote relay authorization

Every v2 method is a potential `cmux ssh` relay payload. `RemoteRelayCommandPolicy` denies by default; allowlisting a method needs the security analysis and policy tests in [remote relay authorization](references/remote-relay-authorization.md).

Detailed references

  • Read [references/threading-and-focus.md](references/threading-and-focus.md) when adding a command, changing command execution context, or deciding whether focus changes are allowed.
  • Read [references/remote-relay-authorization.md](references/remote-relay-authorization.md) when adding or changing a v2 method, a remote CLI command, or the relay policy.
Read more
@manaflow-ai
Ships withcmux

Open source Ghostty-based macOS terminal with vertical tabs and notifications for AI coding agents. Built for multitasking, organization, and programmability.

Stars on GitHub

Momentum

stars in total
28.8k
Star history of manaflow-ai/cmux on GitHub, a chart by star-history.com

Other skills on cmux.

cmux-architecture

cmux-architecture

cmux package architecture, refactor layering, dependency inversion, file organization, DocC documentation, package design…

@manaflow-ai@manaflow-aiInstall Skill
cmux-backend

cmux-backend

Backend TypeScript and Cloud VM development rules for cmux. Use when editing web/app/api, web/services, backend scripts, Cloud VM…

@manaflow-ai@manaflow-aiInstall Skill
cmux-billing

cmux-billing

Stripe checkout, pricing, subscription, Pro plan, webhook, and entitlement runbook for cmux billing work. Use when editing or…

@manaflow-ai@manaflow-aiInstall Skill
cmux-browser

cmux-browser

End-user browser automation with cmux. Use when you need to open sites, inspect or interact with browser surfaces, wait for page…

@manaflow-ai@manaflow-aiInstall Skill
cmux-capture

cmux-capture

Screenshot or record a cmux window from the CLI, for a pull request, a bug report, or to see what the app actually looks like…

@manaflow-ai@manaflow-aiInstall Skill
cmux-cloud-vm

cmux-cloud-vm

Operate cmux Cloud machines, run durable remote commands or agents, and present their workspaces or services. Use for cmux…

@manaflow-ai@manaflow-aiInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills13d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react4d252k
@facebook@facebookInstall Skill

Questions about cmux-socket-policy.

Which coding agents can use cmux-socket-policy?
cmux-socket-policy installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.