Image: GitHub
Why it mattersCoding agents often match their own process when they try to kill a stuck port. A tool with safer verbs and clear exit codes stops that.
A coding agent that tries to kill a stuck dev server can match its own name and shut itself down. Yazeed Aloyoun released proc-cli to prevent that. It is a Rust tool for both the working developer and the coding agent. The project was posted as a Show HN on 26 October. It had 20 points when read.
The tool replaces short recipes that mix lsof, grep and kill with one named command. proc on 3000 says what is holding a port. proc free 3000 frees it and checks the port is open again. proc tree, proc stuck and proc orphans list parent and child processes, hung ones, and ones whose parent is gone. It runs on macOS, Linux and Windows.
Why an agent needs this
Yazeed writes on Hacker News that an agent is bad at killing processes. One commenter saw an agent kill itself before it reached the right process. Another developer says their agent kept matching the wrong process. Two processes had similar names. They wrote a tracking file by hand to stop it. A third commenter shows a safer pgrep pattern. It uses a bracketed character so the regex does not match itself.
Proc-cli includes an agent skill for Claude Code, Codex, Cursor and Gemini CLI. The skill is installed with npx skills add yazeed/proc-cli. It tells the agent to use --json output. It tells the agent to call --dry-run first. And it tells the agent to read exit codes. Each code has one meaning. 0 is success. 1 is error. 2 is not found. 3 is permission denied. 4 is invalid input. An agent that reads 3 can ask the user for a password rather than retry.
What is in it
The commands sit in three groups. Discovery covers on, for, by, list, info, ports, tree, watch, why, orphans and stuck. Lifecycle covers kill, stop, freeze, thaw, free, wait and unstick. Filters cover working directory, process name, CPU and memory thresholds, port ranges and status. The tool is MIT licensed. The repository had 51 stars and 2 forks when read. It installs with Homebrew, Cargo, npm, bun, Scoop, Nix, Docker or a shell script.
The pitch is small. A single word is easier to guess than a pipeline. A single command returns the same shape to a person and to a machine. A step like "stop the test server on port 4479" is now one call. The agent can report back with a code the runner can read. That is one less place where an unattended agent can hit a tree it did not mean to touch.
Source
yazeed/proc-cli on GitHub. Launch post: Show HN: Proc-CLI.
This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.
Get AI News in your inbox
New developer tools, model and agent releases, and how teams are actually using them to release software. Short, and only when there is something worth reading.