Skip to content

Add project-wide panel handoff for worktrees #2

@andersonkrs

Description

@andersonkrs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions