[BUG] IDE lock files always written to ~/.claude/ide, ignoring CLAUDE_CONFIG_DIR
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When CLAUDE_CONFIG_DIR is set (e.g., ~/.config/claude), the Claude Code CLI correctly uses that directory for its configuration. However, IDE integration lock files are always written to the hardcoded ~/.claude/ide/ path, regardless of the CLAUDE_CONFIG_DIR setting.
This means ~/.claude/ is always created even when the user has explicitly configured a different config directory, which defeats the purpose of CLAUDE_CONFIG_DIR.
Both sides of the IDE integration have this issue:
- The IDE plugin (IntelliJ / VS Code) writes lock files to
~/.claude/ide/ - The CLI reads lock files from
~/.claude/ide/(via the hardcoded path in thenJR()function)
Related Issue
This was previously reported in #4739 but was closed as NOT_PLANNED and subsequently locked.
What Should Happen?
The IDE lock file directory should respect CLAUDE_CONFIG_DIR:
- If
CLAUDE_CONFIG_DIRis set, lock files should be read/written at$CLAUDE_CONFIG_DIR/ide/ - If not set, fall back to the default
~/.claude/ide/
Both the CLI and IDE plugins need to agree on the resolved path.
Reproduction Steps
- Set
CLAUDE_CONFIG_DIRto a custom directory (e.g.,export CLAUDE_CONFIG_DIR="$HOME/.config/claude") - Open an IDE (IntelliJ IDEA / VS Code) with the Claude Code plugin active
- Observe that
~/.claude/ide/is created with a lock file, despiteCLAUDE_CONFIG_DIRpointing elsewhere
Lock File Example
{
"workspaceFolders": ["/Users/example/project"],
"pid": 20751,
"ideName": "IntelliJ IDEA",
"transport": "ws",
"runningInWindows": false,
"authToken": "..."
}
Environment Details
- OS: macOS (Darwin 25.3.0)
- Claude Code Version: 2.1.76
- Shell: zsh
- IDE: IntelliJ IDEA with Claude Code plugin
- Config:
CLAUDE_CONFIG_DIRset to~/.config/claude
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗