Decisions, environment quirks and pitfalls learned while working on AgentHub (docs/claude-memory/, indexed by MEMORY.md). Notes holding personal account details are left out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2.1 KiB
name, description, metadata
| name | description | metadata | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| osc7501-vs-hooks | 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 |
|
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=<s>:app=claude-code[:id=][:kind=][:progress=][:title=<b64>][:msg=<b64>] ST.
statetakes the values idle, working, blocked, done, failed and clear.blockedcomes withkind=permissionandmsg= "approve Bash: ".workingcomes withmsg= a one-line description of what it is doing.- There is no session id, no tool events, no subagents and no tokens.
Results.
- Direct pty, probe answered: idle → working → (blocked:permission) → done. This works.
- Probe not answered: nothing is ever reported.
- 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. - tmux
pipe-paneDOES see the raw probe. Replying withsend-keys -Hdid 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.