Notifications via OSC 777 don't work when Claude Code runs hooks in a non-TTY subprocess
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with warp-notify.sh and its should_use_structured() path, then reproduce a Stop, PromptSubmit, or PostToolUse hook under the non-TTY Claude Code subprocess conditions described. Compare the proposed notification transports and establish which one the project will implement; done means notifications reach Warp from these hooks without relying on the subprocess TTY.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
The Warp plugin for Claude Code sends terminal notifications using OSC 777 escape sequences
(\033]777;notify;...) written directly to /dev/tty. However, Claude Code executes hook scripts as
child subprocesses that are not attached to a TTY — their stdin/stdout/stderr are all
redirected (stdin → /dev/null, stdout/stderr → temp files).
As a result, all notification writes fail silently:
printf '...' > /dev/tty→No such device or address>&2(stderr fallback) → captured by Claude Code harness, never reaches terminal>&1(stdout fallback) → same, captured|| true→ all errors swallowed silently
Reproduction
- Install Warp terminal + Claude Code with the
claude-code-warpplugin - Run any task in Claude Code
- The Stop/PromptSubmit/PostToolUse hooks fire, but no notification appears in Warp
Environment
- Warp:
v0.2026.04.29.08.57.stable_02 WARP_CLI_AGENT_PROTOCOL_VERSION=1WARP_CLIENT_VERSION=v0.2026.04.29.08.57.stable_02- Platform: Windows 11 (WSL/MINGW64)
- Claude Code hook subprocess: stdin→
/dev/null, stdout→temp file, stderr→temp file
Root Cause
Claude Code's hook execution model redirects all FDs of child processes. OSC 777 sequences written by
the hook subprocess cannot reach the Warp terminal because:
- The subprocess has no TTY of its own
- stdout/stderr are piped to Claude Code's internal harness, not to the terminal
Proposed Solutions
Option 1: Warp CLI notification command (recommended)
Provide a warp notify (or similar) CLI command that hook subprocesses can invoke. The CLI
communicates with the Warp terminal via IPC/shared memory to deliver the notification, bypassing the
TTY requirement entirely.
# Instead of:
printf '\033]777;notify;...' > /dev/tty
# Use:
warp notify --title "Task Complete" --body "..."
Option 2: Claude Code host forwards OSC sequences
Claude Code's main process (which IS connected to the Warp terminal via the Warp pipe) could parse
hook subprocess stderr output for OSC 777 sequences and forward them to the terminal.
Option 3: Use Claude Code's built-in notification mechanism
If Claude Code exposes a structured way for hooks to request notifications (e.g., via JSON output with
a notification field), Warp could handle rendering those directly.
Additional Context
The warp-notify.sh script already handles version detection and graceful fallback via
should_use_structured(), so the notification infrastructure is sound — it just needs a transport
mechanism that works from non-TTY subprocesses.
- Lingua principale
- Shell
- Stelle
- 232
- Fork
- 56
- Merge medio
- 4g 15h
- PR unite (30g)
- 1
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di warpdotdev/claude-code-warp
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
warpdotdev/claude-code-warp#63 · 2 commenti ·
Tutte le issue di warpdotdev/claude-code-warp
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
area:kubernetes area:site priority:high source:automated type:content-request
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
stephrobert/blog-roadmap#58 ·
-
Installer: install_sudoers_file schreibt nicht atomar und löscht bei Fehler eine gültige RegelApertaenhancement severity:low
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nushell/nushell#19176 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno