Wezterm logo

Wezterm

Community
Dicklesworthstone
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.

Overview

PublisherDicklesworthstone
Repositoryagent_flywheel_clawdbot_skills_and_integrations
Skill namewezterm
Stars
73
Forks
16
Bundled files
3
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Dicklesworthstone on GitHub. Read the source before you install it.

Installation

Install the Wezterm AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations/tree/main/skills/wezterm
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations.git /tmp/agent_flywheel_clawdbot_skills_and_integrations
mkdir -p .claude/skills
cp -r /tmp/agent_flywheel_clawdbot_skills_and_integrations/skills/wezterm .claude/skills/wezterm
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Wezterm in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Wezterm on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Wezterm is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

WezTerm — High-RAM Agent Swarm Management

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


Quick Diagnosis

bash
# 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

bash
# 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:

lua
-- 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

bash
# 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

bash
# 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:

bash
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)

bash
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)

lua
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
bash
# 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

bash
# 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

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Wezterm AI 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.

Why use Wezterm on TypingMind?

Because you install it once and use it with any model. Wezterm is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Wezterm in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations/tree/main/skills/wezterm. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Wezterm?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Wezterm?

As many as you like. As long as a model supports skills, you can use Wezterm with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Wezterm AI skill free?

It is published on GitHub by Dicklesworthstone. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇