Skip to content

[BUG] /ide command fails when CLAUDE_CONFIG_DIR is set - IDE integration doesn't respect custom config directory #4739

Description

@christopher-buss

Problem Description

When the CLAUDE_CONFIG_DIR environment variable is set to a custom directory, the /ide command fails to detect available IDEs, even when VS Code with the Claude Code extension is running properly.

Root Cause

  • VS Code extension creates lock files in the default ~/.claude/ide/ location
  • Claude CLI looks for lock files in $CLAUDE_CONFIG_DIR/ide/ location
  • This mismatch results in "No available IDEs detected" despite IDE being available

Environment Details

  • OS: Windows 10 Pro (24H2)
  • Claude Code Version: 1.0.63
  • Shell: zsh/bash (MSYS2/Git Bash)
  • IDE: Visual Studio Code with Claude Code extension
  • Environment Variable: CLAUDE_CONFIG_DIR=C:\Users\[user]\.config\claude

Reproduction Steps

  1. Set CLAUDE_CONFIG_DIR environment variable to custom directory (e.g., C:\Users\[user]\.config\claude)
  2. Open VS Code with Claude Code extension installed and running
  3. Verify extension is active (check VS Code output panel shows "Claude code extension is now active")
  4. Run claude in external terminal
  5. Execute /ide command
  6. Observe "No available IDEs detected" message

Expected vs Actual Behavior

Expected: IDE detection should respect CLAUDE_CONFIG_DIR and find VS Code regardless of config directory location

Actual:

  • Lock files are created in ~/.claude/ide/[port].lock
  • CLI searches in $CLAUDE_CONFIG_DIR/ide/[port].lock
  • IDE detection fails due to path mismatch

Working Workaround

Create a Windows junction to bridge both locations:

New-Item -ItemType Junction -Path "$env:CLAUDE_CONFIG_DIR\ide" -Target "$env:USERPROFILE\.claude\ide"

After applying this workaround, /ide command correctly detects and connects to VS Code.

Impact

  • Breaks IDE integration functionality for users with custom config directories
  • Affects users maintaining XDG-compliant directory structures
  • Forces users to either abandon custom config directories or implement manual workarounds

Related Issues

Suggested Fix

The IDE integration logic should respect the CLAUDE_CONFIG_DIR environment variable and create/search for lock files in $CLAUDE_CONFIG_DIR/ide/ instead of the hardcoded default location.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corearea:idebugSomething isn't workinghas reproHas detailed reproduction stepsplatform:windowsIssue specifically occurs on Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions