Summary
Add support for declaring project panels (commands) that must be stopped across all sessions for a project and started only in the currently active worktree session. This enables safe handoff of services bound to a single resource (e.g., Rails on a port) when switching worktrees.
Motivation
Some services can only run once per project because they bind to fixed ports or shared resources. When moving between worktrees, users want automatic stop in the old session and start in the new session to avoid conflicts and manual cleanup.
Proposed behavior
- Allow a project config section for "exclusive" panels (name TBD).
- When switching to a new worktree session, stop those panels in any other session for the same project.
- Start those panels in the current session after stop succeeds.
- If stop fails, surface a clear error and do not start duplicates.
- Provide clear logging of stop/start actions and the target sessions.
Acceptance criteria
- Config parsing supports an exclusive panel declaration (name TBD).
- Switching worktrees triggers stop in other sessions for the same project.
- Exclusive panels are started in the current session after stops complete.
- Behavior is consistent for both existing and newly created sessions.
Notes
- Example use case: Rails server bound to a fixed port; when moving worktrees, stop old server and start new one automatically.
Summary
Add support for declaring project panels (commands) that must be stopped across all sessions for a project and started only in the currently active worktree session. This enables safe handoff of services bound to a single resource (e.g., Rails on a port) when switching worktrees.
Motivation
Some services can only run once per project because they bind to fixed ports or shared resources. When moving between worktrees, users want automatic stop in the old session and start in the new session to avoid conflicts and manual cleanup.
Proposed behavior
Acceptance criteria
Notes