feat: /ide should match IDE instances across git worktrees

Resolved 💬 3 comments Opened Mar 18, 2026 by DanielPBak Closed Mar 18, 2026

Problem

When using multiple git worktrees (e.g., /dev/basic-agent-{1,2,3,4}), /ide fails to connect because it matches IDE instances by exact project directory. If IntelliJ is open at /dev/basic-agent-1/platform, Claude Code running in /dev/basic-agent-3 won't detect it — even though they share the same .git/ and repo.

Currently the output is:

No available IDEs detected.
Found 2 other running IDE(s). However, their workspace/project directories do not match the current cwd.
  • IntelliJ IDEA: /Users/user/dev/basic-agent-2/platform
  • IntelliJ IDEA: /Users/user/dev/basic-agent-1/platform

Use case

Running multiple Claude Code sessions in parallel across worktrees is a common power-user workflow. Each worktree gets its own Claude session, but the user typically only has 1-2 IDE windows open. Having to open a separate IntelliJ instance per worktree just for /ide to work defeats the purpose of the lightweight worktree model.

Proposed solution

When matching IDE instances, also consider directories that share the same git repository (i.e., are worktrees of the same repo). If the current cwd is a worktree of the same repo as a running IDE's project directory, treat that as a valid match.

Alternatively, allow configuring a directory mapping or pattern (e.g., /dev/basic-agent-* all map to the same project) so /ide can connect across worktrees without requiring an exact path match.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗