Skip to content
Back to skills

Cleanup Panes

ASecurity

Clean up tmux panes. Use when user wants to close/kill all other panes, clean up tmux window, or reset pane layout.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
designbash

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill cleanup-panes --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cleanup Panes?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cleanup Panes
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-cleanup-panes/badge)](https://www.skillsdirectory.com/skills/david-li0406-cleanup-panes)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cleanup-panes
description: Clean up tmux panes. Use when user wants to close/kill all other panes, clean up tmux window, or reset pane layout.
---

# Cleanup Panes Skill

## Overview

Closes all tmux panes in the current window except the one you're in.

## Trigger

User invokes `/cleanup-panes` or asks to clean up/close other panes.

## Instructions

Execute this bash script:

```bash
#!/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
```

## Important Notes

- Only affects the current tmux window
- Preserves the pane you're currently in
- Safe to run even if there are no other panes

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…