--- name: osc7501-vs-hooks description: "Claude Code's OSC 7501 Program Status cannot replace AgentHub hooks — tested 2026-10-09 on 2.1.295; works only on a terminal that answers its startup probe, and not through tmux" metadata: node_type: memory type: reference originSessionId: 0b101e16-e1e6-4423-9539-49ddea37ddf0 modified: 2026-10-09T04:16:29.852Z --- Tested on 2026-10-09 with Claude Code 2.1.295, using a Python pty fake terminal and a private `tmux -L` server. **Format.** Claude probes `ESC ] 7501 ; ? ST` once at startup. It reports only if the terminal answers with an OSC 7501 whose data starts with `?`. Each report looks like `ESC ] 7501 ; state=:app=claude-code[:id=][:kind=][:progress=][:title=][:msg=] ST`. - `state` takes the values idle, working, blocked, done, failed and clear. - `blocked` comes with `kind=permission` and `msg` = "approve Bash: ". - `working` comes with `msg` = a one-line description of what it is doing. - There is no session id, no tool events, no subagents and no tokens. **Results.** 1. Direct pty, probe answered: idle → working → (blocked:permission) → done. This works. 2. Probe not answered: nothing is ever reported. 3. Inside tmux: the probe never reaches an attached client, with or without `allow-passthrough on`, and whether the pane started detached (like AgentHub) or attached. So nothing is reported. 4. tmux `pipe-pane` DOES see the raw probe. Replying with `send-keys -H` did NOT turn reporting on. Likely cause, unverified: tmux answers the DA1 sentinel first, so Claude has already given up on the probe. **Conclusion:** OSC 7501 cannot replace hooks, and does not even work in AgentHub's tmux panes. Hooks give session id binding, tool events, subagents and transcript paths, and OSC 7501 has none of these. The only route that would work is a small pty proxy wrapped around `claude` in each pane, which answers the probe itself and forwards states. That is a new process in every pane, for a coarse live state that hooks (Notification/Stop) already give. Not worth it unless a tool with no hooks ever speaks OSC 7501. Related: [[claude-code-changelog-2-1-293]].