PluginBench
Skill
Pass
Audit score 90

cmux-debugging

manaflow-ai/cmux

How to install cmux-debugging

npx skills add null --skill cmux-debugging
Claude Code
Cursor
Windsurf
Cline
Full instructions (SKILL.md)

Source of truth, from manaflow-ai/cmux.


name: cmux-debugging description: "Debug logging, Debug menu, runtime pitfalls, typing-latency-sensitive paths, SwiftUI list snapshot boundaries, OS-version repros, and local visual iteration for cmux. Use when adding debug probes, diagnosing UI/runtime issues, touching terminal rendering, tab/sidebar list views, drag/drop UTTypes, or using the Debug menu."

cmux Debugging

Debug event log

When adding debug event instrumentation, put events (keys, mouse, focus, splits, tabs) in the unified DEBUG build log. This is not a blanket requirement to add logs to every new code path. Most temporary probes should be added only during the dogfood debug loop and removed before merge.

tail -f "$(cat /tmp/cmux-last-debug-log-path 2>/dev/null || echo /tmp/cmux-debug.log)"
  • Untagged Debug app: /tmp/cmux-debug.log
  • Tagged Debug app (./scripts/reload.sh --tag <tag>): /tmp/cmux-debug-<tag>.log
  • reload.sh writes the current path to /tmp/cmux-last-debug-log-path
  • reload.sh writes the selected dev CLI path to /tmp/cmux-last-cli-path
  • reload.sh updates /tmp/cmux-cli and $HOME/.local/bin/cmux-dev to that CLI
  • Implementation: Packages/macOS/CMUXDebugLog/Sources/CMUXDebugLog/DebugEventLog.swift
  • App shim: Sources/App/DebugLogging.swift
  • Free function cmuxDebugLog("message") logs with timestamp and appends to file in real time from cmux code
  • The package implementation and app shim are #if DEBUG; all call sites must be wrapped in #if DEBUG / #endif
  • 500-entry ring buffer; CMUXDebugLog.DebugEventLog.shared.dump() writes full buffer to file
  • Key events logged in AppDelegate.swift (monitor, performKeyEquivalent)
  • Mouse/UI events logged inline in views (ContentView, BrowserPanelView, etc.)
  • Focus events: focus.panel, focus.bonsplit, focus.firstResponder, focus.moveFocus
  • Bonsplit events: tab.select, tab.close, tab.dragStart, tab.drop, pane.focus, pane.drop, divider.dragStart

Debug menu

The app has a Debug menu in the macOS menu bar only in DEBUG builds. Use it for visual iteration.

  • Debug > Debug Windows contains panels for tuning layout, colors, and behavior. Entries are alphabetical with no dividers.
  • To add a debug toggle or visual option: create an NSWindowController subclass with a shared singleton, add it to the "Debug Windows" menu in Sources/cmuxApp.swift, and add a SwiftUI view with @AppStorage bindings for live changes.
  • When the user says "debug menu" or "debug window", they mean this menu, not defaults write.

Runtime pitfalls

  • Custom UTTypes for drag-and-drop must be declared in Resources/Info.plist under UTExportedTypeDeclarations.
  • Do not add an app-level display link or manual ghostty_surface_draw loop; rely on Ghostty wakeups/renderer to avoid typing lag.
  • WindowTerminalHostView.hitTest() is typing-latency-sensitive. All divider/sidebar/drag routing is gated to pointer events only. Do not add work outside the isPointerEvent guard.
  • TabItemView uses Equatable conformance plus .equatable() to skip body re-evaluation during typing. Do not add environment/store/binding reads without updating equality and the call site.
  • TerminalSurface.forceRefresh() is called on every keystroke. Do not add allocations, file I/O, or formatting there.
  • SurfaceSearchOverlay must be mounted from GhosttySurfaceScrollView in Sources/GhosttyTerminalView.swift, not from SwiftUI panel containers.
  • List subtrees with LazyVStack, LazyHStack, List, or ForEach must pass immutable row snapshots plus closures below the boundary. Do not pass observable stores into row views.
  • Functions called from SwiftUI body must not mutate state or schedule store writes.
  • Foundation, SwiftUI, AttributeGraph, and WebKit semantics can change between macOS major versions. Test on the reporter's macOS before declaring a user repro disproven.

Detailed references

Related skills

More from manaflow-ai/cmux and the wider catalog.

CM

cmux

manaflow-ai/cmux

End-user control of cmux topology and routing (windows, workspaces, panes/surfaces, focus, moves, reorder, identify, trigger flash). Use when automation needs deterministic placement and navigation in a multi-pane cmux layout.

4.2k installsAudited
CM

cmux-browser

manaflow-ai/cmux

End-user browser automation with cmux. Use when you need to open sites, interact with pages, wait for state changes, and extract data from cmux browser surfaces.

3.7k installs
CM

cmux-markdown

manaflow-ai/cmux

Open markdown files in a formatted viewer panel with live reload. Use when you need to display plans, documentation, or notes alongside the terminal with rich rendering (headings, code blocks, tables, lists).

3.1k installsAudited
CM

cmux-settings

manaflow-ai/cmux

View and edit cmux settings in ~/.config/cmux/cmux.json. Use when the user wants to change cmux preferences (appearance, sidebar, notifications, automation, browser, shortcuts), set a value by JSON path, validate the file, open it in an editor, or look up which keys cmux recognizes. Triggers on '/cmux-settings', 'change cmux setting', 'set <something> in cmux', 'cmux config', 'cmux.json', or 'rebind a cmux shortcut'.

2.2k installsAudited
CM

cmux-workspace

manaflow-ai/cmux

Work inside the current cmux workspace and terminal. Use for cmux workspace, current workspace, caller surface, panes, surfaces, socket targeting, and non-interfering cmux automation.

2.2k installsAudited
CM

cmux-customization

manaflow-ai/cmux

Customize cmux for an end user. Use when changing cmux.json actions, custom commands, workspace layouts, plus-button behavior, surface tab bar buttons, Command Palette entries, Dock controls, sidebar and app settings, shortcuts, notifications, browser routing, examples-library presets, or Ghostty-backed terminal preferences.

2.1k installsAudited