- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
Why Your Claude Code Rules Get Ignored (And How Hooks Fix It)
Text rules in CLAUDE.md get ignored. Hooks don't. In this episode I build three production Claude Code hooks from scratch — a destructive command guard, a compaction state save, and a test gate — and explain the one technical detail that causes most community hooks to silently do nothing.
─────────────────────────────────────
🔧 WHAT YOU'LL BUILD
─────────────────────────────────────
✅ Destructive command guard — PreToolUse hook that intercepts rm -rf, git reset --hard, DROP TABLE before they run
✅ Compaction state save — Notification:PreCompact hook that writes task state before context is summarised
✅ Test gate — PostToolUse hook that runs the test suite after every git commit and stops the session if tests fail
✅ settings.json wiring — how to register all three hooks with correct event types, matchers, and timeouts
─────────────────────────────────────
📌 KEY CONCEPTS COVERED
─────────────────────────────────────
• The four hook events: PreToolUse, PostToolUse, Notification, Stop — when to use each
• The stdin vs. env var distinction — why Notification hooks must NOT read stdin (and why most don't work)
• Exit codes: exit 0 = allow, exit 2 = block with message
• The compaction survival pattern: state in files, not conversations
• Diagnostic checklist: four reasons hooks silently fail and how to fix each
─────────────────────────────────────
⏱️ TIMESTAMPS
─────────────────────────────────────
00:00 — Why hooks exist: the gap between guidance and enforcement
02:00 — The four hook event types explained
04:30 — Hook anatomy: exit codes, stdin vs. env vars
07:30 — Hook 1: Destructive command guard (PreToolUse)
11:00 — Hook 2: Compaction state save (Notification:PreCompact)
14:30 — Hook 3: Test gate (PostToolUse)
17:00 — Wiring hooks in settings.json
19:00 — Why most community hooks silently fail (diagnostic checklist)
21:00 — Key takeaways
─────────────────────────────────────
💻 CODE & RESOURCES
─────────────────────────────────────
GitHub repo → https://github.com/ogu83/production-claude-code
Branch → ep2-hooks
Claude Code hooks docs → https://docs.anthropic.com/claude-code
─────────────────────────────────────
🤝 WORK WITH ME
─────────────────────────────────────
I help engineering teams configure Claude Code for production use — CLAUDE.md architecture, hooks, MCP servers, and context management.
Upwork profile → https://www.upwork.com/freelancers/oguzkoroglu
─────────────────────────────────────
#ClaudeCode #AIEngineering #ClaudeCodeHooks #Anthropic #AITools #ProductionAI #SoftwareEngineering #DeveloperTools #LLM #AIWorkflow #DevProductivity #ClaudeAI #AIAssistant #BeyondTheDeveloper #ClaudeCodeTips
Видео Why Your Claude Code Rules Get Ignored (And How Hooks Fix It) канала Edward Blake
─────────────────────────────────────
🔧 WHAT YOU'LL BUILD
─────────────────────────────────────
✅ Destructive command guard — PreToolUse hook that intercepts rm -rf, git reset --hard, DROP TABLE before they run
✅ Compaction state save — Notification:PreCompact hook that writes task state before context is summarised
✅ Test gate — PostToolUse hook that runs the test suite after every git commit and stops the session if tests fail
✅ settings.json wiring — how to register all three hooks with correct event types, matchers, and timeouts
─────────────────────────────────────
📌 KEY CONCEPTS COVERED
─────────────────────────────────────
• The four hook events: PreToolUse, PostToolUse, Notification, Stop — when to use each
• The stdin vs. env var distinction — why Notification hooks must NOT read stdin (and why most don't work)
• Exit codes: exit 0 = allow, exit 2 = block with message
• The compaction survival pattern: state in files, not conversations
• Diagnostic checklist: four reasons hooks silently fail and how to fix each
─────────────────────────────────────
⏱️ TIMESTAMPS
─────────────────────────────────────
00:00 — Why hooks exist: the gap between guidance and enforcement
02:00 — The four hook event types explained
04:30 — Hook anatomy: exit codes, stdin vs. env vars
07:30 — Hook 1: Destructive command guard (PreToolUse)
11:00 — Hook 2: Compaction state save (Notification:PreCompact)
14:30 — Hook 3: Test gate (PostToolUse)
17:00 — Wiring hooks in settings.json
19:00 — Why most community hooks silently fail (diagnostic checklist)
21:00 — Key takeaways
─────────────────────────────────────
💻 CODE & RESOURCES
─────────────────────────────────────
GitHub repo → https://github.com/ogu83/production-claude-code
Branch → ep2-hooks
Claude Code hooks docs → https://docs.anthropic.com/claude-code
─────────────────────────────────────
🤝 WORK WITH ME
─────────────────────────────────────
I help engineering teams configure Claude Code for production use — CLAUDE.md architecture, hooks, MCP servers, and context management.
Upwork profile → https://www.upwork.com/freelancers/oguzkoroglu
─────────────────────────────────────
#ClaudeCode #AIEngineering #ClaudeCodeHooks #Anthropic #AITools #ProductionAI #SoftwareEngineering #DeveloperTools #LLM #AIWorkflow #DevProductivity #ClaudeAI #AIAssistant #BeyondTheDeveloper #ClaudeCodeTips
Видео Why Your Claude Code Rules Get Ignored (And How Hooks Fix It) канала Edward Blake
Claude Code hooks Claude Code tutorial Claude Code configuration PreToolUse hook PostToolUse hook Claude Code production Anthropic Claude Code AI coding tools Claude Code tips Claude Code best practices Claude Code settings.json Claude Code hooks tutorial destructive command guard compaction hook test gate hook AI developer tools Claude Code 2025 production AI tools AI software engineering developer productivity AI Claude Code workflow
Комментарии отсутствуют
Информация о видео
30 апреля 2026 г. 16:55:39
00:19:20
Другие видео канала
