Skip to main content

Hop between Claude Code sessions in tmux panes

Project description

Claude Tmux Hop

Quickly hop between Claude Code sessions running in tmux panes.

Features

  • Priority-based cycling: Jump to panes waiting for input first, then idle, then active
  • Auto-registration: Claude Code hooks automatically track pane states
  • Auto-discovery: Existing Claude Code sessions are detected on plugin load
  • In-memory state: Uses tmux pane options - no files, auto-cleanup when panes close
  • Cross-session navigation: Works across all tmux sessions

Requirements

  • uv (for uvx command)
  • tmux 3.0+
  • Python 3.10+
  • Claude Code

Installation

1. Install Claude Code Plugin

claude plugin marketplace add unsafe9/claude-tmux-hop
claude plugin install claude-tmux-hop

2. Install Tmux Plugin (via TPM)

Add to ~/.tmux.conf:

set -g @plugin 'unsafe9/claude-tmux-hop'

Then press prefix + I to install.

That's it! The CLI runs via uvx automatically - no manual Python installation needed.

Any existing Claude Code sessions will be automatically discovered and registered as idle on plugin load.

Usage

Key Bindings

Key Action
prefix + Space Cycle to next Claude Code pane
prefix + C-Space Open picker menu

Configuration

Add to ~/.tmux.conf:

# Customize cycle key (default: Space)
set -g @hop-cycle-key 'Space'

# Customize picker key (default: C-Space)
set -g @hop-picker-key 'C-Space'

CLI Commands

# List all Claude Code panes
uvx claude-tmux-hop list

# Cycle to next pane (usually via keybinding)
uvx claude-tmux-hop cycle

# Show picker menu
uvx claude-tmux-hop picker

# Discover existing Claude Code sessions (runs automatically on plugin load)
uvx claude-tmux-hop discover

# Preview what would be discovered
uvx claude-tmux-hop discover --dry-run

How It Works

Pane States

State Trigger Priority
waiting Notification hook (permission prompt) Highest
idle Stop hook (task complete) Medium
active UserPromptSubmit hook Lowest

Cycling Behavior

  1. If waiting panes exist, cycle only through waiting panes (oldest first)
  2. If no waiting, cycle through idle panes (newest first)
  3. If no idle, cycle through active panes (newest first)

State Storage

State is stored directly on tmux panes using custom options:

  • @hop-state: Current state (waiting/idle/active)
  • @hop-timestamp: Unix timestamp of last state change

Benefits:

  • No external files
  • State auto-deleted when pane closes
  • Fast (in-memory)

Releasing a New Version

Update the version in pyproject.toml, then publish to PyPI:

uv build
uv publish

Both plugins use uvx which always fetches the latest version from PyPI.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_tmux_hop-0.2.1.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_tmux_hop-0.2.1-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file claude_tmux_hop-0.2.1.tar.gz.

File metadata

  • Download URL: claude_tmux_hop-0.2.1.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for claude_tmux_hop-0.2.1.tar.gz
Algorithm Hash digest
SHA256 2af76589ba0d34a73248e154b04c2a9bc12c1e7d028c45b3c09e67b6e0723b74
MD5 76c077fbab2207a15995c5acbd034b7c
BLAKE2b-256 72a7260b5f97c947600195c7c74f9b5b218f0770c79d5f9d32c39ba20daf0cd9

See more details on using hashes here.

File details

Details for the file claude_tmux_hop-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: claude_tmux_hop-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for claude_tmux_hop-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bcd877d245e83d749606867ea52acdb959337c3a2b0507c2bea6738696796164
MD5 dd52c05378cc671d5ed69de53f5f30d3
BLAKE2b-256 1f8ebeb6f05803b4b7d0195bee7ad1fceb6218ebcf6d90f2216acb25d41e488d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page