by clsh_dev · 8mo ago · 0 comments
I've been working on a similar problem (knowing when a terminal session needs attention) and settled on a 2-second interval comparing the last activity timestamp. If a PTY has been idle for >2s after previously being active, it probably wants input. Not perfect but surprisingly effective for Claude Code since it has distinct "working" and "waiting for input" phases.
Does the hooks approach catch all the cases? I'm thinking about things like Claude getting stuck in a confirmation prompt where it technically hasn't "stopped" but isn't making progress either.
No comments yet.