# Zellij Tab Pane

> |

- **Type:** Skill
- **Install:** `agentstack add skill-dapi-claude-code-marketplace-zellij-tab-pane`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [dapi](https://agentstack.voostack.com/s/dapi)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [dapi](https://github.com/dapi)
- **Source:** https://github.com/dapi/claude-code-marketplace/tree/master/zellij-workflow/skills/zellij-tab-pane

## Install

```sh
agentstack add skill-dapi-claude-code-marketplace-zellij-tab-pane
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Zellij Tab/Pane Skill

Open a tab or pane in zellij -- empty, with a shell command, with a Claude session, or with a GitHub issue.

## Decision Tree

```
Step 1: Container
  "pane"/"panel"/"панель" -> PANE
  "tab"/"вкладка"/default  -> TAB

Step 2: Mode
  nothing to run              -> A (empty)
  shell command               -> B (command)
  Claude prompt/plan/task     -> C (claude session)
  GitHub issue (#N / URL)     -> D (issue dev via start-issue)
```

## Mode A: Empty Tab/Pane

User just wants a new tab or pane, nothing to run.

**Tab name:** user-specified or `shell-HH:MM` (e.g. `shell-14:35`).

### TAB

```bash
timeout 5 zellij action new-tab --name "$TAB_NAME" || {
  _rc=$?
  echo "Command failed. Diagnosing..."
  if [ -z "$ZELLIJ" ]; then echo "Not in zellij session"
  elif [ $_rc -eq 124 ]; then echo "Timed out -- zellij may be hanging"
  else echo "Unknown error (exit code: $_rc)"
  fi
  exit $_rc
}
```

### PANE

```bash
timeout 5 zellij action new-pane || {
  _rc=$?
  echo "Command failed. Diagnosing..."
  if [ -z "$ZELLIJ" ]; then echo "Not in zellij session"
  elif [ $_rc -eq 124 ]; then echo "Timed out -- zellij may be hanging"
  else echo "Unknown error (exit code: $_rc)"
  fi
  exit $_rc
}
```

## Mode B: Command in Tab/Pane

User wants to run a shell command (npm test, make build, etc.) in a new tab or pane.

**Tab name:** derived from command (e.g. `npm-test`, `make-build`). Max 20 chars.

### TAB

```bash
TAB_NAME=""

timeout 5 zellij action new-tab --name "$TAB_NAME" -- $CMD || {
  _rc=$?
  echo "Command failed. Diagnosing..."
  if [ -z "$ZELLIJ" ]; then echo "Not in zellij session"
  elif [ $_rc -eq 124 ]; then echo "Timed out -- zellij may be hanging"
  else echo "Unknown error (exit code: $_rc)"
  fi
  exit $_rc
}
```

### PANE

```bash
timeout 5 zellij run -- $CMD || {
  _rc=$?
  echo "Command failed. Diagnosing..."
  if [ -z "$ZELLIJ" ]; then echo "Not in zellij session"
  elif [ $_rc -eq 124 ]; then echo "Timed out -- zellij may be hanging"
  else echo "Unknown error (exit code: $_rc)"
  fi
  exit $_rc
}
```

## Mode C: Claude Session in Tab/Pane

User wants an interactive Claude Code session with instructions/plan/task.

**Tab name:** auto-generated from context (1-2 words, max 20 chars):
- Has issue reference -> `#123`
- Has plan file -> `plan-audit`
- General task -> `refactor`, `fix-tests`
- Fallback -> `claude-HH:MM`

### Step 1: Write bash launch script

```bash
SCRIPT=$(mktemp /tmp/claude-tab-XXXXXX.sh)
cat > "$SCRIPT" '
PROMPT=''
clear
echo "Launching claude with prompt: $PROMPT"
echo ""
exec claude --dangerously-skip-permissions "$PROMPT"
SCRIPT_EOF
chmod +x "$SCRIPT"
```

**Why a script:** Prompts can be multi-line with quotes and special characters; a heredoc in a temp script avoids complex escaping in command arguments.

### Step 2: Launch

#### TAB

```bash
TAB_NAME=""

timeout 5 zellij action new-tab --name "$TAB_NAME" -- bash "$SCRIPT" || {
  _rc=$?
  echo "Command failed. Diagnosing..."
  if [ -z "$ZELLIJ" ]; then echo "Not in zellij session"
  elif [ $_rc -eq 124 ]; then echo "Timed out -- zellij may be hanging"
  elif ! command -v claude &>/dev/null; then echo "claude not found in PATH"
  else echo "Unknown error (exit code: $_rc)"
  fi
  exit $_rc
}
```

#### PANE

```bash
timeout 5 zellij run -- bash "$SCRIPT" || {
  _rc=$?
  echo "Command failed. Diagnosing..."
  if [ -z "$ZELLIJ" ]; then echo "Not in zellij session"
  elif [ $_rc -eq 124 ]; then echo "Timed out -- zellij may be hanging"
  elif ! command -v claude &>/dev/null; then echo "claude not found in PATH"
  else echo "Unknown error (exit code: $_rc)"
  fi
  exit $_rc
}
```

## Mode D: Issue Development in Tab/Pane

User wants to start development on a GitHub issue. Recognized when request contains an issue reference (number, #number, or GitHub URL).

**Tab name:** always `#NUMBER`.

### Issue Number Parsing

```bash
parse_issue_number() {
  local arg="$1"
  if [[ "$arg" =~ github\.com/.*/issues/([0-9]+) ]]; then
    echo "${BASH_REMATCH[1]}"
  elif [[ "$arg" =~ ^#?([0-9]+)$ ]]; then
    echo "${BASH_REMATCH[1]}"
  else
    echo ""
  fi
}
```

### Issue Argument Format

| Format | Example | Result |
|--------|---------|--------|
| Number | `123` | Issue #123 |
| With hash | `#123` | Issue #123 |
| URL | `https://github.com/owner/repo/issues/123` | Issue #123 |

### TAB

```bash
ISSUE_NUMBER=$(parse_issue_number "$ARG")

timeout 5 zellij action new-tab --name "#${ISSUE_NUMBER}" -- start-issue $ISSUE_NUMBER || {
  _rc=$?
  echo "Command failed. Diagnosing..."
  if [ -z "$ZELLIJ" ]; then echo "Not in zellij session"
  elif [ $_rc -eq 124 ]; then echo "Timed out -- zellij may be hanging"
  elif ! command -v start-issue &>/dev/null; then echo "start-issue not found in PATH"
  else echo "Unknown error (exit code: $_rc)"
  fi
  exit $_rc
}
```

### PANE

```bash
timeout 5 zellij run -- start-issue $ISSUE_NUMBER || {
  _rc=$?
  echo "Command failed. Diagnosing..."
  if [ -z "$ZELLIJ" ]; then echo "Not in zellij session"
  elif [ $_rc -eq 124 ]; then echo "Timed out -- zellij may be hanging"
  elif ! command -v start-issue &>/dev/null; then echo "start-issue not found in PATH"
  else echo "Unknown error (exit code: $_rc)"
  fi
  exit $_rc
}
```

## Examples

### Example 1: Empty tab

**User:** "open a new zellij tab"

```bash
timeout 5 zellij action new-tab --name "shell-14:35"
```

### Example 2: Command in pane

**User:** "run npm test in a pane"

```bash
timeout 5 zellij run -- npm test
```

### Example 3: Command in tab

**User:** "run make build in new tab"

```bash
timeout 5 zellij action new-tab --name "make-build" -- make build
```

### Example 4: Claude session in tab

**User:** "execute the plan from docs/plans/audit.md in new tab"

```bash
SCRIPT=$(mktemp /tmp/claude-tab-XXXXXX.sh)
cat > "$SCRIPT"  "$SCRIPT" << 'SCRIPT_EOF'
#!/bin/bash
cd '/home/danil/code/project'
PROMPT='Refactor the auth module: extract JWT validation into separate service'
clear
echo "Launching claude with prompt: $PROMPT"
echo ""
exec claude --dangerously-skip-permissions "$PROMPT"
SCRIPT_EOF
chmod +x "$SCRIPT"

timeout 5 zellij run -- bash "$SCRIPT"
```

### Example 6: Issue in tab

**User:** "start issue #45 in a new tab"

```bash
timeout 5 zellij action new-tab --name "#45" -- start-issue 45
```

### Example 7: Issue URL in pane

**User:** "start https://github.com/org/repo/issues/123 in a pane"

```bash
timeout 5 zellij run -- start-issue https://github.com/org/repo/issues/123
```

## Dependencies

- **zellij** -- terminal multiplexer (must be running)
- **claude** -- Claude Code CLI (for Mode C only)
- **start-issue** -- issue development command (for Mode D only)

## Errors

| Error | Cause | Solution |
|-------|-------|----------|
| `Timed out` | zellij hanging (exit code 124) | Restart zellij |
| `Not in zellij session` | Running outside zellij | Start zellij first |
| `claude not found` | Claude CLI not in PATH | Install Claude Code |
| `start-issue not found` | start-issue not in PATH | Install or add to PATH |
| `Invalid issue format` | Bad argument | Use number, #number, or URL |
| Script not created | /tmp not writable | Check disk space |

## Important

- Skill works **only inside zellij session**
- TAB modes use `new-tab -- CMD` (atomic, no race conditions)
- PANE modes use `zellij run -- CMD`
- For Mode C, session is **interactive** (not -p print mode) -- remains a working chat

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [dapi](https://github.com/dapi)
- **Source:** [dapi/claude-code-marketplace](https://github.com/dapi/claude-code-marketplace)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-dapi-claude-code-marketplace-zellij-tab-pane
- Seller: https://agentstack.voostack.com/s/dapi
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
