Skip to content

fix: resolve posix_spawnp and nested session spawn failures on macOS#9

Open
k7cfo wants to merge 1 commit intoArk0N:masterfrom
k7cfo:fix/spawn-failures
Open

fix: resolve posix_spawnp and nested session spawn failures on macOS#9
k7cfo wants to merge 1 commit intoArk0N:masterfrom
k7cfo:fix/spawn-failures

Conversation

@k7cfo
Copy link

@k7cfo k7cfo commented Feb 14, 2026

Summary

Two issues prevent Claude from spawning in certain environments on macOS:

  • posix_spawnp failed: node-pty's spawn-helper prebuild binary loses its execute permission during npm install, causing every pty.spawn() call to fail. Fixed by adding chmod +x in postinstall.js for the darwin prebuilds.

  • CLAUDECODE env var leak: When Claudeman is launched from within an existing Claude Code session (e.g. via Claude Code's Bash tool), the CLAUDECODE=1 environment variable propagates into tmux and direct PTY child processes. Claude CLI detects this and refuses to start with "cannot be launched inside another Claude Code session". Fixed by unsetting CLAUDECODE in both the tmux session command and the direct PTY env object.

Changes

  • scripts/postinstall.js — chmod spawn-helper prebuilds to 755 after install
  • src/tmux-manager.ts — prepend unset CLAUDECODE to tmux session env exports
  • src/session.ts — delete CLAUDECODE from env passed to pty.spawn() in all three spawn paths (tmux attach, direct PTY, shell mux attach)

Test plan

  • Verified npm run build passes
  • Verified claudeman web starts and sessions spawn Claude successfully after fix
  • Tested on macOS arm64 (Darwin 25.2.0, Node 25.2.1)

Two issues prevented Claude from spawning in certain environments:

1. node-pty's spawn-helper binary loses execute permission during npm
   install, causing posix_spawnp to fail on every PTY spawn. Fixed by
   adding chmod in postinstall.

2. When Claudeman is launched from within a Claude Code session, the
   CLAUDECODE env var leaks into child processes, causing Claude CLI
   to refuse to start ("cannot be launched inside another Claude Code
   session"). Fixed by unsetting CLAUDECODE in both tmux and direct
   PTY spawn paths.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant