iTerm2: CLI launches as daemon child session, blocking Agents panel / session switching
Open 💬 2 comments Opened Jul 6, 2026 by biokraft
Description
On iTerm2 (macOS), running claude starts the process routed through the background daemon as a child session (CLAUDE_CODE_CHILD_SESSION=1), even for a normal top-level terminal launch. This blocks the Agents panel and session switching.
Steps to reproduce
- Open iTerm2, run
claudein a new session. - Try to open the Agents panel / switch sessions (left-arrow in session picker).
- Error:
Cannot open agents — session persistence is disabled, so this conversation cannot be backgrounded.
Observed
echo $CLAUDE_CODE_CHILD_SESSION→1echo $CLAUDE_JOB_DIR→/Users/<user>/.claude/jobs/<id>ps -e | grep claudeshows a persistentclaude daemon run --origin transient --spawned-by {...}process, and the current session'sclaudeprocess appears spawned under--bg-pty-host/--bg-sparedaemon plumbing rather than as a standalone top-level process.- No shell alias/function wraps
claude—type clauderesolves directly to/Users/<user>/.local/bin/claude. - No custom iTerm2 profile startup command is set.
Expected
A plain claude launch in iTerm2 should be a normal top-level session with Agents panel and session-switching available, matching behavior in VS Code's integrated terminal (where this works correctly).
Environment
- Claude Code version: 2.1.201 (up to date via
claude update) - Terminal: iTerm2
- OS: macOS (Darwin 25.5.0)
- Install method: native
- Works correctly in: VS Code integrated terminal (same machine, same account)
Additional notes
Also observed a separate always-running daemon process spawned with --spawned-by {"label":"claude","cwd":"...","pid":...} with --origin transient, which may be related to how sessions get bound as children.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗