Skip to content

Commit cf51a3a

Browse files
committed
Add CLAUDECODE handling in environment variable parsing and bump version to 1.0.2
1 parent d89e65f commit cf51a3a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ClaudeCodeSharpSDK/Execution/ClaudeExec.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public sealed class ClaudeExec
5757

5858
private const string AnthropicApiKeyEnv = "ANTHROPIC_API_KEY";
5959
private const string AnthropicBaseUrlEnv = "ANTHROPIC_BASE_URL";
60+
private const string ClaudeCodeNestingEnv = "CLAUDECODE";
6061
private const string ContinueAndResumeConflictMessage = "ContinueMostRecent and ResumeSessionId cannot both be set.";
6162
private const string FlagAssignmentSeparator = "=";
6263
private const string ReplayUserMessagesUnsupportedMessage =
@@ -303,7 +304,9 @@ internal IReadOnlyDictionary<string, string> BuildEnvironment(string? baseUrl, s
303304

304305
foreach (DictionaryEntry variable in Environment.GetEnvironmentVariables())
305306
{
306-
if (variable.Key is string key && variable.Value is string value)
307+
if (variable.Key is string key
308+
&& variable.Value is string value
309+
&& !string.Equals(key, ClaudeCodeNestingEnv, StringComparison.OrdinalIgnoreCase))
307310
{
308311
environment[key] = value;
309312
}

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
1414
<AnalysisLevel>latest-recommended</AnalysisLevel>
1515
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
16-
<Version>1.0.1</Version>
16+
<Version>1.0.2</Version>
1717
<PackageVersion>$(Version)</PackageVersion>
1818

1919
</PropertyGroup>

0 commit comments

Comments
 (0)