Skip to content

Commit 26afa3a

Browse files
committed
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.
1 parent 7851cde commit 26afa3a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/DiffEngine/AiCliDetector.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ public static class AiCliDetector
55
static AiCliDetector()
66
{
77
var variables = Environment.GetEnvironmentVariables();
8-
8+
99
// GitHub Copilot CLI
1010
// https://docs.github.com/en/copilot/using-github-copilot/using-github-copilot-in-the-command-line
1111
IsCopilotCli = variables.Contains("GITHUB_COPILOT_CLI");
@@ -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 = IsCopilotCli ||
2222
IsAider ||

0 commit comments

Comments
 (0)