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);