Back to Browse

I Made Claude Code Run Custom Scripts on Every Edit (How to Set Up Claude Code Hooks 2026)

95 views
May 14, 2026
9:05

πŸ†• NEW (Video 5 of this series): Give your agent NEW powers with MCP. GitHub, browsers, custom tools, all in 10 lines: https://youtu.be/enRbqWIA-_l ──────── Claude Code Hooks let you run any shell command at specific moments in Claude's lifecycle β€” before it edits a file, after it writes one, when a task finishes. In this -minute tutorial: two production-ready hooks shipped in 23 lines of JSON. 🎯 What you'll build: βœ“ A PostToolUse hook that auto-formats every file Claude edits (using Prettier) βœ“ A PreToolUse hook that blocks Claude from touching .env files or other secrets βœ“ The exact settings.json config you can copy into your own project today πŸ”— LINKS Claude Code Hooks official docs: https://code.claude.com/docs/en/hooks Claude Code install: https://claude.ai/install.sh πŸ‘‰ All the code from this tutorial: https://github.com/AyyazTech/claude-code-hooks-demo Demo repo used in this tutorial: https://github.com/AyyazTech/claude-code-hooks-demo πŸ“Ί Related videos (the 3-Pillar Series): - This One File Made Claude Code 10x Smarter (CLAUDE.md Tutorial): https://youtu.be/D5UUTFOKdSI - 3 Claude Code Skills Every Developer Should Install Today: https://youtu.be/GDll232uoIg - Gave Claude Code Full Access to My GitHub (Official MCP Setup): https://youtu.be/F68wUtH5riI πŸš€ SUBSCRIBE for the next Claude Code feature tutorial. πŸ‘ LIKE if you'll wire a hook into your project today. πŸ’¬ COMMENT β€” which hook will you build first? Auto-formatter, security gate, or something else? 🌐 ayyaztech.com πŸ’» GitHub: https://github.com/AyyazTech #ClaudeCode #ClaudeCodeHooks #AICoding #DeveloperTools #AnthropicClaude #ClaudeCodeTutorial #2026

Download

0 formats

No download links available.

I Made Claude Code Run Custom Scripts on Every Edit (How to Set Up Claude Code Hooks 2026) | NatokHD