Files
nntrivi2001 9c573f1e3c docs: snapshot of the project's Claude Code memory
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>
2026-10-13 15:27:35 +07:00

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
node_type type originSessionId modified
memory reference 0b101e16-e1e6-4423-9539-49ddea37ddf0 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=<s>:app=claude-code[:id=][:kind=][:progress=][:title=<b64>][:msg=<b64>] 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.