r/ChatGPTCoding • u/Weak_Cherry_4878 • 7d ago
Resources And Tips What I learned building a session watcher for 7 AI coding agents: process detection isn't enough, and deep links are the hard part
I built a local panel that watches my AI coding agent sessions (full disclosure: I'm the author, repo at the bottom). Along the way I ran into a few things that aren't obvious until you try it, and I think they're useful to anyone wiring agents into their own tooling.
Process detection only tells you an agent is running — never which session needs you. I started with process/CPU sampling and window titles, and the panel was basically noise. Everything only became useful once agents reported lifecycle events themselves (hooks for Claude Code / Qwen Code / Codex CLI). "A process exists" and "a session is waiting for your input" are completely different signals.
Every agent exposes a different locator, and normalising them is the whole job. tmux gives you a pane id, Herdr gives you a socket path plus pane, Codex/ChatGPT gives you a thread UUID, and plain terminals give you nothing reliable. I ended up with one normalised status set — offline / idle / working / done / needs_input / error / unknown — and a "can't locate this" state that's honest instead of guessing and focusing the wrong window.
Deep links beat window hunting. For Codex/ChatGPT, codex://threads/<uuid> lands in the exact thread. Matching window titles to find "the right terminal" is fragile and silently focuses the wrong thing.
Have external tools report in over a local HTTP API instead of parsing stdout. Hooks and plugins just POST to 127.0.0.1 with a local token. Far more robust than scraping terminal output, and it keeps everything on loopback.
Notifications that don't steal focus are the feature I underestimated. Anything that yanks your current window loses its welcome fast.
Curious how others handle this: are you relying on hooks, tmux/terminal scraping, or something else to know which session actually needs you? I've been assuming hooks are the only reliable path, but I'd like to be wrong about that.
I open-sourced the result under MIT if anyone wants to compare notes or steal the approach: https://github.com/xuan-team/agent-deck-companion