Claude Code hooks are user-defined shell commands, LLM prompts, or agent evaluations that execute automatically at specific lifecycle points. Hooks receive JSON context via stdin, take action, and communicate results through exit codes, stdout, and stderr.
When to use: Blocking dangerous commands, auto-formatting after writes, protecting sensitive files, custom notifications, environment setup, enforcing project conventions, auto-approving safe tools, running tests after changes.
When NOT to use: Static context injection (use CLAUDE.md), simple permission rules (use allowlist settings), one-time setup (use shell scripts directly).
قم بإنشاء روابط أحداث لـ Claude Code والتي يتم تشغيلها عند استدعاءات الأداة والمطالبات وأحداث دورة الحياة. يُستخدم عند أتمتة سير العمل، أو حظر الأوامر الخطيرة، أو حماية الملفات، أو إضافة إشعارات. يُستخدم للخطافات، وPreToolUse، وPostToolUse، ومعالجة الأحداث، والأتمتة. المصدر: oakoss/agent-skills.