psmux-agent-hatch
A psmux plugin that runs Claude Code, Codex, and Antigravity CLI (agy) sessions in popups for each project directory — a native Windows port (scripts run in Git Bash) of thecats1105/tmux-agent-hatch, itself forked from craftzdog/tmux-claude-hatch.
Open the hatch, hand an AI agent the work, close it and get back to your editor. Each session lives in its own nested psmux session, so closing the hatch never interrupts it. When you want to check in, an fzf picker lists every running session across Claude, Codex, and AGY, shows what each one is doing, and jumps you straight to it.
Features
- Unified picker (
prefix + u) listing every running Claude, Codex, and AGY agent — several in one project, and any running loose in ordinary panes.
- Provider tags & status indicators — color-coded tags and live status (
working, waiting, idle).
- Live preview of each agent's screen right in the picker.
- Smart jump — selecting an agent switches your client to the window it was launched from, then resumes it in a popup over it.
- Independent launchers:
prefix + y Claude · prefix + o Codex · prefix + Y AGY.
- Quick kill (
ctrl-x) and copy location (ctrl-y) from the picker.
- Bell notification — a bell in a dedicated session shows a message on the client that launched it.
- Cached first paint — the picker opens from a cache and refreshes in the background.
Prerequisites
- Windows with psmux and PowerShell 7 (
pwsh, which psmux itself uses to run commands)
- Git for Windows — the scripts run in Git Bash
- fzf — picker UI
- jq — parses the agents' JSON (session files, hook payloads)
- Claude Code, Codex CLI, and/or Antigravity CLI (
agy), installed natively on Windows
Git Bash is found through the registry, git --exec-path and the usual install locations (scoop included). Point @agent_bash at a bash.exe to override. bash on PATH is deliberately not used: with WSL installed it is the WSL launcher.
Installation
Via PPM (psmux Plugin Manager)
set -g @plugin 'thecats1105/psmux-agent-hatch'
Then press prefix + I.
Manually
Clone the repo and load it from your psmux config. Set any @options before the run-shell line:
set -g @claude_command 'claude'
run-shell 'C:/Users/you/ghq/github.com/thecats1105/psmux-agent-hatch/psmux-agent-hatch.ps1'
Use forward slashes in paths inside psmux config. From a config file run-shell takes the bare .ps1 path.
Codex Setup
Codex lifecycle events are tracked via hooks. Print the configuration and paste it into ~/.codex/hooks.json:
pwsh -NoProfile -File C:/path/to/psmux-agent-hatch/scripts/print-hook-config.ps1 codex
It wires codex-hook.sh into SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, PermissionRequest and Stop.
AGY Setup
Print the configuration and merge the generated psmux-agent-hatch object into ~/.gemini/config/hooks.json:
pwsh -NoProfile -File C:/path/to/psmux-agent-hatch/scripts/print-hook-config.ps1 agy
Claude Companion Plugin (optional)
Claude reports its own status, so the picker works without hooks. The bundled psmux-claude-hatch Claude Code plugin adds bell notifications and keeps the picker cache fresh:
/plugin marketplace add thecats1105/psmux-agent-hatch
/plugin install psmux-claude-hatch@psmux-claude-hatch
The hooks themselves are bash scripts run by Git Bash; only this config printer is PowerShell, since you run it by hand. The printed commands avoid quotes (8.3 short names stand in for spaces) so they mean the same to cmd.exe and PowerShell, whichever the agent hands them to.
Keybindings
| Key | Action |
|---|
prefix + y | Launch / attach Claude session for current directory |
prefix + o | Launch / attach Codex session for current directory |
prefix + Y | Launch / attach AGY session for current directory |
prefix + u | Open unified agent picker popup |
Inside the Picker
| Key | Action |
|---|
Enter | Jump to selected agent session |
ctrl-x | Kill the selected agent process |
ctrl-y | Copy agent location (session:window.pane) to the clipboard |
Esc | Close picker |