claude-code-notifier
how it works guides faq
◐English
English العربية Deutsch Español Français עברית Italiano 日本語 한국어 Nederlands Polski Português (Brasil) Русский Türkçe Tiếng Việt 简体中文 繁體中文
Get started
All guides

Claude Code in tmux or screen: getting notified from a detached session

Updated 31 October 2026 · 6 min read
on this page 01Attached: let notifications through tmux 02Attached, but in another window: use the bell 03Say which session needs you 04Detached: you need a push 05Where Claude Code Notifier fits 06GNU screen 07FAQ

Inside tmux, Claude Code's desktop notifications never reach your outer terminal until you add set -g allow-passthrough on to ~/.tmux.conf. That fixes things while you are attached. Once you detach, no terminal is showing the session, so nothing on screen can alert you, but Claude Code keeps running and its hooks keep firing. To hear from a detached session, use a hook that sends a push over the network, to your phone or a chat app, instead of one that relies on a terminal.

01Attached: let notifications through tmux

tmux sits between Claude Code and your terminal and, by default, swallows the escape sequences Claude Code uses for desktop notifications. Anthropic's terminal guide gives this block for ~/.tmux.conf:

set -g allow-passthrough on
set -g focus-events on
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'

Apply it to the running server:

tmux source-file ~/.tmux.conf

allow-passthrough lets notifications and progress updates reach the outer terminal. The other lines fix Shift+Enter for newlines. With this in place, terminals that show Claude Code's notifications outside tmux (Ghostty, Kitty, and iTerm2 with alerts enabled) show them inside tmux too.

The same applies to hooks that return a terminalSequence. Anthropic's hooks reference says Claude Code writes these sequences itself, which works inside tmux and GNU screen. The macOS, Linux and SSH guides have examples.

02Attached, but in another window: use the bell

If Claude Code runs in one tmux window and you work in another, the bell is a simple signal. Tell Claude Code to always send one:

{
  "preferredNotifChannel": "terminal_bell"
}

Then make tmux act on it, in ~/.tmux.conf:

setw -g monitor-bell on
set -g bell-action other
set -g visual-bell off

monitor-bell (on by default) flags a window that rang its bell, and tmux marks it with ! in the status line. bell-action other passes bells from windows other than the one you are looking at on to your terminal, so the terminal can beep or bounce. Use any to include the current window too. Setting visual-bell to on shows a message in tmux instead of passing the bell on.

03Say which session needs you

With several sessions running, a notification that just says "Claude needs you" is not much help. A hook runs inside the pane's environment, so it can ask tmux for the session and window name. This Linux example shows them in a desktop notification:

#!/bin/bash
msg=$(jq -r '.message // "Claude Code needs your attention"')
where=""
if [ -n "$TMUX_PANE" ]; then
  where=$(tmux display-message -p -t "$TMUX_PANE" '#S:#W')
fi
notify-send "Claude Code ${where}" "$msg"

Save it as ~/.claude/hooks/notify-tmux.sh, run chmod +x on it and use it as a Notification or Stop hook command. #S is the session name and #W the window name; name your sessions with tmux new -s api-refactor and the notification tells you where to go. Swap notify-send for your platform's command, or for a push. The multiple sessions guide has more ways to tell sessions apart.

04Detached: you need a push

Detaching is the point of tmux: you start a long task, detach, and go. Claude Code keeps working in the detached session. But there is now no terminal to show an escape sequence or a bell, and if the tmux server was started over SSH, a desktop notification command may have nowhere to go either.

A hook that makes a network request does not care whether anyone is attached. Any push service works. The ntfy guide and the Telegram, Slack and Discord guide have hooks you can paste. These tell you something happened; they cannot answer Claude, so a permission prompt still waits until you reattach with tmux attach -t api-refactor.

05Where Claude Code Notifier fits

Claude Code Notifier is an independent tool (made by TouchTap, not by Anthropic) built on Claude Code's hooks. Its free command line tool, ccn, runs on Mac, Windows and Linux. Because it hooks into Claude Code rather than into a terminal, it works the same in tmux, screen or a plain shell, attached or detached:

curl -fsSL https://claudecodenotifier.com/install.sh | sh

On a desktop machine it shows a desktop notification when Claude finishes, needs a permission or asks a question. Pair a phone and the same events arrive as push notifications through TouchTap's encrypted relay, from any machine ccn runs on, including a server you reached over SSH.

The phone closes the gap a detached session leaves. When a permission comes up, you can allow once, allow for the session or deny from the phone, and Claude carries on without you reattaching. You can pick an answer when Claude asks a question, and send the next instruction right after Claude finishes. If you typed in the last 30 seconds, nothing waits for the phone and the terminal asks as usual. If you are away, the terminal waits for the phone's answer up to a ceiling you choose (hold_ceiling_seconds), and stops waiting the moment you touch the keyboard.

See pairing a phone, walking away from long tasks and the ccn page. The phone apps need a subscription or lifetime purchase; see pricing.

06GNU screen

screen works much like tmux for this. Anthropic's hooks reference says hook terminalSequence output works inside screen, and screen shows a message when a window you are not looking at rings its bell. Detached screen sessions have the same problem as detached tmux: nothing is on screen, so use a push.

07FAQ

Why do Claude Code notifications not show inside tmux?

tmux blocks the escape sequences Claude Code uses unless passthrough is on. Add set -g allow-passthrough on to ~/.tmux.conf and run tmux source-file ~/.tmux.conf.

Does Claude Code keep running when I detach from tmux?

Yes. The process keeps running in the tmux server, and its hooks keep firing. Only notifications that need an attached terminal stop reaching you.

How do I get notified from a detached tmux session?

Use a hook that sends a push over the network, such as ntfy, a chat webhook or Claude Code Notifier's phone app. Terminal escape sequences and bells need an attached client.

Can I approve a permission without reattaching?

Not with a plain push service. With Claude Code Notifier and a paired phone, you can allow or deny the request from the phone and the detached session carries on.

How can I tell which tmux session needs me?

Name your sessions and include the name in the notification. A hook can read it with tmux display-message -p -t "$TMUX_PANE" '#S:#W'.

Claude Code Notifier Get a push on your phone when Claude Code finishes or needs you, then approve, deny or answer from there. The ccn command line tool is free on Mac, Windows and Linux.
Download for iOS Download for Android Install ccn

Related guides

  • Notifications from Claude Code on a remote server over SSHRun Claude Code on a VPS or remote server over SSH and still get notified: terminal escape sequences that travel over SSH, or a phone push with ccn.
  • Running several Claude Code sessions: knowing which one needs youRunning parallel Claude Code sessions or worktrees? Name them, put the project in every alert, and send each request back to the right session.
  • Leave Claude Code running and walk away: a workflowA practical routine for long Claude Code tasks: keep the computer awake, cut needless prompts, get pinged on your phone and reply from there.
  • Claude Code's built-in notifications: the terminal bell and preferredNotifChannelHow Claude Code's built-in alerts work, what each preferredNotifChannel value does, and how to set up iTerm2, Apple Terminal, Kitty, Ghostty and tmux.
claude-code-notifier

Claude Code Notifier is an independent third-party application. It is not affiliated with, endorsed by, or sponsored by Anthropic, PBC. "Claude" and "Claude Code" are trademarks of Anthropic, PBC.

apps iOS App Android App ccn for macOS, Windows & Linux All guides
legal Privacy Policy Terms of Service Other languages © 2026 touchtap. All rights reserved. TouchTap Ltd is registered in England and Wales, company number 13942589.