From 51ee505057c75aa2158063d868706e71e7c2d922 Mon Sep 17 00:00:00 2001 From: mika kuns Date: Thu, 3 Sep 2026 07:22:59 +0200 Subject: [PATCH] fix(ui): strip CLAUDE_CODE_CHILD_SESSION/CLAUDECODE before every ConPTY launch ClaudeDo.App inherits its own process environment from whatever started it (e.g. a dev/test launch from inside a claude session). Every embedded claude.exe it spawns into a Mission Control tile then inherited those markers too, so the child session mistook itself for a subagent: transcript saving disabled and a degraded startup banner (white instead of orange, missing box rules). PtyTerminalSession.StartAsync is the one choke point all ConPTY launches already share for env handling, so clearing both vars there covers task, ad-hoc, planning, and list-handler sessions regardless of how ClaudeDo.App itself was started. --- src/ClaudeDo.Ui/Services/PtyTerminalSession.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ClaudeDo.Ui/Services/PtyTerminalSession.cs b/src/ClaudeDo.Ui/Services/PtyTerminalSession.cs index adf631ee..82980292 100644 --- a/src/ClaudeDo.Ui/Services/PtyTerminalSession.cs +++ b/src/ClaudeDo.Ui/Services/PtyTerminalSession.cs @@ -68,6 +68,14 @@ public sealed class PtyTerminalSession : IDisposable await WaitForLaunchGateAsync(s_launchGate, s_launchGateTimeout, ct); try { + // If ClaudeDo.App itself was started from inside a claude session (e.g. a dev/test + // launch), it inherits these markers and every embedded PTY session would otherwise + // inherit them too — the child claude then thinks it's a spawned subagent and + // disables transcript saving / degrades its own startup banner. Every ConPTY tile + // must look like a fresh top-level session regardless of how ClaudeDo.App was launched. + Environment.SetEnvironmentVariable("CLAUDE_CODE_CHILD_SESSION", null); + Environment.SetEnvironmentVariable("CLAUDECODE", null); + foreach (var (key, value) in descriptor.Env) Environment.SetEnvironmentVariable(key, value);