dmux AGENTS.md

A maintainer guide for dmux, a TypeScript terminal interface for managing parallel AI-agent work in tmux panes and Git worktrees. It maps the main documentation and source files to the system's major functions.

In plain words
What is it for?
Use it when maintaining dmux's terminal interface, tmux sessions, Git worktrees, agent launching, pane behavior, merging, cleanup, or multi-project support.
Why use it?
It helps contributors understand where session management, panes, worktrees, agent startup, and cleanup are implemented. This makes repository changes easier to place correctly.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/standardagents/dmux/agents-md
Clone the repo
git clone --depth 1 https://github.com/standardagents/dmux

Made for: Codex, OpenCode.

Per session 1,916 This file is loaded in full into every session.
When invoked 1,916 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01916 $0.01916
Opus 5 $0.00958 $0.00958
Sonnet 5 $0.00383 $0.00383
Haiku 4.5 $0.00192 $0.00192

Measured 2d ago against content hash 7bcfbc772208, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

dmux AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 185 lines

How it starts

The opening of the file, as written. The whole thing — 185 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 behavior
  • src/DmuxApp.tsx: main TUI state, status/footer, input hookups, source switching
  • src/services/DmuxFocusService.ts: macOS helper lifecycle, fully-focused pane tracking, helper-backed native notifications
  • src/services/DmuxAttentionService.ts: attention-notification coordinator for idle/waiting panes
  • src/services/InferenceService.ts: provider-neutral text inference, dynamic model discovery, and primary/backup failover
  • src/services/CodexAppServerClient.ts: ChatGPT subscription auth/model/inference bridge through Codex app-server
  • src/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 protected
  • src/utils/paneAgentTracking.ts: process-tree detection for agents launched manually in any pane, plus exact Claude/Codex session capture used by crash restoration
  • src/hooks/usePaneLoading.ts: persisted pane loading/rebinding and recreation for both worktree and terminal panes
  • src/hooks/useInputHandling.ts: keyboard and menu action handling
  • src/services/PopupManager.ts: popup launch + data plumbing
  • src/actions/types.ts: action registry and menu visibility rules
  • src/actions/implementations/closeAction.ts: close behavior + source fallback on source-pane removal
  • src/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. kebabMenuPopup uses the same scheme so menu items are clickable

Read the full file on GitHub · 185 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 185 lines · 1,916 tokens per session scan A 7bcfbc772208

Subscribe to this mod's changes

dmux AGENTS.md is an instructions file published in the GitHub repository standardagents/dmux (1,760 stars, last pushed 16d ago), licensed MIT. It adds 1,916 tokens to every session, about $0.0096 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories