MCPInstall

wezterm

Manage WezTerm mux servers for AI agent swarms on high-RAM servers (512GB+). Use when wezterm mux unresponsive, agent sessions need rescue, tuning scrollback, or configuring persistent remote sessions.

Installs
65
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations --skill wezterm
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads wezterm automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

<!-- TOC: Quick Diagnosis | The Problem | Performance Tuning | Emergency Rescue | Mux Operations | Persistent Sessions | CLI Reference | Maintenance -->

WezTerm — High-RAM Agent Swarm Management

Core Principle: WezTerm mux replaces tmux. Leverage massive RAM (512GB+) for agent swarms. Never nest multiplexers.


Quick Diagnosis

# One-liner status
echo "Mux: $(ps aux | grep -c '[w]ezterm-mux') procs | $(wezterm cli list --format json 2>/dev/null | jq length) panes | RSS: $(ps -eo rss,args | grep '[w]ezterm-mux' | awk '{sum+=$1} END {printf "%.1fGB", sum/1024/1024}')"

# Is mux running?
ps aux | grep wezterm-mux | grep -v grep

# Memory usage
ps -eo pid,rss,args | grep wezterm-mux | awk '{printf "%.1fGB\n", $2/1024/1024}'

# Recent logs
tail -20 /run/user/$(id -u)/wezterm/wezterm-mux-server-log-*.txt

# Connection test
wezterm cli list --format json | jq length

# Socket status
ls -la /run/user/$(id -u)/wezterm/sock

The Agent Swarm Problem

When running 20+ AI agents (Claude Code, Codex, Gemini CLI), each agent produces continuous output, runs for hours, spawns subprocesses, and operates in parallel. This overwhelms WezTerm's defaults.

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                          THE FAILURE CASCADE                                  ┃
┃                                                                               ┃
┃  1. Output buffer fills        →  parser falls behind                         ┃
┃  2. Coalesce delay accumulates →  lag builds up                               ┃
┃  3. Caches thrash              →  CPU spikes on render                        ┃
┃  4. Socket buffers fill        →  connection hangs                            ┃
┃  5. You restart mux            →  ALL SESSIONS DIE (use reptyr first!)        ┃
┃                                                                               ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Default Assumptions vs Reality

WezTerm AssumesReality with Agent Swarms
~100 lines/sec1,000+ lines/sec across panes
Occasional scrollback accessScrollback is primary debug tool
Few panes20+ panes, all active
Cache hits commonRapid context switches = cache misses

Performance Tuning (High-RAM)

THE EXACT PROMPT — Auto-Tune for Your RAM

# Auto-tune using linear interpolation (recommended)
curl -fsSL https://raw.githubusercontent.com/Dicklesworthstone/misc_coding_agent_tips_and_scripts/main/wezterm-mux-tune.sh | bash

# Preview without applying
./wezterm-mux-tune.sh --dry-run

# Calculate for specific RAM
./wezterm-mux-tune.sh --ram 200

# Use exact fixed profile
./wezterm-mux-tune.sh --profile 512

# Restore from backup
./wezterm-mux-tune.sh --restore

THE EXACT PROMPT — 512GB Manual Profile

Add to ~/.wezterm.lua before return config:

-- 512GB HIGH-RAM PROFILE
config.scrollback_lines = 10000000
config.mux_output_parser_buffer_size = 16 * 1024 * 1024
config.mux_output_parser_coalesce_delay_ms = 1
config.ratelimit_mux_line_prefetches_per_second = 1000
config.shape_cache_size = 65536
config.line_state_cache_size = 65536
config.line_quad_cache_size = 65536
config.line_to_ele_shape_cache_size = 65536
config.glyph_cache_image_cache_size = 4096

Settings Quick Reference

SettingDefault512GBPurpose
scrollback_lines3,50010MHistory per pane
mux_output_parser_buffer_size128KB16MBPTY batch buffer
mux_output_parser_coalesce_delay_ms31Parse latency
ratelimit_mux_line_prefetches_per_second501000Scroll speed
shape_cache_size1,02465,536Font cache
line_state_cache_size1,02465,536Line attr cache
line_quad_cache_size1,02465,536GPU geometry
glyph_cache_image_cache_size2564,096Rasterized glyphs

Profiles by RAM

RAMscrollbackbuffercachesprefetchMemory footprint
64GB1M2MB8K5003-8 GB
128GB2M4MB16K7505-15 GB
256GB5M8MB32K5008-25 GB
512GB10M16MB64K100015-60 GB

After applying: Restart mux to load new settings.


Emergency Session Rescue

Scenario: Mux unresponsive but agents still running. DON'T kill mux yet!

THE EXACT PROMPT — reptyr Rescue Workflow

# 1. Connect via plain SSH (bypass broken mux)
ssh user@host

# 2. Setup
sudo apt-get install -y reptyr
sudo sysctl -w kernel.yama.ptrace_scope=0

# 3. Create rescue session
tmux new-session -d -s rescue -x 200 -y 50

# 4. Find agents
ps -eo pid,args | grep -E 'claude --dangerously|codex --dangerously' | grep -v grep

# 5. Migrate each agent
for pid in $(ps -eo pid,args | grep -E 'claude --dangerously|codex --dangerously' | grep -v grep | awk '{print $1}'); do
  tmux new-window -t rescue -n "agent-$pid"
  tmux send-keys -t "rescue:agent-$pid" "reptyr -T $pid" Enter
  sleep 0.5
done

# 6. Verify migrations
for win in $(tmux list-windows -t rescue -F "#{window_name}" | grep agent); do
  tmux capture-pane -t "rescue:$win" -p | grep -qE "bypass|Claude" && echo "✓ $win" || echo "✗ $win"
done

# 7. NOW safe to kill mux
pkill -9 -f wezterm-mux

# 8. Restore security
sudo sysctl -w kernel.yama.ptrace_scope=1

# 9. Restart mux
wezterm-mux-server --daemonize

# 10. Access rescued agents
tmux attach -t rescue  # Ctrl-b w to browse

reptyr Failure Modes

ErrorCauseFix
"Operation not permitted"ptrace blockedsudo sysctl -w kernel.yama.ptrace_scope=0
"shares process group"Process has childrenUse reptyr -T (not plain reptyr)
"Unable to attach"Additional protectionsCannot migrate; will be lost

Success rate: 50-70%. Older/idle sessions migrate better than active ones with many subprocesses.


Mux Server Operations

Start/Stop

# Start (daemonized)
wezterm-mux-server --daemonize

# Stop gracefully
pkill -f wezterm-mux-server

# Force stop (kills sessions!)
pkill -9 -f wezterm-mux-server

# Restart (loses sessions unless rescued first)
pkill -9 -f wezterm-mux; wezterm-mux-server --daemonize

# Restart via systemd (if configured)
systemctl --user restart wezterm-mux-server

Kill Stuck Proxy Processes

Safe to kill — won't affect mux sessions:

pkill -f 'wezterm cli.*proxy'

Why Mux Degrades Over Time

CauseSymptomFix
Buffer overflowConnection timeoutIncrease mux_output_parser_buffer_size
Cache thrashingHigh CPU on scrollIncrease cache sizes
Session accumulationMemory bloatPeriodic mux restart
Scrollback buildupGB of RAM usageLower scrollback_lines or restart

Persistent Sessions Setup

Remote Server (one-time)

mkdir -p ~/.config/systemd/user

cat > ~/.config/systemd/user/wezterm-mux-server.service << 'EOF'
[Unit]
Description=WezTerm Mux Server
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/wezterm-mux-server --daemonize=false
Restart=on-failure
RestartSec=5
Environment=WEZTERM_LOG=warn

[Install]
WantedBy=default.target
EOF

systemctl --user daemon-reload
systemctl --user enable --now wezterm-mux-server
sudo loginctl enable-linger $USER

Local Config (SSH domain)

config.ssh_domains = {
  {
    name = 'myserver',
    remote_address = '10.0.0.1',
    username = 'ubuntu',
    multiplexing = 'WezTerm',  -- Key setting
    assume_shell = 'Posix',
  },
}

CLI Quick Reference

TaskCommand
List paneswezterm cli list
List panes (JSON)wezterm cli list --format json
Split rightwezterm cli split-pane --right
Split bottomwezterm cli split-pane --bottom
Send textwezterm cli send-text --pane-id N "cmd\n"
New tabwezterm cli spawn
New tab in domainwezterm cli spawn --domain-name SSH:host
Connect to muxwezterm connect unix
Zoom togglewezterm cli zoom-pane --toggle

Maintenance Checklist

  • Weekly: Check mux memory, consider restart if > 50GB RSS
  • Before restart: Check for active agents (use reptyr if needed)
  • After tuning: Restart mux to apply new settings
  • Version mismatch: Client/server MUST match exactly
# Check version match
wezterm --version                    # local
ssh host 'wezterm --version'         # remote

# Check mux memory
ps -eo rss,args | grep '[w]ezterm-mux' | awk '{printf "RSS: %.1fGB\n", $1/1024/1024}'

Troubleshooting

SymptomCauseFix
Connection timeoutBuffer overflowIncrease mux_output_parser_buffer_size
Laggy scrollingLow prefetch rateIncrease ratelimit_mux_line_prefetches_per_second
High CPU on renderCache thrashingIncrease all cache sizes
Truncated historySmall scrollbackIncrease scrollback_lines
"Broken pipe" in logsClient disconnectCheck network stability
"Checking server version" hangsMux overloadedRescue sessions, restart mux
Version mismatch errorClient/server differUpdate both to same version

Log Locations

# Mux server log
/run/user/$(id -u)/wezterm/wezterm-mux-server-log-*.txt

# Socket path
/run/user/$(id -u)/wezterm/sock

References

TopicFile
Full CLI commandsCOMMANDS.md
Persistent sessions deep-divePERSISTENT-SESSIONS.md
Performance tuning deep-divePERFORMANCE-TUNING.md

FAQ

What does the wezterm skill do?

Manage WezTerm mux servers for AI agent swarms on high-RAM servers (512GB+). Use when wezterm mux unresponsive, agent sessions need rescue, tuning scrollback, or configuring persistent remote sessions.

How do I install wezterm?

Run npx skills add https://github.com/dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations --skill wezterm in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/wezterm/ (personal) or .claude/skills/wezterm/ (project).

Which AI agents can use wezterm?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is wezterm safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains wezterm?

It is published by dicklesworthstone in dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations. It has 65 recorded installs.

More from dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations

View all →

ssh

dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations

SSH remote access - connections, tunnels, keys, file transfers. Use when connecting to servers, managing SSH keys, setting up port forwarding, or transferring files with scp/rsync.

703 installs

ui-ux-polish

dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations

Open the skill to read its SKILL.md instructions.

Frontend & Design234 installs

gcloud

dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations

Google Cloud Platform CLI - manage GCP resources. Use when working with Compute Engine, Cloud Run, GKE, Cloud Functions, Storage, BigQuery, or other GCP services.

DevOps & Cloud233 installs

agent-swarm-workflow

dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations

Open the skill to read its SKILL.md instructions.

planning-workflow

dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations

Comprehensive markdown planning methodology for software projects. Use when starting a new project, creating implementation plans, or refining architecture before coding.

cass

dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations

Open the skill to read its SKILL.md instructions.

98 installs

Popular ai & agents skills

View category →

google-agents-cli-publish

google/agents-cli

This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).

AI & Agents513.9K installs

google-agents-cli-eval

google/agents-cli

This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).

AI & Agents513.5K installs

skill-creator

anthropics/skills

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

OfficialAI & Agents416.4K installs

codex-pet

prime-skills/runcomfy-agent-skills

Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.

AI & Agents402.1K installs

full-output-enforcement

leonxlnx/taste-skill

Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.

AI & Agents401K installs

executing-plans

obra/superpowers

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

AI & Agents245.7K installs