Skip to content

Commit 24ba304

Browse files
STRRLclaude
andcommitted
refactor: extract Claude local path to constant for maintainability
Extract the hardcoded Claude CLI local installation path to a constant CLAUDE_LOCAL_PATH to improve maintainability and make it easier to update if the installation path changes in the future. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5841753 commit 24ba304

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/specify_cli/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@
5454
"gemini": "Gemini CLI"
5555
}
5656

57+
# Claude CLI local installation path after migrate-installer
58+
CLAUDE_LOCAL_PATH = Path.home() / ".claude" / "local" / "claude"
59+
5760
# ASCII Art Banner
5861
BANNER = """
5962
███████╗██████╗ ███████╗ ██████╗██╗███████╗██╗ ██╗
@@ -339,8 +342,7 @@ def check_tool(tool: str, install_hint: str) -> bool:
339342
# and creates an alias at ~/.claude/local/claude instead
340343
# This path should be prioritized over other claude executables in PATH
341344
if tool == "claude":
342-
claude_local_path = Path.home() / ".claude" / "local" / "claude"
343-
if claude_local_path.exists() and claude_local_path.is_file():
345+
if CLAUDE_LOCAL_PATH.exists() and CLAUDE_LOCAL_PATH.is_file():
344346
return True
345347

346348
if shutil.which(tool):

0 commit comments

Comments
 (0)