From 49382010d8a5c139c1480057a2ca9098521976c6 Mon Sep 17 00:00:00 2001 From: Li_Xufeng Date: Mon, 13 Apr 2026 15:06:16 +0800 Subject: [PATCH 1/3] docs: add Windows symlink prerequisite --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 6c4c827783..d537ebf0d1 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,12 @@ curl -fsSL https://claude.ai/install.sh | bash irm https://claude.ai/install.ps1 | iex ``` +**Windows Symbolic Link Prerequisite** + +Windows users: Archon creates symlinks under `~/.archon/workspaces/` for project registration. Windows requires either: +- **Developer Mode enabled** (Settings → Privacy & Security → For developers → Developer Mode) +- or running Archon with **administrator privileges** + ```bash From 3e3b864f5fe3839dcd009fe2bc41fcf83ccfb0c1 Mon Sep 17 00:00:00 2001 From: Li_Xufeng Date: Mon, 13 Apr 2026 15:20:28 +0800 Subject: [PATCH 2/3] fix(core): make EnvLeakError suggested-fix command use actual offending keys --- packages/core/src/utils/env-leak-scanner.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/core/src/utils/env-leak-scanner.ts b/packages/core/src/utils/env-leak-scanner.ts index 48edc2c6b7..b2468eddaf 100644 --- a/packages/core/src/utils/env-leak-scanner.ts +++ b/packages/core/src/utils/env-leak-scanner.ts @@ -132,6 +132,18 @@ export function formatLeakError( const consent = consentCopy(context); + // Collect all unique keys from findings + const allKeys = new Set(); + report.findings.forEach(finding => { + finding.keys.forEach(key => allKeys.add(key)); + }); + const keysArray = Array.from(allKeys); + + // Generate grep command that excludes all detected keys + const grepCommand = keysArray + .map(key => `grep -v '^${key}='`) + .join(' | ') + ' .env > .env.tmp && mv .env.tmp .env'; + return `${header} Found: @@ -145,7 +157,7 @@ ${fileList} Choose one: 1. Remove the key from this repo's .env (recommended): - grep -v '^ANTHROPIC_API_KEY=' .env > .env.tmp && mv .env.tmp .env + ${grepCommand} 2. Rename to a non-auto-loaded file: mv .env .env.secrets From 3a4e017907c36ae70df0a695665f756e9610d33e Mon Sep 17 00:00:00 2001 From: Li_Xufeng Date: Mon, 13 Apr 2026 15:24:57 +0800 Subject: [PATCH 3/3] fix(core): prevent CLAUDE_CODE_ENTRYPOINT from leaking to Claude subprocess --- packages/providers/src/claude/provider.ts | 28 ++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/packages/providers/src/claude/provider.ts b/packages/providers/src/claude/provider.ts index 7b2f0f44df..9399f59438 100644 --- a/packages/providers/src/claude/provider.ts +++ b/packages/providers/src/claude/provider.ts @@ -73,6 +73,10 @@ function normalizeClaudeUsage(usage?: { * process.env is already clean at this point: * - stripCwdEnv() at entry point removed CWD .env keys + CLAUDECODE markers * - ~/.archon/.env loaded with override:true as the trusted source + * + * Double-filter here to be extra safe — ensures no CLAUDE_CODE_* markers leak + * to the subprocess, even if stripCwdEnv() was bypassed or if platform-specific + * env inheritance adds them back. */ function buildSubprocessEnv(): NodeJS.ProcessEnv { const hasExplicitTokens = Boolean( @@ -83,7 +87,29 @@ function buildSubprocessEnv(): NodeJS.ProcessEnv { { authMode }, authMode === 'global' ? 'using_global_auth' : 'using_explicit_tokens' ); - return { ...process.env }; + + // Create a clean copy of process.env + const env = { ...process.env }; + + // Filter out CLAUDE_CODE_* markers (keep only auth-related ones) + const CLAUDE_CODE_AUTH_VARS = new Set([ + 'CLAUDE_CODE_OAUTH_TOKEN', + 'CLAUDE_CODE_USE_BEDROCK', + 'CLAUDE_CODE_USE_VERTEX', + ]); + + for (const key of Object.keys(env)) { + if (key.startsWith('CLAUDE_CODE_') && !CLAUDE_CODE_AUTH_VARS.has(key)) { + delete env[key]; + } + } + + // Also remove CLAUDECODE marker if present + if (env.CLAUDECODE) { + delete env.CLAUDECODE; + } + + return env; } /** Max retries for transient subprocess failures */