mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-04 06:29:42 +02:00
feat: add CLAUDEMAN_SCREEN env var to inform Claude sessions
Claude sessions spawned by Claudeman now receive environment variables: - CLAUDEMAN_SCREEN=1 - Indicates running within Claudeman - CLAUDEMAN_SESSION_ID - The session's unique identifier - CLAUDEMAN_SCREEN_NAME - The GNU Screen session name (when applicable) This helps prevent Claude from attempting to kill its own screen session and allows sessions to be aware of their managed environment. Also updated the default CLAUDE.md template to document this behavior. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -108,9 +108,12 @@ export class ScreenManager extends EventEmitter {
|
||||
const screenName = `claudeman-${sessionId.slice(0, 8)}`;
|
||||
|
||||
// Create screen in detached mode with the appropriate command
|
||||
// Set CLAUDEMAN_SCREEN=1 so Claude sessions know they're running in Claudeman
|
||||
// This helps prevent Claude from attempting to kill its own screen session
|
||||
const envVars = `CLAUDEMAN_SCREEN=1 CLAUDEMAN_SESSION_ID=${sessionId} CLAUDEMAN_SCREEN_NAME=${screenName}`;
|
||||
const cmd = mode === 'claude'
|
||||
? 'claude --dangerously-skip-permissions'
|
||||
: '$SHELL';
|
||||
? `${envVars} claude --dangerously-skip-permissions`
|
||||
: `${envVars} $SHELL`;
|
||||
|
||||
try {
|
||||
// Start screen in detached mode
|
||||
|
||||
Reference in New Issue
Block a user