Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit91357d8

Browse files
authored
feat: add CLAUDE_CONFIG_DIR environment variable support (#58)
1 parent3fe2c1b commit91357d8

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

‎README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ This plugin creates a WebSocket server that Claude Code CLI connects to, impleme
112112
The protocol uses a WebSocket-based variant of MCP (Model Context Protocol) that:
113113

114114
1. Creates a WebSocket server on a random port
115-
2. Writes a lock file to`~/.claude/ide/[port].lock` with connection info
115+
2. Writes a lock file to`~/.claude/ide/[port].lock`(or`$CLAUDE_CONFIG_DIR/ide/[port].lock` if`CLAUDE_CONFIG_DIR` is set)with connection info
116116
3. Sets environment variables that tell Claude where to connect
117117
4. Implements MCP tools that Claude can call
118118

@@ -176,7 +176,7 @@ For deep technical details, see [ARCHITECTURE.md](./ARCHITECTURE.md).
176176

177177
##Troubleshooting
178178

179-
-**Claude not connecting?** Check`:ClaudeCodeStatus` and verify lock file exists in`~/.claude/ide/`
179+
-**Claude not connecting?** Check`:ClaudeCodeStatus` and verify lock file exists in`~/.claude/ide/` (or`$CLAUDE_CONFIG_DIR/ide/` if`CLAUDE_CONFIG_DIR` is set)
180180
-**Need debug logs?** Set`log_level = "debug"` in opts
181181
-**Terminal issues?** Try`provider = "native"` if using snacks.nvim
182182

‎lua/claudecode/lockfile.lua

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,17 @@
77
localM= {}
88

99
--- Path to the lock file directory
10-
M.lock_dir=vim.fn.expand("~/.claude/ide")
10+
---@returnstring lock_dir The path to the lock file directory
11+
localfunctionget_lock_dir()
12+
localclaude_config_dir=os.getenv("CLAUDE_CONFIG_DIR")
13+
ifclaude_config_dirandclaude_config_dir~=""then
14+
returnvim.fn.expand(claude_config_dir.."/ide")
15+
else
16+
returnvim.fn.expand("~/.claude/ide")
17+
end
18+
end
19+
20+
M.lock_dir=get_lock_dir()
1121

1222
-- Track if random seed has been initialized
1323
localrandom_initialized=false

‎scripts/lib_claude.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
# This library provides reusable functions for interacting with Claude Code's WebSocket API
44

55
# Configuration
6-
export CLAUDE_LOCKFILE_DIR="$HOME/.claude/ide"
6+
if [-n"$CLAUDE_CONFIG_DIR" ];then
7+
export CLAUDE_LOCKFILE_DIR="$CLAUDE_CONFIG_DIR/ide"
8+
else
9+
export CLAUDE_LOCKFILE_DIR="$HOME/.claude/ide"
10+
fi
711
export CLAUDE_LOG_DIR="mcp_test_logs"# Default log directory
812
export CLAUDE_WS_TIMEOUT=10# Default timeout in seconds
913

@@ -13,7 +17,7 @@ export CLAUDE_WS_TIMEOUT=10 # Default timeout in seconds
1317
# Find the Claude lockfile and extract the port
1418
find_claude_lockfile() {
1519
# Get all .lock files
16-
lock_files=$(find~/.claude/ide -name"*.lock"2>/dev/null||echo"")
20+
lock_files=$(find"$CLAUDE_LOCKFILE_DIR" -name"*.lock"2>/dev/null||echo"")
1721

1822
if [-z"$lock_files" ];then
1923
echo"No Claude lockfiles found. Is the VSCode extension running?">&2

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp