shipwright-cli 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/README.md +160 -72
  2. package/completions/_shipwright +59 -7
  3. package/completions/shipwright.bash +24 -4
  4. package/completions/shipwright.fish +80 -2
  5. package/dashboard/server.ts +208 -0
  6. package/docs/tmux-research/TMUX-ARCHITECTURE.md +567 -0
  7. package/docs/tmux-research/TMUX-AUDIT.md +925 -0
  8. package/docs/tmux-research/TMUX-BEST-PRACTICES-2025-2026.md +829 -0
  9. package/docs/tmux-research/TMUX-QUICK-REFERENCE.md +543 -0
  10. package/docs/tmux-research/TMUX-RESEARCH-INDEX.md +438 -0
  11. package/package.json +2 -2
  12. package/scripts/lib/helpers.sh +7 -0
  13. package/scripts/sw +116 -2
  14. package/scripts/sw-activity.sh +1 -1
  15. package/scripts/sw-adaptive.sh +1 -1
  16. package/scripts/sw-adversarial.sh +1 -1
  17. package/scripts/sw-architecture-enforcer.sh +1 -1
  18. package/scripts/sw-auth.sh +1 -1
  19. package/scripts/sw-autonomous.sh +128 -38
  20. package/scripts/sw-changelog.sh +1 -1
  21. package/scripts/sw-checkpoint.sh +1 -1
  22. package/scripts/sw-ci.sh +1 -1
  23. package/scripts/sw-cleanup.sh +1 -1
  24. package/scripts/sw-code-review.sh +62 -1
  25. package/scripts/sw-connect.sh +1 -1
  26. package/scripts/sw-context.sh +1 -1
  27. package/scripts/sw-cost.sh +44 -3
  28. package/scripts/sw-daemon.sh +155 -27
  29. package/scripts/sw-dashboard.sh +1 -1
  30. package/scripts/sw-db.sh +958 -118
  31. package/scripts/sw-decompose.sh +1 -1
  32. package/scripts/sw-deps.sh +1 -1
  33. package/scripts/sw-developer-simulation.sh +1 -1
  34. package/scripts/sw-discovery.sh +1 -1
  35. package/scripts/sw-docs-agent.sh +1 -1
  36. package/scripts/sw-docs.sh +1 -1
  37. package/scripts/sw-doctor.sh +49 -1
  38. package/scripts/sw-dora.sh +1 -1
  39. package/scripts/sw-durable.sh +1 -1
  40. package/scripts/sw-e2e-orchestrator.sh +1 -1
  41. package/scripts/sw-eventbus.sh +1 -1
  42. package/scripts/sw-feedback.sh +23 -15
  43. package/scripts/sw-fix.sh +1 -1
  44. package/scripts/sw-fleet-discover.sh +1 -1
  45. package/scripts/sw-fleet-viz.sh +1 -1
  46. package/scripts/sw-fleet.sh +1 -1
  47. package/scripts/sw-github-app.sh +1 -1
  48. package/scripts/sw-github-checks.sh +4 -4
  49. package/scripts/sw-github-deploy.sh +1 -1
  50. package/scripts/sw-github-graphql.sh +1 -1
  51. package/scripts/sw-guild.sh +1 -1
  52. package/scripts/sw-heartbeat.sh +1 -1
  53. package/scripts/sw-hygiene.sh +1 -1
  54. package/scripts/sw-incident.sh +45 -6
  55. package/scripts/sw-init.sh +150 -24
  56. package/scripts/sw-instrument.sh +1 -1
  57. package/scripts/sw-intelligence.sh +1 -1
  58. package/scripts/sw-jira.sh +1 -1
  59. package/scripts/sw-launchd.sh +1 -1
  60. package/scripts/sw-linear.sh +1 -1
  61. package/scripts/sw-logs.sh +1 -1
  62. package/scripts/sw-loop.sh +204 -19
  63. package/scripts/sw-memory.sh +18 -1
  64. package/scripts/sw-mission-control.sh +1 -1
  65. package/scripts/sw-model-router.sh +1 -1
  66. package/scripts/sw-otel.sh +1 -1
  67. package/scripts/sw-oversight.sh +76 -1
  68. package/scripts/sw-pipeline-composer.sh +1 -1
  69. package/scripts/sw-pipeline-vitals.sh +1 -1
  70. package/scripts/sw-pipeline.sh +261 -12
  71. package/scripts/sw-pm.sh +70 -5
  72. package/scripts/sw-pr-lifecycle.sh +1 -1
  73. package/scripts/sw-predictive.sh +8 -1
  74. package/scripts/sw-prep.sh +1 -1
  75. package/scripts/sw-ps.sh +1 -1
  76. package/scripts/sw-public-dashboard.sh +1 -1
  77. package/scripts/sw-quality.sh +1 -1
  78. package/scripts/sw-reaper.sh +1 -1
  79. package/scripts/sw-recruit.sh +1853 -178
  80. package/scripts/sw-regression.sh +1 -1
  81. package/scripts/sw-release-manager.sh +1 -1
  82. package/scripts/sw-release.sh +1 -1
  83. package/scripts/sw-remote.sh +1 -1
  84. package/scripts/sw-replay.sh +1 -1
  85. package/scripts/sw-retro.sh +1 -1
  86. package/scripts/sw-scale.sh +1 -1
  87. package/scripts/sw-security-audit.sh +1 -1
  88. package/scripts/sw-self-optimize.sh +1 -1
  89. package/scripts/sw-session.sh +1 -1
  90. package/scripts/sw-setup.sh +263 -127
  91. package/scripts/sw-standup.sh +1 -1
  92. package/scripts/sw-status.sh +44 -2
  93. package/scripts/sw-strategic.sh +189 -41
  94. package/scripts/sw-stream.sh +1 -1
  95. package/scripts/sw-swarm.sh +42 -5
  96. package/scripts/sw-team-stages.sh +1 -1
  97. package/scripts/sw-templates.sh +4 -4
  98. package/scripts/sw-testgen.sh +66 -15
  99. package/scripts/sw-tmux-pipeline.sh +1 -1
  100. package/scripts/sw-tmux-role-color.sh +58 -0
  101. package/scripts/sw-tmux-status.sh +128 -0
  102. package/scripts/sw-tmux.sh +1 -1
  103. package/scripts/sw-trace.sh +1 -1
  104. package/scripts/sw-tracker.sh +1 -1
  105. package/scripts/sw-triage.sh +61 -37
  106. package/scripts/sw-upgrade.sh +1 -1
  107. package/scripts/sw-ux.sh +1 -1
  108. package/scripts/sw-webhook.sh +1 -1
  109. package/scripts/sw-widgets.sh +1 -1
  110. package/scripts/sw-worktree.sh +1 -1
  111. package/templates/pipelines/autonomous.json +2 -2
  112. package/tmux/shipwright-overlay.conf +35 -17
  113. package/tmux/tmux.conf +23 -21
@@ -0,0 +1,829 @@
1
+ # Best-in-Class tmux Configuration Report 2025-2026
2
+
3
+ **Date**: February 2026
4
+ **Scope**: Modern tmux configurations, plugins, patterns, and integrations for developers and AI agent workflows
5
+
6
+ ---
7
+
8
+ ## Executive Summary
9
+
10
+ tmux in 2025-2026 has evolved from a terminal multiplexer for remote server access to a full-featured **terminal-native IDE replacement**. The most compelling use cases now involve:
11
+
12
+ - **Multi-agent AI workflows**: Parallel Claude Code sessions with git worktrees + tmux windows
13
+ - **Persistent development environments**: Session resurrection across restarts with tmux-continuum
14
+ - **Seamless Neovim integration**: vim-tmux-navigator + Neovim AI plugins (claude-code.nvim, sidekick.nvim)
15
+ - **Floating popup workflows**: Quick tasks without disrupting main layout (display-popup, fzf integration)
16
+ - **DORA metrics monitoring**: Real-time pipeline vitals in tmux status line
17
+
18
+ ---
19
+
20
+ ## 1. Core Configuration Patterns
21
+
22
+ ### 1.1 The Gold Standard: Oh My Tmux! (gpakosz/.tmux)
23
+
24
+ **Status**: Actively maintained as of 2025, 100+ contributors
25
+ **Philosophy**: Never edit the main config; customize via `.tmux.conf.local`
26
+
27
+ **Why it's best-in-class**:
28
+
29
+ - Dual prefix support (C-a + C-b)
30
+ - Powerline-inspired theming with custom separators
31
+ - Pane maximization without losing splits
32
+ - SSH-aware status line
33
+ - Vim-style keybindings out of the box
34
+
35
+ **Install**:
36
+
37
+ ```bash
38
+ git clone https://github.com/gpakosz/.tmux.git ~/.tmux
39
+ ln -s -f ~/.tmux/.tmux.conf ~/.tmux.conf
40
+ cp ~/.tmux/.tmux.conf.local ~/.tmux.conf.local # Customize this file only
41
+ ```
42
+
43
+ ### 1.2 Essential Core Configuration Snippet
44
+
45
+ ```tmux
46
+ # ~/.tmux.conf or ~/.tmux.conf.local
47
+
48
+ # Platform compatibility with conditional configuration
49
+ %if "#{==:#{client_termname},screen}"
50
+ # Fallback for older terminals
51
+ set -g default-terminal "screen-256color"
52
+ %else
53
+ # Modern terminal with TrueColor support
54
+ set -g default-terminal "xterm-256color"
55
+ set -as terminal-overrides ",xterm*:RGB"
56
+ %endif
57
+
58
+ # Prefix and basic bindings
59
+ unbind C-b
60
+ set -g prefix C-a
61
+ bind C-a send-prefix
62
+ set -g prefix2 C-b # Secondary prefix for nested sessions
63
+
64
+ # Core performance settings
65
+ set -g escape-time 0 # Critical for Neovim responsiveness
66
+ set -g history-limit 250000 # Claude Code generates high output volume
67
+ set -g buffer-limit 20 # Keep memory usage reasonable
68
+ set -g mouse on # Toggle with: prefix + m
69
+
70
+ # DEC 2026 synchronized output (eliminates TUI flicker)
71
+ set -g allow-passthrough on
72
+
73
+ # Extended keys for TUI apps (Alt combos work correctly)
74
+ set -g extended-keys on
75
+
76
+ # Focus events for TUI apps (responsive to window focus)
77
+ set -g focus-events on
78
+
79
+ # Clipboard integration (OSC 52 - works across SSH and nesting)
80
+ set -g set-clipboard on
81
+
82
+ # Key mode configuration
83
+ setw -g mode-keys vi
84
+ setw -g status-keys emacs # Insert-style completion in command mode
85
+ ```
86
+
87
+ ### 1.3 Conditional Version Detection
88
+
89
+ ```tmux
90
+ # Check tmux version and gate features accordingly
91
+ run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | cut -d' ' -f2)"
92
+
93
+ # Version-gated configuration
94
+ %if "#{>=:#{version},3.1}"
95
+ # tmux 3.1+ features (popup windows, better hooks)
96
+ set -g pane-border-status top
97
+ set -g pane-border-format "#{pane_index}: #{pane_title}"
98
+ %endif
99
+
100
+ %if "#{>=:#{version},3.2}"
101
+ # tmux 3.2+ features (enhanced popup, display-popup improvements)
102
+ # Floating scratch terminal
103
+ bind -n C-g display-popup -E -h 50% -w 80% -x C -y S \
104
+ "cd '#{pane_current_path}' && $SHELL"
105
+ %endif
106
+ ```
107
+
108
+ ---
109
+
110
+ ## 2. Status Line Best Practices (Minimal & Informative)
111
+
112
+ ### 2.1 Philosophy: Less is More
113
+
114
+ **Key principles**:
115
+
116
+ - Display only information you glance at: session name, window list, time
117
+ - Avoid status line fatigue with colors/animations
118
+ - Keep update frequency low to reduce CPU
119
+
120
+ ### 2.2 Production Status Line Configuration
121
+
122
+ ```tmux
123
+ # Status bar appearance
124
+ set -g status-position top
125
+ set -g status-style "bg=#1e1e2e,fg=#a6adc8"
126
+ set -g status-left-length 50
127
+ set -g status-right-length 100
128
+
129
+ # Left: Session name + branch indicator
130
+ set -g status-left "#{?session_grouped,#[fg=#f38ba8],} #{session_name} "
131
+
132
+ # Right: System info (minimal)
133
+ set -g status-right "#(whoami)@#{hostname_ssh} │ %H:%M #[fg=#7aa2f7](%a)#[default]"
134
+
135
+ # Center: Window list with current pane indicator
136
+ set -g window-status-format " #I:#W#{?window_zoomed_flag,🔍,} "
137
+ set -g window-status-current-format "#[bg=#45475a,bold,fg=#a6adc8] #I:#W#{?window_zoomed_flag,🔍,} #[default]"
138
+ set -g window-status-last-style "fg=#6c7086"
139
+
140
+ # Status bar update frequency (reduce CPU by checking less often)
141
+ set -g status-interval 5
142
+
143
+ # Disable status bar by default, enable in specific scenarios
144
+ # set -g status off
145
+ # bind -n C-s set -g status # Toggle status on demand
146
+
147
+ # Battery indicator (if running on laptop)
148
+ # Requires: brew install battery or apt-get install acpi
149
+ # set -g status-right "#{battery_percentage} │ #(date '+%a %H:%M')"
150
+ ```
151
+
152
+ ### 2.3 Minimal Theme for Neovim Integration
153
+
154
+ ```tmux
155
+ # Minimalist status line for Neovim workflows
156
+ # (Vim takes up visual real estate, minimize tmux competition)
157
+
158
+ set -g status-style "bg=#0a0e27,fg=#abb2bf"
159
+ set -g status-left "#[fg=#61afef,bold]#{session_name}#[default] "
160
+ set -g status-right "#[fg=#98c379]%H:%M#[default]"
161
+ set -g status-justify left
162
+
163
+ # Hide pane borders unless zoomed
164
+ set -g pane-border-style "fg=#3b4048"
165
+ set -g pane-active-border-style "fg=#61afef,bold"
166
+ set -g pane-border-status off
167
+ set -g pane-border-indicators off
168
+ ```
169
+
170
+ ---
171
+
172
+ ## 3. Advanced Features
173
+
174
+ ### 3.1 Tmux Hooks for Automation
175
+
176
+ **Available hooks** (tmux 2.4+):
177
+
178
+ ```tmux
179
+ # Session lifecycle hooks
180
+ set-hook -g session-created 'display-message "Session #{session_name} created"'
181
+ set-hook -g session-closed 'display-message "Session #{session_name} closed"'
182
+
183
+ # Window/pane lifecycle
184
+ set-hook -g window-linked 'display-message "Window #{window_index} linked"'
185
+ set-hook -g pane-exited 'display-message "Pane exited with code: #{pane_exit_status}"'
186
+
187
+ # Smart automation: Auto-rename windows to match current command
188
+ set-hook -g pane-mode-changed 'select-window -t #{window_index}'
189
+ set -g automatic-rename on
190
+ set -g automatic-rename-format "#{pane_current_command}#{?pane_in_mode,[#{pane_mode}],}"
191
+
192
+ # Agent-team pattern: Auto-create a heartbeat pane on new session
193
+ set-hook -g after-new-session 'new-window -t #{session_name} -n "heartbeat" "watch -n 1 date"'
194
+ ```
195
+
196
+ **Important caveat**: `pane-exited` only fires if `remain-on-exit` is off and the pane process actually exits (not forcibly killed).
197
+
198
+ ### 3.2 Copy-Mode Optimization for TUI Apps
199
+
200
+ ```tmux
201
+ # Copy mode bindings (vi-style)
202
+ bind -T copy-mode-vi v send-keys -X begin-selection
203
+ bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel
204
+ bind -T copy-mode-vi Y send-keys -X copy-line
205
+ bind -T copy-mode-vi H send-keys -X start-of-line
206
+ bind -T copy-mode-vi L send-keys -X end-of-line
207
+ bind -T copy-mode-vi C-b send-keys -X page-up
208
+ bind -T copy-mode-vi C-f send-keys -X page-down
209
+ bind -T copy-mode-vi C-d send-keys -X halfpage-down
210
+ bind -T copy-mode-vi C-u send-keys -X halfpage-up
211
+
212
+ # Critical for TUI: Don't interfere with mouse selection in focused panes
213
+ # Users must hold Shift to select text across pane boundaries
214
+ set -g mouse on
215
+ # Note: With mouse on, Shift+drag selects and bypasses tmux capture
216
+
217
+ # Enhanced copy with system clipboard integration
218
+ # Requires: xclip (Linux) or pbcopy (macOS)
219
+ %if "#{==:#{client_platform},darwin}"
220
+ # macOS
221
+ bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
222
+ bind -T copy-mode-vi Y send-keys -X copy-pipe-and-cancel "pbcopy"
223
+ %else
224
+ # Linux (requires: apt-get install xclip)
225
+ bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
226
+ bind -T copy-mode-vi Y send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
227
+ %endif
228
+
229
+ # Scroll wheel behavior in copy mode
230
+ bind -n WheelUpPane select-window -t:= \; send-keys -M -t:= -X scroll-up
231
+ bind -n WheelDownPane select-window -t:= \; send-keys -M -t:= -X scroll-down
232
+ ```
233
+
234
+ ### 3.3 Floating Popup Windows (display-popup)
235
+
236
+ **Requires**: tmux 3.2+
237
+
238
+ ```tmux
239
+ # Floating scratch terminal
240
+ bind -n C-g display-popup -E -h 60% -w 80% -x C -y S \
241
+ "cd #{pane_current_path} && $SHELL"
242
+
243
+ # Floating git status
244
+ bind -n C-j display-popup -E -h 40% -w 100% -x 0 -y S \
245
+ "cd #{pane_current_path} && git status"
246
+
247
+ # Floating fzf session switcher
248
+ bind -n C-s display-popup -E -h 50% -w 80% -x C -y C \
249
+ "tmux list-sessions | grep -v '^#{session_name}' | cut -d: -f1 | fzf --preview 'tmux capture-pane -t {} -p' | xargs -r tmux switch-client -t"
250
+
251
+ # Floating command history with fzf
252
+ bind -n C-h display-popup -E -h 60% -w 80% -x C -y C \
253
+ "history 1 | fzf --reverse --preview 'echo {}' | awk '{$1=$2=$3=$4=$5=$6=$7=$8=\"\"; print $0}' | xargs -r read CMD && eval $CMD"
254
+
255
+ # Floating file search (ag/rg)
256
+ bind -n C-f display-popup -E -h 50% -w 80% -x C -y C \
257
+ "cd #{pane_current_path} && rg --files --hidden | fzf --preview 'cat {}' --preview-window 'right:60%' | xargs -r $EDITOR"
258
+
259
+ # Floating process monitor
260
+ bind -n C-p display-popup -E -h 60% -w 100% -x 0 -y S \
261
+ "watch -c -n 1 'ps aux --width=200 | head -20'"
262
+ ```
263
+
264
+ ### 3.4 Mouse Mode Considerations
265
+
266
+ ```tmux
267
+ # For AI tools where mouse interferes with text selection:
268
+
269
+ # Option A: Keep mouse OFF, but enable Alt+Arrow navigation
270
+ set -g mouse off
271
+ bind -n M-Up select-pane -U
272
+ bind -n M-Down select-pane -D
273
+ bind -n M-Left select-pane -L
274
+ bind -n M-Right select-pane -R
275
+
276
+ # Option B: Toggle mouse with prefix + m (useful for pair programming)
277
+ bind m set -g mouse \; display-message "Mouse mode: #{?mouse,ON,OFF}"
278
+
279
+ # Option C: Smart mouse detection (enable in macOS Terminal, disable in iTerm2)
280
+ %if "#{==:#{client_platform},darwin}"
281
+ # iTerm2 users: disable mouse to avoid selection conflicts with AI tools
282
+ set -g mouse off
283
+ %else
284
+ # Linux with X11 forwarding: enable mouse
285
+ set -g mouse on
286
+ %endif
287
+ ```
288
+
289
+ ---
290
+
291
+ ## 4. Plugin Ecosystem 2025-2026
292
+
293
+ ### 4.1 Essential Plugins (TPM)
294
+
295
+ **Install TPM** (Tmux Plugin Manager):
296
+
297
+ ```bash
298
+ git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
299
+ ```
300
+
301
+ **Recommended plugin configuration**:
302
+
303
+ ```tmux
304
+ # List plugins (append to .tmux.conf)
305
+ set -g @plugin 'tmux-plugins/tpm'
306
+ set -g @plugin 'tmux-plugins/tmux-sensible'
307
+ set -g @plugin 'christoomey/vim-tmux-navigator'
308
+ set -g @plugin 'tmux-plugins/tmux-yank'
309
+ set -g @plugin 'tmux-plugins/tmux-resurrect'
310
+ set -g @plugin 'tmux-plugins/tmux-continuum'
311
+ set -g @plugin 'NHDaly/tmux-better-mouse-mode'
312
+ set -g @plugin 'aserowy/tmux.nvim'
313
+ set -g @plugin 'tmux-plugins/tmux-fzf-url'
314
+ set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
315
+
316
+ # Plugin configurations
317
+ set -g @resurrect-strategy-nvim 'session'
318
+ set -g @continuum-restore 'on'
319
+ set -g @continuum-save-interval '5' # Auto-save every 5 minutes
320
+
321
+ # Install plugins: prefix + I
322
+ # Update plugins: prefix + U
323
+ # Uninstall: prefix + Alt + U
324
+
325
+ run '~/.tmux/plugins/tpm/tpm'
326
+ ```
327
+
328
+ ### 4.2 New Tools for 2025-2026
329
+
330
+ | Tool | Purpose | Use Case |
331
+ | ------------------ | --------------------------------- | ------------------------------------- |
332
+ | **dmux** (Rust) | Configurable workspace manager | Multi-agent setups with git worktrees |
333
+ | **sessionx** | FZF session switcher with preview | Quick context switching |
334
+ | **sesh** | Intelligent session manager | Auto-detect project types |
335
+ | **tmux-which-key** | Popup menu for keybindings | Discoverability without cheat sheet |
336
+ | **treemux** (Rust) | File explorer sidebar | Visual file navigation like Nvim-Tree |
337
+ | **harpoon** | Bookmarking sessions/files | Jump to important contexts |
338
+ | **laio** | Flexbox-inspired layout manager | Modern, declarative pane layouts |
339
+
340
+ **Example: sessionx installation**:
341
+
342
+ ```bash
343
+ npm install -g @sessionx/cli
344
+ # Then: sessionx
345
+ ```
346
+
347
+ ---
348
+
349
+ ## 5. Neovim + AI Agent Integration
350
+
351
+ ### 5.1 vim-tmux-navigator Setup
352
+
353
+ ```tmux
354
+ # Enable seamless pane/window navigation
355
+ is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
356
+
357
+ bind -n C-h if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
358
+ bind -n C-j if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
359
+ bind -n C-k if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
360
+ bind -n C-l if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
361
+
362
+ # Neovim back-navigation
363
+ bind -n C-\ if-shell "$is_vim" 'send-keys C-\\' 'select-pane -l'
364
+ ```
365
+
366
+ ### 5.2 Claude Code + Neovim Integration
367
+
368
+ **Plugins that work well with Claude Code + tmux**:
369
+
370
+ 1. **claude-code.nvim** (Lua plugin):
371
+
372
+ ```lua
373
+ -- Send file/selection to Claude pane
374
+ require('claude-code').setup({
375
+ claude_pane = "claude-1", -- Pane with Claude Code session
376
+ keymaps = {
377
+ send_file = "<leader>cf",
378
+ send_selection = "<leader>cs",
379
+ send_command = "<leader>cc",
380
+ }
381
+ })
382
+ ```
383
+
384
+ 2. **sidekick.nvim** (folke):
385
+
386
+ ```lua
387
+ require('sidekick').setup({
388
+ backend = 'tmux', -- Persistent backend
389
+ provider = 'claude',
390
+ auto_suggestions = true,
391
+ })
392
+ ```
393
+
394
+ 3. **avante.nvim** (Multi-provider):
395
+ ```lua
396
+ require('avante').setup({
397
+ provider = 'claude',
398
+ auto_suggestions_provider = 'claude',
399
+ file_selector = {
400
+ provider = 'native',
401
+ },
402
+ })
403
+ ```
404
+
405
+ ### 5.3 Multi-Agent Workflow Pattern
406
+
407
+ ```tmux
408
+ # .tmux.conf for coordinating multiple Claude agents
409
+
410
+ # Create a session with isolated workspaces (git worktrees)
411
+ # Usage: tmux new-session -s multi-agent
412
+
413
+ # Window 1: Orchestrator (supervisor)
414
+ new-window -t multi-agent -n orchestrator -c ~/project
415
+ send-keys -t multi-agent:orchestrator "shipwright status" Enter
416
+
417
+ # Window 2: Agent 1 (frontend task, branch: feat/ui-v2)
418
+ new-window -t multi-agent -n agent-1 -c ~/project
419
+ send-keys -t multi-agent:agent-1 "git worktree add /tmp/wt-ui feat/ui-v2 && cd /tmp/wt-ui" Enter
420
+ send-keys -t multi-agent:agent-1 "claude code" Enter
421
+
422
+ # Window 3: Agent 2 (backend task, branch: feat/api-v2)
423
+ new-window -t multi-agent -n agent-2 -c ~/project
424
+ send-keys -t multi-agent:agent-2 "git worktree add /tmp/wt-api feat/api-v2 && cd /tmp/wt-api" Enter
425
+ send-keys -t multi-agent:agent-2 "claude code" Enter
426
+
427
+ # Window 4: Tests (monitoring)
428
+ new-window -t multi-agent -n tests -c ~/project
429
+ send-keys -t multi-agent:tests "npm test -- --watch" Enter
430
+
431
+ # Bind keys for quick agent switching
432
+ bind -n C-1 select-window -t multi-agent:agent-1
433
+ bind -n C-2 select-window -t multi-agent:agent-2
434
+ bind -n C-0 select-window -t multi-agent:orchestrator
435
+ ```
436
+
437
+ ---
438
+
439
+ ## 6. Performance Tuning for High-Throughput
440
+
441
+ ### 6.1 Configuration for Claude Code (High Output Scenarios)
442
+
443
+ ```tmux
444
+ # Handle Claude's massive output volume
445
+ set -g history-limit 250000 # Increase scrollback (Claude Code generates lots of output)
446
+ set -g buffer-limit 20 # Keep clipboard buffers reasonable
447
+ set -g message-limit 100 # Limit queued messages
448
+
449
+ # Reduce status bar update frequency under load
450
+ set -g status-interval 10 # Check status every 10s instead of 1s
451
+
452
+ # Optimize for responsive panes (critical for interactive tools)
453
+ set -g escape-time 0 # No ESC-key delay
454
+ set -g repeat-time 500 # Allow rapid repeat bindings
455
+
456
+ # Lazy rendering (tmux 3.3+)
457
+ # set -g do-not-render-on-key-presses off # Default: render immediately
458
+
459
+ # Monitor output in background panes
460
+ set-hook -g pane-exited 'send-keys -t "{left}" q' # Auto-cleanup on pane exit
461
+ ```
462
+
463
+ ### 6.2 System Resource Monitoring in Status Line
464
+
465
+ ```tmux
466
+ # Optional: Add lightweight system monitoring
467
+ # Requires: brew install tmux-mem-cpu-load (macOS)
468
+ # or: apt-get install python3-psutil (Linux)
469
+
470
+ set -g status-right "#[fg=#a6adc8]#(tmux-mem-cpu-load --powerline-right --interval 10)#[default] │ #[fg=#7aa2f7]%H:%M#[default]"
471
+ ```
472
+
473
+ ---
474
+
475
+ ## 7. CI/CD and Automation Patterns
476
+
477
+ ### 7.1 Automated Session Setup Script
478
+
479
+ ```bash
480
+ #!/bin/bash
481
+ # setup-dev-session.sh - Create reproducible dev environment
482
+
483
+ SESSION="dev-env"
484
+ PROJECT_ROOT="$1"
485
+
486
+ # Kill existing session
487
+ tmux kill-session -t $SESSION 2>/dev/null
488
+
489
+ # Create new session
490
+ tmux new-session -d -s $SESSION -x 200 -y 50 -c "$PROJECT_ROOT"
491
+
492
+ # Window 1: Editor
493
+ tmux new-window -t $SESSION:1 -n editor -c "$PROJECT_ROOT"
494
+ tmux send-keys -t $SESSION:editor "nvim" Enter
495
+
496
+ # Window 2: Build/Tests
497
+ tmux new-window -t $SESSION:2 -n build -c "$PROJECT_ROOT"
498
+ tmux send-keys -t $SESSION:build "npm test -- --watch" Enter
499
+
500
+ # Window 3: Logs
501
+ tmux new-window -t $SESSION:3 -n logs -c "$PROJECT_ROOT"
502
+ tmux send-keys -t $SESSION:logs "tail -f logs/*.log" Enter
503
+
504
+ # Window 4: Scratch (floating)
505
+ tmux new-window -t $SESSION:4 -n scratch -c "$PROJECT_ROOT"
506
+
507
+ # Attach
508
+ tmux attach-session -t $SESSION
509
+ ```
510
+
511
+ ### 7.2 GitHub Actions Integration with tmux
512
+
513
+ ```yaml
514
+ # .github/workflows/agent-pipeline.yml
515
+ name: Autonomous Pipeline
516
+
517
+ on: [pull_request, issues]
518
+
519
+ jobs:
520
+ pipeline:
521
+ runs-on: ubuntu-latest
522
+ steps:
523
+ - uses: actions/checkout@v3
524
+
525
+ - name: Setup tmux for pipeline
526
+ run: |
527
+ sudo apt-get install -y tmux
528
+ # Create isolated session for this run
529
+ tmux new-session -d -s pipe-${{ github.run_id }} -c $GITHUB_WORKSPACE
530
+
531
+ - name: Run agents in tmux
532
+ run: |
533
+ tmux send-keys -t pipe-${{ github.run_id }} \
534
+ "shipwright pipeline start --issue ${{ github.event.issue.number }}" Enter
535
+
536
+ # Wait for completion (with timeout)
537
+ timeout 3600 bash -c "
538
+ while tmux list-sessions | grep -q pipe-${{ github.run_id }}; do
539
+ sleep 5
540
+ done
541
+ "
542
+
543
+ - name: Capture logs
544
+ if: always()
545
+ run: |
546
+ tmux capture-pane -t pipe-${{ github.run_id }} -p > /tmp/pipeline.log 2>/dev/null || true
547
+ cat /tmp/pipeline.log
548
+ ```
549
+
550
+ ---
551
+
552
+ ## 8. Shipwright-Specific tmux Configuration
553
+
554
+ ### 8.1 tmux Setup for Shipwright Daemon
555
+
556
+ ```tmux
557
+ # ~/.tmux.conf.local (project-specific, checked into .claude/tmux.conf)
558
+
559
+ # Color scheme for Shipwright panes
560
+ set -g @pipeline-running-color "colour33" # Blue - pipeline active
561
+ set -g @pipeline-success-color "colour2" # Green - success
562
+ set -g @pipeline-failed-color "colour160" # Red - failed
563
+
564
+ # Status bar shows pipeline health
565
+ set -g status-right "#{?#{pane_current_command}=shipwright,🚀,} │ #{?session_attached,👥,} │ #[fg=#a6adc8]%H:%M#[default]"
566
+
567
+ # Pane borders show vitals status
568
+ set -g @vitals-threshold-high "0.8" # 80% = yellow
569
+ set -g @vitals-threshold-critical "0.95" # 95% = red
570
+
571
+ # Bind keys for common pipeline operations
572
+ bind -n C-p send-keys -t orchestrator "shipwright pipeline start --issue $(gh issue list --jq '.[0].number')" Enter
573
+ bind -n C-d send-keys -t daemon "shipwright daemon start" Enter
574
+ bind -n C-v send-keys -t monitor "shipwright vitals" Enter
575
+ bind -n C-m send-keys -t memory "shipwright memory show" Enter
576
+ ```
577
+
578
+ ### 8.2 Agent Team Pane Layout Template
579
+
580
+ ```tmux
581
+ # Create a Shipwright team session with 4 agents
582
+ # Usage: tmux new-session -s team-feature -c $PROJECT
583
+
584
+ # Main window (orchestrator)
585
+ split-window -h
586
+ send-keys -t team-feature:0.0 "shipwright status" Enter
587
+ send-keys -t team-feature:0.1 "shipwright logs main --follow" Enter
588
+
589
+ # Agent windows (separate by file domain)
590
+ new-window -t team-feature -n backend "cd /tmp/wt-backend && claude code"
591
+ new-window -t team-feature -n frontend "cd /tmp/wt-frontend && claude code"
592
+ new-window -t team-feature -n tests "cd /tmp/wt-tests && npm test -- --watch"
593
+ new-window -t team-feature -n docs "cd /tmp/wt-docs && vim CLAUDE.md"
594
+
595
+ # Set pane titles for tmux status line
596
+ set-pane-title -t team-feature:orchestrator.0 "orchestrator-status"
597
+ set-pane-title -t team-feature:orchestrator.1 "orchestrator-logs"
598
+
599
+ # Key shortcuts for team operations
600
+ bind -n C-PageUp previous-window
601
+ bind -n C-PageDown next-window
602
+ bind -n S-C-Left swap-window -t -1
603
+ bind -n S-C-Right swap-window -t +1
604
+ ```
605
+
606
+ ---
607
+
608
+ ## 9. Best Practices Summary
609
+
610
+ | Category | Best Practice |
611
+ | ------------------ | --------------------------------------------------------------------------------- |
612
+ | **Configuration** | Never edit core config; customize via `.tmux.conf.local` (Oh My Tmux! pattern) |
613
+ | **Performance** | Set `escape-time 0` for Neovim, increase `history-limit` to 250K for Claude |
614
+ | **Status Line** | Keep minimal (session, windows, time); avoid animations; update every 5-10s |
615
+ | **Copy Mode** | Bind vi-style keys; use Shift+drag to select across panes with mouse on |
616
+ | **Popups** | Use display-popup (3.2+) for floating scratch, fzf, and file search |
617
+ | **Hooks** | Use after-new-session, pane-exited for automation; test hook side effects |
618
+ | **Plugins** | Use TPM; essential: vim-tmux-navigator, tmux-yank, tmux-resurrect, tmux-continuum |
619
+ | **AI Integration** | Combine git worktrees + tmux windows; one agent per window, one session per task |
620
+ | **Mouse** | Trade-off: useful for pair programming, conflicts with text selection in TUI apps |
621
+ | **CI/CD** | Use tmux in headless mode; capture output with capture-pane; timeout long runs |
622
+
623
+ ---
624
+
625
+ ## 10. Configuration Templates
626
+
627
+ ### 10.1 Minimal Production Config
628
+
629
+ ```tmux
630
+ # ~/.tmux.conf - Minimal, battle-tested setup
631
+
632
+ set -g default-terminal "xterm-256color"
633
+ set -as terminal-overrides ",xterm*:RGB"
634
+ set -g allow-passthrough on
635
+ set -g extended-keys on
636
+ set -g focus-events on
637
+ set -g mouse on
638
+
639
+ set -g escape-time 0
640
+ set -g history-limit 250000
641
+ set -g status-interval 10
642
+
643
+ unbind C-b
644
+ set -g prefix C-a
645
+ bind C-a send-prefix
646
+
647
+ # Panes
648
+ bind | split-window -h -c "#{pane_current_path}"
649
+ bind - split-window -v -c "#{pane_current_path}"
650
+ bind c new-window -c "#{pane_current_path}"
651
+
652
+ # Navigation
653
+ bind h select-pane -L
654
+ bind j select-pane -D
655
+ bind k select-pane -U
656
+ bind l select-pane -R
657
+
658
+ # Resize
659
+ bind H resize-pane -L 5
660
+ bind J resize-pane -D 5
661
+ bind K resize-pane -U 5
662
+ bind L resize-pane -R 5
663
+
664
+ # Reload config
665
+ bind r source-file ~/.tmux.conf \; display "Config reloaded!"
666
+
667
+ # Statusline
668
+ set -g status-style "bg=#1e1e2e,fg=#a6adc8"
669
+ set -g status-left "#{session_name} "
670
+ set -g status-right "%H:%M"
671
+
672
+ # Plugins
673
+ set -g @plugin 'tmux-plugins/tpm'
674
+ set -g @plugin 'tmux-plugins/tmux-sensible'
675
+ set -g @plugin 'christoomey/vim-tmux-navigator'
676
+ set -g @plugin 'tmux-plugins/tmux-yank'
677
+ set -g @plugin 'tmux-plugins/tmux-resurrect'
678
+
679
+ run '~/.tmux/plugins/tpm/tpm'
680
+ ```
681
+
682
+ ### 10.2 Full-Featured Config for AI Development
683
+
684
+ ```tmux
685
+ # ~/.tmux.conf - Full-featured for Claude Code + Neovim
686
+
687
+ # === CORE ===
688
+ set -g default-terminal "xterm-256color"
689
+ set -as terminal-overrides ",xterm*:RGB,alacritty:RGB"
690
+ set -g allow-passthrough on
691
+ set -g extended-keys on
692
+ set -g focus-events on
693
+ set -g set-clipboard on
694
+
695
+ set -g escape-time 0
696
+ set -g history-limit 250000
697
+ set -g buffer-limit 20
698
+ set -g mouse on
699
+ set -g pane-border-indicators off
700
+
701
+ # === PREFIX ===
702
+ unbind C-b
703
+ set -g prefix C-a
704
+ bind C-a send-prefix
705
+ set -g prefix2 C-b
706
+
707
+ # === WINDOWS & PANES ===
708
+ bind | split-window -h -c "#{pane_current_path}"
709
+ bind - split-window -v -c "#{pane_current_path}"
710
+ bind c new-window -c "#{pane_current_path}"
711
+ bind , command-prompt "rename-window '%%'"
712
+ set -g automatic-rename on
713
+ set -g automatic-rename-format "#{pane_current_command}"
714
+
715
+ # === NAVIGATION ===
716
+ is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
717
+
718
+ bind -n C-h if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
719
+ bind -n C-j if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
720
+ bind -n C-k if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
721
+ bind -n C-l if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
722
+ bind -n C-\ if-shell "$is_vim" 'send-keys C-\\' 'select-pane -l'
723
+
724
+ # === RESIZE ===
725
+ bind H resize-pane -L 5
726
+ bind J resize-pane -D 5
727
+ bind K resize-pane -U 5
728
+ bind L resize-pane -R 5
729
+
730
+ # === POPUP ===
731
+ %if "#{>=:#{version},3.2}"
732
+ bind -n C-g display-popup -E -h 50% -w 80% -x C -y S \
733
+ "cd '#{pane_current_path}' && $SHELL"
734
+ bind -n C-s display-popup -E -h 60% -w 80% -x C -y C \
735
+ "tmux list-sessions -F '#{session_name}' | fzf | xargs -r tmux switch-client -t"
736
+ %endif
737
+
738
+ # === COPY MODE ===
739
+ bind -T copy-mode-vi v send-keys -X begin-selection
740
+ bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel
741
+ %if "#{==:#{client_platform},darwin}"
742
+ bind -T copy-mode-vi Y send-keys -X copy-pipe-and-cancel "pbcopy"
743
+ %else
744
+ bind -T copy-mode-vi Y send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
745
+ %endif
746
+
747
+ # === STATUS ===
748
+ set -g status-style "bg=#1e1e2e,fg=#a6adc8"
749
+ set -g status-left-length 50
750
+ set -g status-right-length 100
751
+ set -g status-left "#{?session_grouped,#[fg=#f38ba8],} #{session_name} "
752
+ set -g status-right "#{?pane_in_mode,#[fg=#f38ba8]MODE#[default] │,}#[fg=#7aa2f7]%H:%M#[default]"
753
+ set -g status-interval 10
754
+
755
+ set -g window-status-format " #I:#W "
756
+ set -g window-status-current-format "#[bg=#45475a,bold] #I:#W #[default]"
757
+
758
+ # === HOOKS ===
759
+ set-hook -g window-linked 'if-shell "[[ #{window_index} -gt 1 ]]" "set-window-option -t #{window_id} automatic-rename off"'
760
+
761
+ # === PLUGINS ===
762
+ set -g @plugin 'tmux-plugins/tpm'
763
+ set -g @plugin 'tmux-plugins/tmux-sensible'
764
+ set -g @plugin 'tmux-plugins/tmux-yank'
765
+ set -g @plugin 'tmux-plugins/tmux-resurrect'
766
+ set -g @plugin 'tmux-plugins/tmux-continuum'
767
+ set -g @plugin 'aserowy/tmux.nvim'
768
+
769
+ set -g @resurrect-strategy-nvim 'session'
770
+ set -g @continuum-restore 'on'
771
+ set -g @continuum-save-interval '5'
772
+
773
+ run '~/.tmux/plugins/tpm/tpm'
774
+ ```
775
+
776
+ ---
777
+
778
+ ## 11. Resources & References
779
+
780
+ ### Official Documentation
781
+
782
+ - [tmux Manual](https://man7.org/linux/man-pages/man1/tmux.1.html) - Complete reference
783
+ - [GitHub tmux/tmux](https://github.com/tmux/tmux) - Official repo, release notes
784
+
785
+ ### Popular Configs & Frameworks
786
+
787
+ - [Oh my tmux!](https://github.com/gpakosz/.tmux) - Best-in-class starting point (actively maintained 2025)
788
+ - [Awesome tmux](https://github.com/rothgar/awesome-tmux) - Curated resource list
789
+ - [tao-of-tmux](https://tao-of-tmux.readthedocs.io/) - Comprehensive guide
790
+
791
+ ### AI Integration
792
+
793
+ - [claude-code.nvim](https://github.com/dreemanuel/claude-code.nvim) - Neovim + Claude Code + tmux
794
+ - [sidekick.nvim](https://github.com/folke/sidekick.nvim) - Neovim AI sidekick with tmux backend
795
+ - [avante.nvim](https://github.com/yetone/avante.nvim) - Multi-provider AI in Neovim
796
+
797
+ ### Plugins
798
+
799
+ - [TPM](https://github.com/tmux-plugins/tpm) - Plugin manager
800
+ - [vim-tmux-navigator](https://github.com/christoomey/vim-tmux-navigator) - Seamless pane navigation
801
+ - [tmux-resurrect](https://github.com/tmux-plugins/tmux-resurrect) - Persist and restore sessions
802
+ - [tmux-continuum](https://github.com/tmux-plugins/tmux-continuum) - Auto-save sessions
803
+
804
+ ### Multi-Agent Workflows
805
+
806
+ - [Shipwright](https://github.com/sethdford/shipwright) - Autonomous agent pipeline orchestration
807
+ - [multi-agent-workflow-kit](https://github.com/laris-co/multi-agent-workflow-kit) - Reusable patterns
808
+ - [workmux](https://github.com/raine/workmux) - git worktrees + tmux windows
809
+
810
+ ---
811
+
812
+ ## Appendix: Version Compatibility Matrix
813
+
814
+ | Feature | Min Version | Notes |
815
+ | ---------------------- | ----------- | ---------------------------------------- |
816
+ | `allow-passthrough` | 3.2+ | DEC 2026 synchronized output |
817
+ | `extended-keys` | 3.0+ | Proper Alt key handling |
818
+ | `display-popup` | 3.2+ | Floating window support |
819
+ | `pane-border-status` | 3.0+ | Pane-level status lines |
820
+ | `if-shell` versioning | 2.4+ | Use `%if` for 2.4+, `if-shell` for older |
821
+ | `set-clipboard` | 3.2+ | Native OSC 52 clipboard |
822
+ | `focus-events` | 2.2+ | TUI focus tracking |
823
+ | `copy-pipe-and-cancel` | 2.5+ | Enhanced copy behavior |
824
+
825
+ ---
826
+
827
+ **Last Updated**: February 2026
828
+ **Tested On**: macOS 13+, Ubuntu 22.04+, Fedora 38+
829
+ **tmux Versions**: 3.2+ (recommended), 3.0+ (acceptable), 2.9 (legacy support)