This skill closes all tmux panes in the current window, keeping your active pane intact and restoring a clean layout.
npx playbooks add skill trentshaines/dotfiles --skill trent-cleanup-panes
Closes all tmux panes in the current window except the one you're in.
User invokes /cleanup-panes or asks to clean up/close other panes.
Execute this bash script:
#!/bin/bash
ORIGINAL_PANE=$(tmux display-message -p '#{pane_id}')
echo "Keeping pane: $ORIGINAL_PANE"
# Get all panes except original, then kill each
PANES_TO_KILL=$(tmux list-panes -F '#{pane_id}' | grep -v "^${ORIGINAL_PANE}$")
if [ -z "$PANES_TO_KILL" ]; then
echo "No other panes to close."
else
COUNT=0
while IFS= read -r PANE; do
if [ -n "$PANE" ]; then
tmux kill-pane -t "$PANE" 2>/dev/null && ((COUNT++))
fi
done <<< "$PANES_TO_KILL"
echo "Closed $COUNT panes. Only current pane remains."
fi
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.