Claude Code notifications: सुनें कि वह कब इंतज़ार कर रहा है और कब काम पूरा हुआ
“A session that is blocked looks exactly like a session that is done, so I open the wrong one first.” (रुका हुआ session बिल्कुल पूरे हो चुके session जैसा दिखता है, इसलिए मैं पहले ग़लत वाला खोलता हूँ)। Claude Code की एक feature request की यह line पूरी बात कह देती है। यहाँ बताया गया है कि दोनों के लिए अलग signal कैसे पाएँ।
संक्षेप में
जब आप दूर हों, तब काम पूरा होने या permission का इंतज़ार करने पर Claude Code पहले से notification देता है, लेकिन default रूप से सिर्फ़ Ghostty, Kitty और iTerm2 उसे desktop notification के रूप में दिखाते हैं। बाक़ी जगहों पर "preferredNotifChannel": "terminal_bell" सेट करें। दो अलग sounds के लिए “आपकी ज़रूरत है” के लिए permission_prompt matcher वाला Notification hook और “काम पूरा” के लिए Stop hook इस्तेमाल करें।
Claude Code अपने आप क्या करता है
जब Claude कोई task पूरा करता है या permission prompt पर रुकता है, और लगता है कि आप terminal से दूर हैं, तो वह एक notification event fire करता है। Default रूप से वह इसे सिर्फ़ Ghostty, Kitty और iTerm2 में desktop notification में बदलता है। Windows Terminal, VS Code terminal, Warp और बाक़ी में, जब तक आप इसे सेट न करें, कुछ भी दिखाई नहीं देता।
सबसे आसान समाधान terminal bell है:
Bell क्या करती है, यह आपके terminal पर निर्भर है। Windows Terminal में bellStyle setting audible (default), window, taskbar, all या none हो सकती है। all के साथ Windows Terminal sound बजाता है और taskbar icon को चमकाता है।
- iTerm2: Settings → Profiles → Terminal → “Notification Center Alerts” चुनें, फिर Filter Alerts → “Send escape sequence-generated alerts” चालू करें।
- tmux:
~/.tmux.confमेंset -g allow-passthrough onजोड़ें, वरना notifications बाहरी terminal तक कभी नहीं पहुँचेंगी। - SSH पर: desktop notification वापस आपकी local मशीन तक आती है, इसलिए remote sessions भी आपको alert कर सकते हैं।
System notifications वाली feature request (#26581, 34 upvotes) को “पहले से उपलब्ध” कहकर बंद कर दिया गया, और ठीक इसी built-in notification की ओर इशारा किया गया। “इंतज़ार” और “पूरा” के लिए अलग signal वाली request (#94373) अब भी खुली है। यहीं hooks काम आते हैं।
दो events: Notification और Stop
Notificationतब fire होता है जब Claude Code कोई notification भेजता है। इसका matcher notification type है। आपके काम के दो types हैंpermission_prompt(Claude को किसी tool के इस्तेमाल के लिए आपकी मंज़ूरी चाहिए और prompt लगभग छह सेकंड से इंतज़ार कर रहा है) औरidle_prompt(Claude ने लगभग 60 सेकंड पहले जवाब पूरा किया और तब से आपने कुछ टाइप नहीं किया)।Stopहर बार fire होता है जब Claude जवाब देना पूरा करता है। जब आप बीच में रोकते हैं तब यह fire नहीं होता; API errors पर इसकी जगहStopFailurefire होता है।
Hooks built-in notification की जगह नहीं लेते, उसके साथ चलते हैं, इसलिए आप दोनों रख सकते हैं।
Windows: दो अलग sounds
Windows पर hooks Git Bash में चलते हैं, या Git Bash इंस्टॉल न होने पर PowerShell में। "shell": "powershell" सेट करने से अंदाज़े की गुंजाइश ख़त्म हो जाती है। यह configuration Claude को permission चाहिए होने पर ऊँची दोहरी beep और काम पूरा होने पर धीमी beep बजाता है:
Console.Beep hertz में frequency और milliseconds में duration लेता है, और beep ख़त्म होने तक इंतज़ार करता है। Anthropic की hooks guide में Windows का एक उदाहरण भी है जो System.Windows.Forms से message box खोलता है; उनके अपने नोट के अनुसार यह notification नहीं बल्कि dialog है और आपके terminal के पीछे खुल सकता है।
macOS और Linux
Anthropic के docs macOS पर afplay इस्तेमाल करते हैं:
दिखने वाले alert के लिए macOS पर osascript -e 'display notification "Claude needs you" with title "Claude Code"', या Linux पर notify-send "Claude Code" "Claude needs you"।
ऐसी बारीकियाँ जो आपकी एक शाम बचा देंगी
- Stop बहुत बार fire होता है। यह हर बार fire होता है जब Claude जवाब पूरा करता है, सिर्फ़ पूरा task ख़त्म होने पर नहीं। अगर यह बहुत ज़्यादा लगे, तो इसकी जगह
idle_promptnotification इस्तेमाल करें। यह लगभग एक मिनट इंतज़ार करता है और सिर्फ़ तभी fire होता है जब आपने कुछ टाइप न किया हो। - ज़रूरत हो तो event पढ़ें। Notification input में
message,titleऔरnotification_typeहोते हैं, इसलिए script असली request दिखा सकती है। - Agent view। अगर आप
claude agentsसे background sessions चलाते हैं, तो जब कोई session input का इंतज़ार करने लगता है, पूरा होता है या fail होता है, तब यह उसीpreferredNotifChannelसे आपको बताता है, औरagent_needs_inputयाagent_completedtype के साथ Notification hook fire करता है। - Terminal status। जो terminals OSC 7501 status protocol लागू करते हैं, वे दिखा सकते हैं कि हर Claude Code session काम कर रहा है, इंतज़ार कर रहा है या पूरा हो गया। Claude Code v2.1.295 या नया इसे अपने आप report करता है।
- Windows पर hook fire नहीं हो रहा? Windows पर Claude Code hooks काम नहीं कर रहे देखें। लगभग हमेशा वजह shell होती है।
कौन-सा session है यह देखना, और उसका जवाब देना
Sound बताती है कि कुछ हुआ। यह नहीं बताती कि आपके तीन terminals में से किससे आई, या Claude क्या चलाना चाहता है। Pet Island हर Claude Code session को आपकी स्क्रीन के ऊपर एक छोटे island पर जगह देता है: काम कर रहा है, आपका इंतज़ार कर रहा है, या पूरा हो गया। Permission request command या diff के साथ आती है, और आप उसे वहीं allow या deny करते हैं; सवाल और plans भी इसी तरह काम करते हैं। जब आप पास से देखना चाहें, तो एक click आपको ठीक उसी terminal पर ले जाता है।
अक्सर पूछे जाने वाले सवाल
क्या Claude Code में notifications हैं?
हाँ। जब आप दूर हों और वह काम पूरा करे या permission का इंतज़ार करे, तो वह notification fire करता है। Ghostty, Kitty और iTerm2 इसे default रूप से desktop notification के रूप में दिखाते हैं; दूसरे terminals में preferredNotifChannel को "terminal_bell" पर सेट करें या Notification hook जोड़ें।
Claude Code का काम पूरा होने पर sound कैसे पाऊँ?
एक Stop hook जोड़ें जो sound बजाए, जैसे macOS पर afplay या Windows पर PowerShell में [Console]::Beep।
“permission चाहिए” और “काम पूरा हुआ” में फ़र्क़ कैसे करूँ?
एक sound के लिए permission_prompt matcher वाला Notification hook और दूसरी के लिए Stop hook इस्तेमाल करें।
Windows Terminal या VS Code में notifications क्यों नहीं मिलतीं?
Claude Code default रूप से सिर्फ़ Ghostty, Kitty और iTerm2 में desktop notifications भेजता है। preferredNotifChannel को "terminal_bell" पर सेट करें या hook इस्तेमाल करें।
क्या notifications tmux के अंदर काम करती हैं?
हाँ, ~/.tmux.conf में set -g allow-passthrough on जोड़ने के बाद।
स्रोत
इस पेज की हर setting और हर व्यवहार को 26 अक्टूबर 2026 को इन पेजों से मिलाकर जाँचा गया। एजेंट तेज़ी से बदलते हैं; अगर कुछ अब मेल नहीं खाता, तो आधिकारिक पेज ही मान्य है।
- Claude Code docs: अपना terminal कॉन्फ़िगर करें (notifications)
- Claude Code docs: Hooks guide
- Claude Code docs: Hooks reference
- Claude Code docs: Agent view
- Issue #26581: Claude को ध्यान चाहिए होने पर system notifications
- Issue #94373: इंतज़ार और पूरा होने के लिए अलग notification
- Issue #2427: Task पूरा होने पर audio notification
- Microsoft Learn: Windows Terminal profile settings (bellStyle)
- Microsoft Learn: Console.Beep