remote-control doesn't reap finished --print child sessions, leaks memory over time

Status Open
Maintainer reply None cached
Activity 0 comments · opened Jul 18, 2026

Environment: Claude Code CLI, remote-control/FleetView agent mode, persistent daemon on Linux (TrueNAS SCALE).

What happened: The daemon spawns a claude.exe --print --sdk-url ... --session-id ... child per task, meant to run once and exit. Many never exit — idle at 0.1–0.3% CPU indefinitely, still direct children of the live daemon (confirmed via ps -ef --forest, not reparented to init — the parent just isn't reaping them). Over ~1 week, 26 accumulated, ~5.2GB RSS, some 7+ days old, exhausting 8GB of swap and degrading unrelated services on the host.

Repro: Run remote-control for days with repeated task invocations; periodically check ps -eo pid,etimes,cputimes,args | grep 'claude.exe --print' — expect entries with high age, flat CPU time, shared PPID with the daemon.

Expected: parent should wait-on/terminate each --print child once its turn completes.

Impact: unbounded memory growth on any long-lived remote-control host — the norm for this use case, not an edge case.

Workaround in place: host-side cron watchdog killing only 24h+-old, CPU-flat sessions, always leaving the newest alive.

View original on GitHub ↗