dmux
AGENTS.md1.8k starsChanged 5 months agoMITView on GitHub
This file is the maintainer-focused source of truth for working on dmux itself. CLAUDE.md is a symlink to this file for tool compatibility. dmux is a TypeScript + Ink TUI for managing parallel AI-agent work in tmux panes backed by git worktrees. Core behavior: dmux ships a macOS helper daemon implemented in native/macos/dmux-helper.swift. What it does:
Trending
Quiet since September.thin dataabout the whole repository
Who's talking about standardagents/dmux
- manaflow-ai/cmux“[Feature] Per-pane auto git worktree + branch isolation (dmux-style agent isolation)”GitHub · May 1, 2026 · 12 reactions
- benjamincanac/whichcodingtools“data: backfill 18 pricing snapshots”GitHub · Sep 18, 2026
- jrdevelopr/ai-builders-toolkit“Add platform: dmux”GitHub · Jun 21, 2026
- mkb23/overcode“docs... bake-off between dmux and overcode”GitHub · Apr 15, 2026
- deepwatrcreatur/nix-dmux“[WIP] Add packaging for dmux in nix”GitHub · Mar 13, 2026
The biggest 5 of 5 mentions linking to the repository that our crawl found. Each line is their own headline.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,736 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- .dmux-hooks/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .dmux-hooks/CLAUDE.mdCLAUDE.md
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
14 rules. About 0 are common, 6 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 52
If the packaged bundle is unavailable (for example in a source checkout without a prepack step), dmux can still build the helper app bundle …
- Distinctive: line 77
If focus behavior changes, update this section and keep CLAUDE.md as a symlink to AGENTS.md.
- Very specific: line 83
Add the new ID to AGENT_IDS (this updates the AgentName type).
- Very specific: line 84
Add a full entry in AGENT_REGISTRY for that ID with:
- Very specific: line 90
Keep shortLabel unique and exactly 2 characters (enforced at runtime).
- Very specific: line 124
Use pane menu action: [DEV] Use as Source
- Distinctive: line 131
If the active source pane/worktree is closed or removed, source automatically falls back to project root.
- Very specific: line 169
Run dmux from a maintainer worktree with pnpm dev.
- Distinctive: line 170
Create worktree panes for features/fixes.
- Distinctive: line 172
Run checks before PR:
- Very specific: line 181
Keep pnpm dev as the default path for dmux development.
- Very specific: line 182
Treat dev:watch as internal machinery behind the default dev entrypoint.
- Distinctive: line 183
Keep dev-only controls hidden outside DEV mode.
- Distinctive: line 184
Update this file when dev workflow behavior changes.
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md - dmux Maintainer Guide
This file is the maintainer-focused source of truth for working on dmux itself.
Docs map
README.md: end-user overview and install/usage.CONTRIBUTING.md: local development loop and PR workflow.AGENTS.md(this file): maintainer behavior, architecture landmarks, and current dev-mode workflow.
CLAUDE.md is a symlink to this file for tool compatibility.
Project overview
dmux is a TypeScript + Ink TUI for managing parallel AI-agent work in tmux panes backed by git worktrees.
Core behavior:
- One project-scoped dmux session (stable name based on project root hash)
- One worktree per work pane
- Durable regular terminals restored in their last observed working directories
- Agent launch + prompt bootstrap in each pane
- Merge/close actions with worktree cleanup hooks
- Optional multi-project grouping in one session
Important architecture landmarks
src/index.ts: startup, tmux session attach/create, control pane management, dev-mode startup behaviorsrc/DmuxApp.tsx: main TUI state, status/footer, input hookups, source switchingsrc/services/DmuxFocusService.ts: macOS helper lifecycle, fully-focused pane tracking, helper-backed native notificationssrc/services/DmuxAttentionService.ts: attention-notification coordinator for idle/waiting panessrc/services/InferenceService.ts: provider-neutral text inference, dynamic model discovery, and primary/backup failoversrc/services/CodexAppServerClient.ts: ChatGPT subscription auth/model/inference bridge through Codex app-serversrc/services/TerminalPaneNamingService.ts: LLM-based naming for regular terminals — untitled panes are checked aggressively and named from streaming output; titled panes only rename from settled output on a relaxed cadence; human names are protectedsrc/utils/paneAgentTracking.ts: process-tree detection for agents launched manually in any pane, plus exact Claude/Codex session capture used by crash restorationsrc/hooks/usePaneLoading.ts: persisted pane loading/rebinding and recreation for both worktree and terminal panessrc/hooks/useInputHandling.ts: keyboard and menu action handlingsrc/services/PopupManager.ts: popup launch + data plumbingsrc/actions/types.ts: action registry and menu visibility rulessrc/actions/implementations/closeAction.ts: close behavior + source fallback on source-pane removalsrc/components/panes/*: pane list rendering (includes source indicator)src/utils/sidebarMouse.ts+src/hooks/useSidebarMouse.ts: sidebar mouse support; mouse escape sequences are stripped from Ink's stdin via a proxy stream and re-emitted as events. Click highlights a row without changing tmux pane focus, double-click activates it (pane menu / action button), wheel steps the selection.kebabMenuPopupuses the same scheme so menu items are clickable
Native helper
dmux ships a macOS helper daemon implemented in native/macos/dmux-helper.swift.
What it does:
- Release packages ship a prebuilt
dmux-helper.appbundle undernative/macos/prebuilt/ - On macOS, dmux syncs that packaged app bundle into
~/.dmux/native-helper/dmux-helper.app - If the packaged bundle is unavailable (for example in a source checkout without a prepack step), dmux can still build the helper app bundle on demand from
native/macos/dmux-helper.swift - Auto-starts behind a Unix socket at
~/.dmux/native-helper/run/dmux-helper.sock - Tracks the actual frontmost macOS app/window via CoreGraphics + Accessibility
- Correlates the active terminal window/tab back to a specific dmux instance using a short token injected into the terminal title
- Delivers macOS notifications for panes that need attention
- The square helper icon source lives at
native/macos/dmux-helper-icon.png; it is derived fromdocs/public/favicon.svgso the docs/favicon mark and native helper branding stay aligned - Bundles custom notification sounds from
native/macos/sounds/and randomly chooses from the configured enabled set for each background alert - Startup also removes the legacy
~/.dmux/macos-notifierhelper if it still exists from older dmux releases - This is progressive enhancement only: on non-macOS platforms the helper path must stay inert and dmux should continue working without native focus/notification integration
Focus model:
DmuxFocusServicewrites a per-instance token into the terminal title.- The helper looks at the frontmost visible app window and its title.
- A pane is considered "fully focused" only when:
- the frontmost app bundle matches the terminal app running this dmux instance, and
- the focused window title contains this dmux instance's token, and
- tmux reports that pane as the selected pane.
Notification model:
- Worker heuristics +
PaneAnalyzerfirst decide whether a pane is still working or has settled intoidle/waiting. StatusDetectoremits attention events only after LLM-backed analysis succeeds.DmuxAttentionServiceonly sends a native notification when that pane is not the fully focused pane for this dmux instance.
If focus behavior changes, update this section and keep CLAUDE.md as a symlink to AGENTS.md.
Adding a new agent to the registry
The agent registry is centralized in src/utils/agentLaunch.ts.
- Add the new ID to
AGENT_IDS(this updates theAgentNametype). - Add a full entry in
AGENT_REGISTRYfor that ID with:- metadata (
name,shortLabel,description,slugSuffix) - install detection (
installTestCommand,commonPaths) - launch behavior (
promptCommand,promptTransport, pluspromptOptionorsendKeys*fields when needed) - permission mapping (
permissionFlags) anddefaultEnabled - optional resume behavior (
resumeCommandTemplate) and startup command split (noPromptCommand)
- metadata (
- Keep
shortLabelunique and exactly 2 characters (enforced at runtime).
Most UI/settings surfaces consume getAgentDefinitions(), so they pick up registry additions automatically (for example, enabled-agents settings and chooser popups).
Related places to verify after adding an agent:
src/utils/agentDetection.tsfor install detection behavior__tests__/agentLaunch.test.tsfor registry/permission/command expectationsdocs/src/content/agents.js(static docs page; update supported-agent docs when behavior changes)
Recommended validation:
pnpm run typecheck
pnpm run testMaintainer local workflow (dmux-on-dmux)
pnpm dev is the standard entry point when editing dmux.
What it does:
- Bootstraps local docs/hooks (
dev:bootstrap) - Compiles TypeScript once
- Launches dmux in dev mode from
dist/index.js(built runtime parity) - Auto-promotes to watch mode when launched in tmux
Result: changes in this worktree should recompile/restart automatically without repeated manual relaunches.
Dev-mode source workflow
In DEV mode, a single source path is active at a time.
- Use pane menu action:
[DEV] Use as Source - Hotkey equivalent:
S
Toggle semantics:
- Toggling on a non-source worktree pane switches source to that worktree.
- Toggling on the currently active source pane switches source back to project root.
- If the active source pane/worktree is closed or removed, source automatically falls back to project root.
UI cues:
- Footer shows
DEV MODE source: <branch> - Active source pane is marked with
[source]in the pane list - Dev-only actions are prefixed with
[DEV]and only shown in DEV mode
Dev diagnostics
Use:
pnpm run dev:doctorChecks include:
- session exists
- control pane validity
- watch command detection
- active source path
- generated docs file presence
- local hooks presence
Hooks and generated docs
pnpm dev and pnpm dev:watch both ensure generated hooks docs exist before runtime.
Key artifacts:
src/utils/generated-agents-doc.ts- local hooks under
.dmux-hooks/(notablyworktree_created,pre_merge)
Pull request workflow
Recommended:
- Run dmux from a maintainer worktree with
pnpm dev. - Create worktree panes for features/fixes.
- Iterate and merge via dmux.
- Run checks before PR:
pnpm run typecheck
pnpm run testNotes for maintainers
- Keep
pnpm devas the default path for dmux development. - Treat
dev:watchas internal machinery behind the defaultdeventrypoint. - Keep dev-only controls hidden outside DEV mode.
- Update this file when dev workflow behavior changes.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

