[FEATURE] Support terminal notifications when running inside tmux
Status Fixed / completed
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 11 comments · opened Jan 22, 2026 · closed Aug 17, 2026
Problem Statement
Claude Code's desktop notifications don't work when running inside tmux. This is because tmux requires applications to wrap OSC sequences in DCS passthrough format, but Claude Code sends plain OSC sequences.
Proposed Solution
Detect when running inside tmux (via $TMUX environment variable) and wrap notification sequences in DCS passthrough format:
# Plain (current):
printf '\033]9;message\007'
# DCS-wrapped for tmux:
printf '\033Ptmux;\033\033]9;message\007\033\\'
This is the standard pattern used by other terminal tools (imgcat, etc.).
Alternative Solutions
Users can create a notification hook as a workaround.
1. Create ~/.claude/hooks/tmux-notify.sh:
#!/bin/bash
# Only wrap for tmux - let Claude Code handle non-tmux natively
[ -z "$TMUX" ] && exit 0
read -r input
message=$(echo "$input" | jq -r '.message // "Claude Code"')
# Must output to /dev/tty - hook stdout is captured by Claude Code
printf '\033Ptmux;\033\033]9;%s\007\033\\' "$message" > /dev/tty
2. Add to ~/.claude/settings.json:
{
"hooks": {
"Notification": [
{
"hooks": [{ "type": "command", "command": "~/.claude/hooks/tmux-notify.sh" }]
}
]
}
}
This workaround requires manual setup and isn't discoverable by users.
Additional Context
- Requires tmux 3.3+ with
allow-passthrough on(orall) - Related: #6072
Showing cached comments. Read the full discussion on GitHub ↗
10 Comments
You can also try
workmuxas it has status tracking: https://workmux.raine.dev/guide/status-trackingamp has a pre-installed skill to configure this for the user. And they use the
\ePtmux;...\e\\escape sequence when running inside tmux.claude-code should also support this behavior.
I built this recently to solve this issue: C3Poh - a Telegram comms bridge for Claude Code. Your agent DMs you when it's done (or when something goes wrong), and you can DM it back to kick off new tasks.
Pure stdlib Python, no inbound ports (long-polling), allowlist-based access control so only you can reach it. Community channel if you run into anything: t.me/tinmanc3poh
+1 — experiencing this with Ghostty + tmux 3.6a. Have
allow-passthrough onset but notifications don't come through.Progress bar (OSC 9;4) also doesn't work in tmux
Adding a data point: the OSC 9;4 progress bar (Ghostty's sweeping indeterminate indicator) also fails to appear inside tmux, same root cause.
Setup:
set -g allow-passthrough onin tmux.confVerified passthrough works manually:
So tmux DCS passthrough is functional — Claude Code just isn't wrapping the sequences.
The v2.1.78 changelog reportedly added tmux passthrough support, but it doesn't appear to be working as of 2.1.80.
2.1.78 supposedly fixed this problem but I can also confirm it does not work.
notifications were working fine for me in tmux until recently. 2.1.78 seems to have broken my setup
i'm on tmux 3.2a, iterm2, leveraging iterm's tmux integration (
-CC)I see this appear the bottom of my window now instead of the actual notification:
<img width="336" height="33" alt="Image" src="https://github.com/user-attachments/assets/99c7577f-0b3d-4016-a1b8-4197b7c0389f" />
update: downgraded to 2.1.77 and notifications work again. so, 2.1.78 clearly broke something
For anyone hitting this in SSH + tmux setups — I built a workaround as part of cc-clip (originally a clipboard bridge for image paste over SSH).
The approach bypasses OSC entirely: Claude Code's
StopandNotificationhooks pipe JSON to a small script that forwards it through the SSH reverse tunnel to a local daemon, which then delivers via macOS Notification Center (or terminal-notifier).Works regardless of tmux, screen, or terminal emulator since it doesn't rely on escape sequence passthrough at all. Setup is basically: install a hook script on the remote, configure Claude Code's hooks to use it.
Details in the SSH Notifications section of the README. Hope it helps someone dealing with the same frustration!
For tmux users where the
Notificationhook never fires, this hook config works withoutallow-passthrough— it bypasses OSC entirely and writes\ato the Claude pane's tty:Combined with default
monitor-bell on+window-status-bell-style reverse, the Claude window-status entry inverts on end-of-turn and tool-permission prompts.Doesn't cover
AskUserQuestion— no current hook fires for it (#15872, #13830, #44326).Until this is fixed upstream, I put together a more complete workaround that's been working well for me on iTerm2 + tmux:
https://github.com/zywind/claude-iterm-tmux-notifications
It builds on the DCS-passthrough fix mentioned here, plus a few things I hit along the way:
Wired to Stop (finished a turn) + Notification/permission_prompt. Requires set -g allow-passthrough on. README has full setup.