Fixing tmux Socket Issues

Recreate missing tmux socket directories and signal the server to restore connections.

Updated Aug 10, 2021
One-click install
npx skills add https://github.com/johnnymo87/dotfiles --skill fixing-tmux-socket-issues
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Fixing tmux Socket Issues
Source: https://github.com/johnnymo87/dotfiles/tree/main/.claude/skills/fixing-tmux-socket-issues
Command: npx skills add https://github.com/johnnymo87/dotfiles --skill fixing-tmux-socket-issues

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill repairs tmux socket connection errors when the socket directory is deleted while tmux is running. It helps you reconnect without killing sessions.

Core Features & Use Cases

  • Diagnose tmux socket connection failures
  • Recreate missing socket directories
  • Signal tmux server to recreate socket files
  • Verify manual save/restore functionality
  • Preserve all running sessions and processes

Quick Start

  • Verify you are inside a tmux session and that the socket directory is missing
  • Recreate the socket directory and signal the tmux server
  • Verify by listing sessions and attempting a resurrect save

Frequently Asked Questions about Fixing tmux Socket Issues

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix tmux socket connection errors after /tmp cleanup?

Tmux socket connection errors occur when the socket directory is deleted while tmux remains running. Recreate the missing socket directory, signal the tmux server to regenerate socket files, then verify by listing sessions. Your running sessions and processes are preserved throughout.

What does 'error connecting to /private/tmp/tmux-UID/default' mean?

This error indicates the tmux socket directory no longer exists, typically after system updates, manual /tmp deletion, or cleanup scripts. The tmux server is still running but clients cannot connect. Recreating the directory and signaling the server resolves the issue without terminating sessions.

Can I restore tmux sessions without losing running processes?

Yes. Socket repair preserves all active sessions and processes inside them. After recreating the socket directory and signaling the server, your sessions remain intact with all running commands and state. Manual save/restore via tmux-resurrect can verify recovery.

How do I diagnose why tmux list-sessions fails inside an active session?

If tmux list-sessions fails while you're inside a session, the socket directory is likely missing. Verify the socket directory exists at /private/tmp/tmux-UID/ or /tmp/tmux-UID/. If absent, recreate it and signal the server to restore socket connectivity.

Do I need to restart tmux to fix socket issues?

No. Socket repair reconnects without restarting. Recreate the socket directory, signal the running tmux server, and verify with list-sessions. All sessions continue running. Restart is unnecessary and risks losing session state.