Reading agent status out of Claude Code's hooks Claude Code 2.1.220's hooks do not cleanly map to agent status, so a developer still relies on screen scraping for three edge cases: Notification events include non-blocking types like idle prompts, a question at the end of a turn triggers Stop but leaves the session waiting, and pressing Esc during a turn leaves the status stuck on 'working'. Writing Reading agent status out of Claude Code's hooks I wanted a list of running agents that told me which one is working, which is blocked, and which is done, without me looking at any of them. The obvious way is to read the screen. Capture the pane, run some regexes, guess. That works for any CLI, which is why I still do it for every tool I support. But it is guessing. A spinner drops for one frame and the agent looks idle. Something prints a line that looks like a spinner and it looks busy. Claude Code has hooks, so for those sessions the guessing should not be necessary. Mostly it is not. This post is about the places where the event stream does not map cleanly onto a status, and the three gaps I still cover with the pane. Everything below is against Claude Code 2.1.220. The setup setup Each managed session starts with a generated settings file --settings and one env var pointing at a status file: AGENT MANAGER STATUS FILE=/…/hooks/