upvote
This kind of stuff often breaks for applications packaged with Nix, so it's often removed from Nix packages for compatibility reasons. Both behaviors you mention are helpfully patched out of the Claude Code package I use: https://github.com/numtide/llm-agents.nix/blob/dc285bfd94ec7...

As a result, I never knew that Claude Code does a nasty thing like this, either. :-\

Fwiw, packages in that repo get version bumped each day, so if that's a fast enough pace for you it may be a good alternative.

reply
If running systemd, wrap that crap into a cgroup and force kill the whole process tree on exit. I've been doing it for years with badly behaving applications. On phone, from memory, may not be exactly what is needed:

  systemd-run --user --pty --wait --collect -p TimeoutStopSec=5s -- "$@"
reply
And here is the issue raised in github: https://github.com/anthropics/claude-code/issues/14980

TLDR: They don't care.

reply