Documentation
¶
Index ¶
- func BatchFindClaudeProcs() map[int]string
- func CapturePane(p Pane) (string, error)
- func CurrentWindowClaudes() []string
- func DetectLiveProjectPaths() []string
- func ExtractClaudeOAuthToken() (string, error)
- func FindLiveProjectPaths() map[string]bool
- func HasClaude(shellPID int) bool
- func HasClaudeSession(shellPID int, sessionID string) bool
- func InTmux() bool
- func KillWindow(p Pane) error
- func MarkLiveSessions(sessions []session.Session)
- func MoveWithAndSwitchPane(target Pane) error
- func NewWindowClaude(windowName, dir, sessionID string) error
- func NewWindowClaudeNew(windowName, dir string) error
- func OAuthTokenEnv() string
- func PaneCursorCol(p Pane) (int, error)
- func PromptAndSend(p Pane, promptText string) error
- func SendKeys(p Pane, keys string) error
- func SendSingleKey(p Pane, key string) error
- func ShellQuote(s string) string
- func SwitchToPane(p Pane) error
- func TeaKeyToTmux(key string) (string, bool)
- type ClaudeProc
- type IsolatedEnv
- type Pane
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchFindClaudeProcs ¶
BatchFindClaudeProcs finds all claude processes and maps parent PID → args. When multiple processes share ppid=1 (orphaned/reparented), they are stored in the OrphanedProcs slice instead to avoid map key collisions.
func CapturePane ¶
CapturePane captures the visible content of a tmux pane. Does NOT include scrollback.
func CurrentWindowClaudes ¶
func CurrentWindowClaudes() []string
CurrentWindowClaudes returns project paths of Claude processes in the current tmux window.
func DetectLiveProjectPaths ¶
func DetectLiveProjectPaths() []string
DetectLiveProjectPaths returns absolute project paths of currently running Claude processes. Used for fast phase-1 session scanning at startup.
func ExtractClaudeOAuthToken ¶
ExtractClaudeOAuthToken reads the OAuth access token from the macOS Keychain.
func FindLiveProjectPaths ¶
FindLiveProjectPaths returns project paths that have an active Claude process. Used as fallback for non-tmux environments.
func HasClaudeSession ¶
HasClaudeSession checks if a pane's shell has a claude child process running the specific session ID (matches --resume <id> in args).
func InTmux ¶
func InTmux() bool
InTmux returns true if the process is running inside a tmux session.
func KillWindow ¶
KillWindow kills the tmux window containing the given pane.
func MarkLiveSessions ¶
MarkLiveSessions sets IsLive and IsResponding on sessions by matching running Claude processes. In tmux, matches by session ID in process args with fallback to most-recent-for-path. Outside tmux, matches by path only. Also sets TmuxWindowName on all sessions whose ProjectPath matches a tmux pane CWD.
func MoveWithAndSwitchPane ¶
MoveWithAndSwitchPane moves the current pane (CSB) to the target's tmux window as a side-by-side split, then focuses the target pane.
func NewWindowClaude ¶
NewWindowClaude creates a new tmux window with the given name, cd's to dir, and runs "claude --resume <sessionID>".
func NewWindowClaudeNew ¶ added in v0.3.0
NewWindowClaudeNew creates a new tmux window with the given name, cd's to dir, and runs "claude" (without --resume, starting a fresh session).
func OAuthTokenEnv ¶
func OAuthTokenEnv() string
OAuthTokenEnv returns a shell snippet to export CLAUDE_CODE_OAUTH_TOKEN. Checks env first, then falls back to extracting from macOS Keychain.
func PaneCursorCol ¶ added in v0.3.0
PaneCursorCol returns the cursor column position in the pane.
func PromptAndSend ¶
PromptAndSend opens a tmux command-prompt that sends the typed text to the target pane followed by Enter so Claude submits.
func SendKeys ¶
SendKeys sends text input to a tmux pane followed by Enter to submit. Uses -l for the text (literal, no key-name interpretation) then a separate send-keys for Enter so it's treated as a keypress.
func SendSingleKey ¶
SendSingleKey sends a single key event to a tmux pane.
func ShellQuote ¶
ShellQuote wraps a string in single quotes for safe shell embedding.
func SwitchToPane ¶
SwitchToPane switches the tmux client to the given pane.
func TeaKeyToTmux ¶
TeaKeyToTmux maps a Bubble Tea key string to tmux send-keys argument(s). Returns (tmuxKey, literal). If literal is true, use send-keys -l.
Types ¶
type ClaudeProc ¶ added in v0.3.0
ClaudeProc holds information about a running claude process.
type IsolatedEnv ¶
type IsolatedEnv struct {
HomeDir string // fake HOME (tmpDir)
ConfigDir string // fake HOME/.claude
}
IsolatedEnv holds paths for an isolated Claude test environment.
func NewIsolatedEnv ¶
func NewIsolatedEnv(prefix string) (*IsolatedEnv, error)
NewIsolatedEnv creates a temp HOME with onboarding state seeded and an empty MCP config to block all MCP servers.
func (*IsolatedEnv) MCPConfigPath ¶
func (e *IsolatedEnv) MCPConfigPath() string
MCPConfigPath returns the path to the empty MCP config file.
func (*IsolatedEnv) RunPopup ¶
func (e *IsolatedEnv) RunPopup(script string)
RunPopup launches the script in a tmux display-popup with a nested tmux session for scrollback support. Blocks until the popup exits.
func (*IsolatedEnv) Script ¶
func (e *IsolatedEnv) Script(extraArgs ...string) string
Script builds a shell script that runs claude in this isolated env. Extra args are appended to the claude command.
func (*IsolatedEnv) SettingsPath ¶
func (e *IsolatedEnv) SettingsPath() string
SettingsPath returns the path to settings.json in the config dir.
func (*IsolatedEnv) WriteSettings ¶
func (e *IsolatedEnv) WriteSettings(data []byte) error
WriteSettings writes a JSON settings file to the config dir.
type Pane ¶
type Pane struct {
PaneID string
Command string
Session string
Window string
WindowName string
Pane string
PID int
Path string
}
Pane represents a tmux pane with its metadata.
func FindPane ¶
FindPane finds the tmux pane whose cwd matches projectPath and (optionally) has a claude process running in it. If sessionID is provided, prefer panes running that specific session.
func SpawnHiddenWindow ¶ added in v0.3.0
SpawnHiddenWindow creates a hidden tmux window running the given command and returns the Pane reference for capture-pane. The window is created with -d (detached) so it doesn't steal focus.