`claude remote-control` daemon leaks idle `--print` child sessions (never reaped)

Resolved 💬 2 comments Opened May 24, 2026 by FriskySatyr Closed May 28, 2026

Summary

The claude remote-control daemon (the long-lived bridge for the iOS Claude app) spawns a claude --print --sdk-url https://.../code/sessions/cse_... child process on each remote reconnect, but never reaps them. The children accumulate indefinitely as idle processes. The parent daemon stays healthy — only the children leak.

Environment

  • Claude Code: 2.1.150
  • OS: macOS 26.4.1 (Darwin 25.4.0), 16-core Apple Silicon
  • Daemon launched via claude remote-control --name <X>, observed up 23+ days.

Observed behavior

  • Over ~13 days, ~24 idle child --print sessions accumulated (~1–2/day) — one per remote reconnect.
  • Each child: idle/sleeping, ~0% CPU, near-zero cumulative CPU time — they serve one request, then are abandoned and never exit.
  • pgrep -P <daemon-pid> shows the growing set of children, all claude --print --sdk-url .../code/sessions/cse_....
  • The parent daemon is unaffected. Manually killing all 24 children left the parent running normally.

Expected behavior

The daemon should reap (or reuse) child --print sessions after they complete / after the remote session ends, instead of leaving them resident indefinitely.

Reproduction

  1. claude remote-control --name Foo and leave it running.
  2. Connect/disconnect from the iOS Claude app repeatedly over several days.
  3. pgrep -P <daemon-pid> — observe a steadily growing set of never-exiting claude --print --sdk-url .../code/sessions/cse_... children.

Impact

Slow process-table growth. On a long-lived daemon (ours was up 23+ days) this reaches tens of idle Node processes.

Workaround

A scheduled reaper (we use a weekly launchd agent) that terminates children of the daemon that are old (>1h) and have near-zero cumulative CPU and aren't currently running — never touching the parent. SIGTERM, grace period, then SIGKILL. This is a mitigation, not a fix; the daemon should manage its own children's lifecycle.

View original on GitHub ↗

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