Skip to content

Commit 1467ede

Browse files
authored
Fix claude code cli environment variable detection (#670)
* Fix Claude Code CLI environment variable detection Update the Claude Code CLI detection logic to check for 'CLAUDECODE' and 'CLAUDE_CODE_ENTRYPOINT' environment variables instead of 'CLAUDE_CODE' and 'ANTHROPIC_CLI'. This ensures accurate detection of the Claude Code CLI environment. * Update Directory.Build.props
1 parent b834fd2 commit 1467ede

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/DiffEngine/AiCliDetector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static AiCliDetector()
1616

1717
// Claude Code
1818
// https://docs.anthropic.com/en/docs/build-with-claude/claude-cli
19-
IsClaudeCode = variables.Contains("CLAUDE_CODE") || variables.Contains("ANTHROPIC_CLI");
19+
IsClaudeCode = variables.Contains("CLAUDECODE") || variables.Contains("CLAUDE_CODE_ENTRYPOINT");
2020

2121
Detected = IsCopilot ||
2222
IsAider ||

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project>
33
<PropertyGroup>
44
<NoWarn>CS1591;CS0649;NU1608;NU1109</NoWarn>
5-
<Version>18.1.0</Version>
5+
<Version>18.1.1</Version>
66
<AssemblyVersion>1.0.0</AssemblyVersion>
77
<PackageTags>Testing, Snapshot, Diff, Compare</PackageTags>
88
<Description>Launches diff tools based on file extensions. Designed to be consumed by snapshot testing libraries.</Description>

0 commit comments

Comments
 (0)