A Claude Code plugin that opens Ghostty split panes running Claude Code from your current session.
Scope: macOS + Ghostty only. The split is driven through Ghostty's AppleScript dictionary via
osascript, so other terminals (iTerm2, WezTerm, Kitty, Alacritty…) and other operating systems are not supported.
/split-new [prompt]— Open a new Ghostty split pane in the current working directory and start a freshclaudesession. If[prompt]is given, it is passed toclaudeas the initial prompt./split-fork [prompt]— Open a new Ghostty split pane and fork the current session into it (claude --continue --fork-session). Both panes share history up to the fork point, then diverge. If[prompt]is given, it is sent as the next user turn in the forked session./create-new [prompt]— Same as/split-new, but opens a new Ghostty tab in the front window instead of splitting the current pane./create-fork [prompt]— Same as/split-fork, but opens the forked session in a new Ghostty tab instead of a split pane.
Note on quoting: the prompt is wrapped in
"..."and typed into the new pane verbatim — embedding literal double quotes in your prompt will break the wrapping. For prompts with quotes, type them in the new pane after it opens.
- macOS (uses AppleScript)
- Ghostty
- Claude Code
From inside Claude Code, add the marketplace and install the plugin:
/plugin marketplace add liunuozhi/claude-panes
/plugin install claude-panes@claude-panes
Confirm with /plugin.
Each command shells out to a small script in bin/, which runs an osascript snippet that talks to Ghostty's AppleScript dictionary:
- Build a
new surface configurationwith the current cwd asinitial working directory. - Set
initial inputto<cmd>\n(or<cmd> "<prompt>"\nif a prompt was given), where<cmd>isclaudeorclaude --continue --fork-session. - Either
splitthe focused terminal of the front window to the right with that configuration (open-ghostty-split.sh), or open anew tabin the front window with it (open-ghostty-tab.sh). Both variants fall back tonew windowif no Ghostty window is open.
That's the whole mechanism — no session-file copying, no daemons. Forking is delegated to Claude Code's built-in --fork-session flag.
Local layout:
.claude-plugin/
plugin.json
marketplace.json
bin/
open-ghostty-split.sh
open-ghostty-tab.sh
commands/
split-new.md
split-fork.md
create-new.md
create-fork.md
Validate manifests:
claude plugin validate /path/to/claude-panesHot-reload story:
| Edit | Reload step |
|---|---|
bin/*.sh |
None — re-read on every invocation |
commands/*.md |
/reload-plugins |
plugin.json, marketplace.json |
/reload-plugins |
Errors don't surface in the TUI — start with claude --debug and tail ~/.claude/logs/debug.log.
The Ghostty-split mechanism is adapted from extensions/split-fork.ts in mitsuhiko/agent-stuff, which originally implemented this for the pi-coding-agent. This plugin reuses the AppleScript pattern and adapts it to Claude Code's --fork-session flag.
MIT