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

feat: add CLAUDE_CONFIG_DIR environment variable support#58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ThomasK33 merged 1 commit intocoder:mainfromnabekou29:feat/claude-config-dir-env
Jun 21, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletionsREADME.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -112,7 +112,7 @@ This plugin creates a WebSocket server that Claude Code CLI connects to, impleme
The protocol uses a WebSocket-based variant of MCP (Model Context Protocol) that:

1. Creates a WebSocket server on a random port
2. Writes a lock file to `~/.claude/ide/[port].lock` with connection info
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
3. Sets environment variables that tell Claude where to connect
4. Implements MCP tools that Claude can call

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

## Troubleshooting

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

Expand Down
12 changes: 11 additions & 1 deletionlua/claudecode/lockfile.lua
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,17 @@
local M = {}

--- Path to the lock file directory
M.lock_dir = vim.fn.expand("~/.claude/ide")
---@return string lock_dir The path to the lock file directory
local function get_lock_dir()
local claude_config_dir = os.getenv("CLAUDE_CONFIG_DIR")
if claude_config_dir and claude_config_dir ~= "" then
return vim.fn.expand(claude_config_dir .. "/ide")
else
return vim.fn.expand("~/.claude/ide")
end
end

M.lock_dir = get_lock_dir()

-- Track if random seed has been initialized
local random_initialized = false
Expand Down
8 changes: 6 additions & 2 deletionsscripts/lib_claude.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,11 @@
# This library provides reusable functions for interacting with Claude Code's WebSocket API

# Configuration
export CLAUDE_LOCKFILE_DIR="$HOME/.claude/ide"
if [ -n "$CLAUDE_CONFIG_DIR" ]; then
export CLAUDE_LOCKFILE_DIR="$CLAUDE_CONFIG_DIR/ide"
else
export CLAUDE_LOCKFILE_DIR="$HOME/.claude/ide"
fi
export CLAUDE_LOG_DIR="mcp_test_logs" # Default log directory
export CLAUDE_WS_TIMEOUT=10 # Default timeout in seconds

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

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

[8]ページ先頭

©2009-2025 Movatter.jp