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

  1. Open iTerm2, run claude in a new session.
  2. Try to open the Agents panel / switch sessions (left-arrow in session picker).
  3. Error: Cannot open agents — session persistence is disabled, so this conversation cannot be backgrounded.

Observed

  • echo $CLAUDE_CODE_CHILD_SESSION1
  • echo $CLAUDE_JOB_DIR/Users/<user>/.claude/jobs/<id>
  • ps -e | grep claude shows a persistent claude daemon run --origin transient --spawned-by {...} process, and the current session's claude process appears spawned under --bg-pty-host / --bg-spare daemon plumbing rather than as a standalone top-level process.
  • No shell alias/function wraps claudetype claude resolves 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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗