Skip to content
5.0 Upwork, 100+ reviews Adobe Certified since 2021 New: become your own Magento developer Learn more →

What is a Claude Code "hook" and how does it map to Magento events?

Categories: Claude: Glossary

A Claude Code hook is a shell command run automatically at lifecycle moments, PreToolUse, PostToolUse, UserPromptSubmit, Stop, configured in .claude/settings.json or ~/.claude/settings.json. It is the same shape as a Magento event observer: a side-effect that fires on a named lifecycle moment without changing the caller's logic. Useful Magento examples: a PostToolUse hook that runs bin/magento setup:di:compile after every etc/di.xml edit, or a Stop hook that runs vendor/bin/phpcs on the changed files. Hooks are the bridge from “AI wrote code” to “AI shipped working code”.

Was this helpful?
Kishan Savaliya Online 10 AM to 7 PM IST Chat on WhatsApp