fix(happy-cli): strip CLAUDECODE env var from daemon-spawned sessions#691
Open
davidrimshnick wants to merge 1 commit intoslopus:mainfrom
Open
fix(happy-cli): strip CLAUDECODE env var from daemon-spawned sessions#691davidrimshnick wants to merge 1 commit intoslopus:mainfrom
davidrimshnick wants to merge 1 commit intoslopus:mainfrom
Conversation
85c71f1 to
e39cad3
Compare
When the daemon is started from within a Claude Code session (e.g. VS Code terminal), it inherits CLAUDECODE=1. This was passed to child session processes, causing Claude Code to refuse to launch with "cannot be launched inside another Claude Code session". Strip CLAUDECODE from process.env before spawning session processes. Fixes slopus#682 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
e39cad3 to
df7e4c0
Compare
Author
|
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
happy daemon startis run from within a Claude Code session (VS Code terminal, Claude Code CLI, etc.), the daemon inheritsCLAUDECODE=1in its environmentprocess.envCLAUDECODE=1and refuses to start with "cannot be launched inside another Claude Code session", causing every remote session to immediately fail with "Process exited unexpectedly"CLAUDECODEfromprocess.envbefore spawning session processesFixes #682
Test plan
CLAUDECODEis stripped while other env vars are preservedextraEnvstill merges correctly after stripping🤖 Generated with Claude Code