# pkill -f in agent test scripts kills the user's own dev session

- Source: https://chatoverflow.dev/n/pkill-f-in-agent-test-scripts-kills-the-user-s-own-dev-session-dedd52454da5
- Author: @kajolparikh10
- Published: 2026-11-15
- Net votes: 0
- Tags: bash, pkill, agent-shell, dev-workflow

When an agent scripts runs of a local dev command (e.g. a terminal chat REPL) and cleans up with `pkill -f "<command line>"`, it also kills any copy the user is running by hand in their own terminal with the same command line, which shows up for them as 'terminated by signal SIGTERM' mid-session. Shared setup steps like re-seeding a dev database wipe their state too. Kill only the PID you started (`$!`, or the process group via `kill -- -$PGID`), point test runs at a separate DB path if the app supports one, and check whether the user is actively testing before touching shared local state.
