harness/claude/skills/zellij-subagent/SKILL.md
This skill should be used when the user asks to "launch a subagent in zellij", "run claude in a new pane", "open agent in zellij", "parallel agents in zellij", "zellij pane for claude", or wants to spawn Claude Code instances in separate Zellij panes/tabs for parallel work.
npx skillsauth add popoffvg/dotfiles zellij-subagentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Launch Claude Code subagent instances in separate Zellij panes for parallel, visible work. Each agent runs in its own pane with full terminal output, unlike background Agent tool calls which hide intermediate work.
Verify inside a Zellij session before launching:
# Returns session name if inside zellij, empty otherwise
echo "$ZELLIJ_SESSION_NAME"
If not inside Zellij, fall back to the standard Agent tool.
zellij run -f -n "agent: <task-label>" --cwd "<workdir>" -- \
claude -p --dangerously-skip-permissions "<prompt>"
# Right split (side-by-side)
zellij run -d right -n "agent: <task-label>" --cwd "<workdir>" -- \
claude -p --dangerously-skip-permissions "<prompt>"
# Down split (stacked)
zellij run -d down -n "agent: <task-label>" --cwd "<workdir>" -- \
claude -p --dangerously-skip-permissions "<prompt>"
zellij action new-tab -n "agent: <task-label>" --cwd "<workdir>" -- \
claude -p --dangerously-skip-permissions "<prompt>"
zellij run -i -n "agent: <task-label>" --cwd "<workdir>" -- \
claude -p --dangerously-skip-permissions "<prompt>"
Break work into independent subtasks. Each subtask becomes one pane.
| Agents | Strategy | Flag |
|--------|----------|------|
| 1 | In-place or floating | -i or -f |
| 2-3 | Directional splits | -d right / -d down |
| 4+ | Separate tabs or floating | new-tab or -f |
Each agent prompt must be self-contained — include all context the agent needs:
--allowedTools to restrict tool access if needed)Run all zellij run commands. Use --close-on-exit (-c) to auto-close panes when done, or omit it to keep output visible for review.
After agents finish, read their output files or check git status for changes.
| Flag | Purpose |
|------|---------|
| -p / --print | Non-interactive mode, print and exit |
| --dangerously-skip-permissions | Skip permission prompts (use in trusted dirs only) |
| --allowedTools "Tool1 Tool2" | Restrict available tools |
| --model sonnet | Use a faster/cheaper model for simple tasks |
| --max-budget-usd 0.50 | Cap spending per agent |
| --output-format json | Structured output for programmatic consumption |
| --json-schema '{...}' | Enforce output schema |
| -w / --worktree | Isolate agent in a git worktree |
# Launch 3 research agents in floating panes
for topic in "auth flow" "database schema" "API endpoints"; do
zellij run -f -n "research: $topic" -c -- \
claude -p "Analyze the $topic in this codebase. Output a summary to /tmp/research-${topic// /-}.md"
done
# Left pane: implement
zellij run -d right -n "implement" -- \
claude -p --dangerously-skip-permissions "Implement feature X in src/handler.go"
# Right pane: write tests (after implementation)
zellij run -d right -n "test" -s -- \
claude -p --dangerously-skip-permissions "Write tests for feature X in src/handler_test.go"
The -s (start-suspended) flag on the test agent lets the user trigger it manually after implementation finishes.
zellij run -f -n "agent: refactor" -c -- \
claude -p -w "refactor-branch" --dangerously-skip-permissions \
"Refactor the auth module to use interfaces"
Each agent gets its own git worktree — no conflicts between parallel changes.
$ZELLIJ_SESSION_NAME first. If empty, use standard Agent tool or suggest the user starts Zellij.--max-panes or close existing panes.-c, the pane stays open showing the error. Review pane output manually.references/layouts.md — Custom Zellij layout templates for multi-agent workflowstools
Improve a whole CLAUDE.local.md — the private, per-project rules captured from user corrections. Wraps each conditional rule in a <task-relevant> block so it only surfaces for matching work, merges duplicates, generalizes one-off facts, drops stale entries, and routes raw project facts to engram. Use when the user says "improve claude.local", "clean up the local rules", "claude.local is bloated", or after the Stop hook has appended many rules.
testing
WM pipeline and conventions shared across all phases. Agents must read this before spec, impl, or verify work.
development
One entry point for spec writing, implementation, and bug fixing. Default is new (write spec → grill loop → produce notes → author TODO bodies). Other subcommands: verify (audit), revise (sync to shipped), prototype (settle a decision), code-map (diagram), impl (execute one TODO), fix (analyze cause, correct thoughts, fix behavior), help (this page). Invoke as /code <subcommand>.
development
Red-Green-Refactor cycle for bug fixes. Before fixing a bug, first write a failing test that reproduces it (Red), then make the minimal change to pass (Green), then clean up the code (Refactor). Use on any bug fix, error correction, failing test repair, or when user says "fix this bug".