Enhanced /ide command for git worktree development workflows
Resolved 💬 3 comments Opened Jun 2, 2025 by bjcoombs Closed Dec 30, 2025
Enhanced /ide Command for Git Worktree Development
Problem
The /ide command currently requires the IDE to be running in the exact same directory as the Claude Code session. This creates friction for developers using git worktrees, which is a common workflow pattern where:
- Base repo is at:
~/dev/github.com/<user>/<repo>/<repo>-main/ - Feature branches are at:
~/dev/github.com/<user>/<repo>/worktree/<branch-name>/ - Developers often run Claude Code from the base repo level for broader context
- IDEs are typically opened at the worktree level for focused development
Current Behavior
When running /ide from ~/dev/github.com/<user>/<repo>/, Claude Code cannot connect to an IDE running in ~/dev/github.com/<user>/<repo>/<repo>-main/ or worktree subdirectories.
Proposed Solution
Enhance the /ide command to:
- Auto-detect related workspaces: When run from a parent directory, automatically detect and offer IDEs running in subdirectories that are part of the same git repository family
- Workspace selection: Present a menu of available related IDEs when multiple options exist:
```
Found multiple related IDEs:
- IntelliJ IDEA: ./<repo>-main (main branch)
- IntelliJ IDEA: ./worktree/<feature-branch> (current work)
Select IDE [1-2]:
```
- Contextual awareness: Prioritize IDEs in active worktrees or recently modified directories
Benefits
- Supports git worktree workflows without requiring directory navigation
- Maintains ability to run Claude Code at higher levels for cross-service analysis
- Reduces context switching between terminal sessions
- Aligns with established development patterns in large codebases
Alternative Approaches
- Add a
--search-subdirsflag to/idecommand - Allow manual specification:
/ide --path ./worktree/<branch-name> - Auto-connect to the most recently active IDE in subdirectories
This enhancement would significantly improve the developer experience for teams using git worktrees and multi-service repositories.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗