runon
The agent said it was done. Some of what it started didn't hear.
runon finds the processes Claude Code, Codex and OpenCode started that are still running after the tool call, the stop, or the whole session ended, tells you why, and stops exactly those.
The three turning cylinders are real rows from runon demo --json on Linux (CPU is the measured value). The three that stop are ordinary calls that ended with their tool call, drawn for contrast.
Upper platform 01
What it prints
Run runon and it reads the process table once. Every row says which agent and session started the process, why runon thinks nobody is holding it anymore, and which tool call launched it, quoted from the session log.
runon demo on Linux at 92 columns. The colours are the ones the terminal shows.Middle platform 02
How it knows who started what
No guessing by process name. Coding agents stamp the commands they run with environment variables, and the kernel keeps them for the life of the process, so runon reads them back:
| Agent | Stamp runon reads | What it adds |
|---|---|---|
| Claude Code | CLAUDECODE=1 CLAUDE_CODE_SESSION_ID | the session, then the Bash call in ~/.claude/projects/…/<session>.jsonl |
| Codex | CODEX_THREAD_ID CODEX_TOOL_CALL_ID | the exact tool call, and whether it already returned in the rollout file |
| OpenCode | OPENCODE=1 OPENCODE_SESSION_ID | the session |
Then it walks up the parent chain, checking each parent's start time so a recycled PID is never mistaken for the harness. Each tree lands in one of three states:
- OUTLIVED
- No live harness above it. The session ended, or the harness killed the shell and the shell's children kept going, which is how a stopped background task leaves a dev server behind.
- RETURNED
- Codex only: the harness is alive, but the rollout already has the output of the tool call that started it. It is shown, and left alone unless you say
--returned. - LIVE
- Still attached to a running agent. Listed with
runon --all, never stopped by default.
Floor plates 03
Stopping exactly those
runon stop --dry-runprints the trees and PIDs it would signal. Nothing is sent.runon stopasks once, then sends TERM deepest child first, waits three seconds, and sends KILL only to what is left. Before every signal it checks the PID still belongs to the same process.runon stop --returned·--session 3f2a·--pid 4121widen or narrow the selection. It refuses to signal a harness or its own parents.
Or let the session clean up after itself
runon hook claude prints a Claude Code SessionEnd hook. When a session ends it stops that session's processes and nothing else; /clear is ignored.
{
"hooks": {
"SessionEnd": [
{ "hooks": [ { "type": "command", "command": "runon stop --hook", "timeout": 15 } ] }
]
}
}
Tank top 04
Install
curl -fsSL https://blackman99.github.io/runon/install.sh | sh
Static binaries for Linux (x86_64, arm64), macOS (arm64, x86_64) and Windows (x86_64, arm64) are on the release page, with checksums.txt; the installer checks it. Or build it: cargo install --git https://github.com/Blackman99/runon.
No agent handy? runon demo starts three throwaway sessions with real child processes, so you can watch it find and stop them. They exit by themselves after ten minutes.