# Claude Code Hooks — Resources

## Official Docs

- [Claude Code Documentation](https://docs.anthropic.com/en/docs/claude-code) — Main reference for hooks configuration, lifecycle events, and environment variables.
- [Claude Code Settings](https://docs.anthropic.com/en/docs/claude-code/settings) — Where hooks are configured in `.claude/settings.json`.

## Videos

- [Claude Code Deep Dive](https://www.youtube.com/results?search_query=claude+code+hooks+automation) — Walkthroughs demonstrating hook-based automation.
- [Git Hooks Explained](https://www.youtube.com/watch?v=egfuwOe8nXc) — Fireship. Conceptually similar lifecycle hooks in Git — helpful mental model.

## Articles and Readings

- [Anthropic Cookbook — Tool Use](https://github.com/anthropics/anthropic-cookbook/tree/main/tool_use) — Patterns for extending agent behavior, relevant to hook design.
- [Git Hooks Documentation](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) — Pro Git. Lifecycle hook patterns that inspired Claude Code hooks.
- [Husky — Git Hooks Made Easy](https://typicode.github.io/husky/) — Popular tool for managing Git hooks, illustrates the hook automation pattern.

## Books

- **The Pragmatic Programmer** by Hunt & Thomas — Chapter on "Domain Languages" covers automation pipelines relevant to hook scripting. [pragprog.com](https://pragprog.com/titles/tpp20/the-pragmatic-programmer-20th-anniversary-edition/).

## Tools and Frameworks

- [jq](https://jqlang.github.io/jq/) — Lightweight JSON processor used in hook scripts to parse tool input/output.
- [Prettier](https://prettier.io/) — Code formatter commonly invoked from PostToolUse hooks for auto-formatting.
- [ESLint](https://eslint.org/) — Linter frequently wired into hooks for real-time code quality checks.
- [ShellCheck](https://www.shellcheck.net/) — Static analysis for bash scripts — useful for validating your hook scripts.
- [lefthook](https://github.com/evilmartians/lefthook) — Fast hook runner for Git, useful pattern reference for lifecycle automation.

## Related Concepts

- [Webhooks (MDN)](https://developer.mozilla.org/en-US/docs/Glossary/Webhook) — The broader pattern of event-driven callbacks that hooks implement.
- [Observer Pattern (Refactoring Guru)](https://refactoring.guru/design-patterns/observer) — Design pattern behind lifecycle event systems.
