lazy-tmux

Integrations

lazy-tmux saves the exact conversation associated with an agent in a tmux pane, then resumes that conversation instead of starting a new one. Pi, Claude Code, Codex, and Antex are independent clients: their IDs, configuration homes, and saved conversations are never converted into another client's sessions.

Each integration has its own enabled and home settings under [integrations.pi], [integrations.claude], [integrations.codex], or [integrations.antex]. The configured home must match the one used by the client.

Pi

Setup

Pi's identity extension is embedded in lazy-tmux and automatically installed or updated during normal setup, bootstrap, daemon, picker, save, and restore workflows. It lives at <pi-home>/extensions/lazy-tmux-pi.ts (default home: ~/.pi/agent). No npm package or manual file copying is needed. To install explicitly:

lazy-tmux integrations setup pi

New Pi clients load the extension automatically. Clients already running before installation need a restart or /reload when idle. lazy-tmux does not reload or restart your agents. Pi's extension and project trust restrictions still apply.

Restoration and limitations

The extension publishes the exact session file and owner process on startup, session switches, forks, and after turns. lazy-tmux validates the session's JSONL header and restores with pi --session <file>. It does not guess the newest file in a directory or read identity from terminal output.

--no-session, non-session print/RPC invocations, missing session files, and ambiguous pane ownership cannot establish a restorable identity. Preserve the session files when moving or restoring your environment.

For custom locations, use PI_CODING_AGENT_DIR and PI_CODING_AGENT_SESSION_DIR. Explicit [integrations.pi] home and session_dir settings take precedence.

lazy-tmux integrations setup pi --uninstall removes the managed extension and opts out of automatic installation; explicit setup re-enables it. Set [integrations.pi] enabled = false to disable the integration altogether. After upgrading lazy-tmux, also restart any running autosave daemon so it uses the new binary.

Claude Code

lazy-tmux picker showing live Claude Code activity states

Setup

Install lifecycle hooks using an installed, stable lazy-tmux executable, then review and trust them in Claude Code:

lazy-tmux integrations setup claude

Hooks are merged into <claude-home>/settings.json (default: ~/.claude/settings.json), preserving other settings and hooks and keeping a .lazy-tmux.bak backup. lazy-tmux claude-hooks is a compatibility alias for setup; use lazy-tmux integrations setup claude --uninstall to remove owned hooks. Installation does not bypass client trust or administrator policies.

Restoration and limitations

Claude Code resumes with claude --resume <session-id>. Lifecycle hooks establish the exact conversation identity and publish live activity. Older hook claude-status files are not used for identity or status.

Hooks must run as descendants of the local Claude client that owns the pane. Remote or detached processes, nested agents, and suspended clients cannot establish ownership merely by supplying a conversation ID. Missing or untrusted hooks leave the identity unverified; lazy-tmux does not select a conversation by working directory.

Codex

Codex must run with --no-daemon for reliable session tracking and restoration. The shared daemon mode is not supported. Use lazy-tmux v0.3.6 or newer, which supports saving this flag and preserving it in the resume command.

Install the lifecycle hooks once, then review and trust them in Codex:

lazy-tmux integrations setup codex

Start Codex inside your tmux pane with:

codex --no-daemon

We recommend adding this alias to ~/.bashrc (bash) or ~/.zshrc (zsh), then opening a new shell or sourcing that file:

alias codex='codex --no-daemon'

The alias applies to interactive shell commands. Scripts, tmux bindings, and other launchers that do not expand aliases must pass --no-daemon explicitly. lazy-tmux records the flag when saving a verified session and restores it with codex resume <session-id> --no-daemon, preserving any other supported launch options.

Why shared daemon mode is unsupported

A shared Codex daemon can outlive the tmux pane that started it. Its hooks may inherit that pane's old environment, and their process ancestry no longer identifies the current interactive Codex client. Although a hook reports the conversation ID, lazy-tmux cannot reliably associate it with the correct pane. This can cause hook failures and an agent identity is unverified error on restore. lazy-tmux refuses automatic resume rather than risk restoring the wrong conversation.

After switching to --no-daemon, start a new Codex client and save the pane again once its session is verified. Updating lazy-tmux or adding the alias does not repair previously saved unverified panes. See issue #325 for the daemon-mode limitation.

Antex

Setup

Antex publishes a native tmux binding; no lifecycle hook installation is needed. Use Antex 0.1.8 or newer for native bindings. Antex 0.1.9 or newer also publishes startup receipts used to acknowledge restoration. The integration is enabled by default, with ~/.antex as its default home.

Restoration and limitations

A verified Antex pane resumes with antex resume <session-id>. lazy-tmux uses the ownership-verified binding, not the newest conversation sharing a working directory. Live activity is read from rollout lifecycle events only after verifying the live owner, session ID, and working directory.

A missing or stale native binding cannot establish a verified identity. Antex and Codex remain separate integrations: lazy-tmux never changes a saved Codex conversation into an Antex conversation, or vice versa. Existing verified Antex snapshots do not need reconfiguration.

Live status and troubleshooting

The picker shows live working, waiting-for-input, waiting-for-decision, and idle states when the integration can verify the current owner and session. Pi also reports model or compaction errors. A missing live status remains unknown rather than reusing stale saved activity. ? indicates an unverified agent identity; ↻ indicates a pending restoration.

lazy-tmux integrations doctor
lazy-tmux agent-session --agent codex --pane %1

Replace the agent and pane in the second command with your target. Doctor reports hook/extension installation and per-pane verification; installation alone does not certify client trust or compatibility.

Unsupported launch options are rejected rather than silently dropped. Supported options preserve argument boundaries; initial prompts and images are not replayed. Previously saved unverified panes are not automatically repaired by installing hooks or upgrading. If you know the exact conversation identity, consult the saved-pane repair instructions. Manual repair does not prove live process ownership.

Author: Anton Grishin (alchemmist), anton.ingrish@gmail.com

OpenSource: alchemmist/lazy-tmux

© 2026 lazy-tmux