匠人学院 JR Academy
Skip to article
Learning guide
Claude Guide

Use Claude for writing, analysis, coding support, and longer-context AI workflows with better control.

3 chapters·16 guides·Access varies by chapter
Notification Hooks
On this page

Notification Hooks in Claude Code

Notification Hook
Notification Hook

Hooks run configured commands at defined events. Notifications can make a long authorized task easier to follow without constantly watching its terminal.

#Community template example

bash
npx claude-code-templates@latest --hook automation/simple-notifications

The source describes a community notification template using PostToolUse and desktop utilities. Review the template and the current hook schema; do not assume a template filename is automatically a recognized settings location.

#Event scope matters

A notification after a file operation means that event completed. It does not establish that the entire task or its tests succeeded. Match only the tools/events that need notifications rather than producing noise for every action.

#System utilities

The source uses macOS osascript and Linux notify-send. For a suitable Debian/Ubuntu desktop, the utility package is illustrated as:

bash
sudo apt-get install libnotify-bin

Review system/package changes before installation.

#Test the desktop notification separately

bash
which notify-send notify-send "Test" "This is a test notification"

If it fails, check the utility, desktop session and notification permissions. Then configure the verified command in the supported Claude Code hook settings. Treat text received from tools as data when constructing shell commands; do not interpolate untrusted output directly.

#Reference

Published by
JR Academy
Learning resources

Individual authors and reviewers are credited where recorded.

Prompt Master

Master prompting before you push AI tools harder

Learn prompt structure and control patterns for more stable output.

Open Prompt Master →

FAQ

Claude 3.5 Sonnet 和 GPT-4o 哪个写代码更好?
目前社区公认 Claude 3.5 Sonnet 在代码逻辑、复杂重构和 Artifacts 交互体验上略胜一筹,尤其是在配合 Cursor 使用时。
Claude Projects 是什么功能?
Claude Projects 允许你上传特定的文档(如 API 文档、代码库)作为上下文知识库,让 Claude 在对话中始终基于这些资料回答,非常适合项目级开发。
如何使用 Claude Artifacts?
在对话中让 Claude 生成代码(如 React 组件、HTML/CSS),它会自动触发 Artifacts 预览窗口,你可以直接看到运行效果并进行迭代修改。

Done reading? Next steps