Cookies

With your permission, we use Google Analytics cookies to measure visits and improve the site. Necessary cookies are always on. You can change your choice or withdraw consent anytime in the footer, under Cookie settings. Cookie Policy

Skip to content

Automations (hooks) for Claude Code

Find event automations (hooks) for Claude Code in the Doutor AI Library. Make your applications more efficient.

Event automations, also known as hooks, are essential tools for anyone who works with Claude Code. They let developers add reactive functionality to their applications, responding to specific events efficiently.

Installing hooks from the Doutor AI Library gives you access to a wide range of 81 automations, which makes developing and customizing your applications easier. Our library is a reliable source that helps you optimize your workflow and maximize productivity.

By use case

If you already know the task you want to solve, start from a hand-picked selection: we chose the components that are really worth it and explain why.

Explore automations 64

64
  • simple-notifications

    Send desktop notifications when Claude Code finishes working or needs user input. Works on macOS and Linux systems.

    AutomationsAutomation
    .json4,829
  • smart-commit

    Intelligent git commit creation with automatic message generation and validation. Creates meaningful commits based on file changes.

    AutomationsGit Workflow
    .json1,694
  • lint-on-save

    Automatically run linting tools after file modifications. Supports ESLint for JavaScript/TypeScript, Pylint for Python, and RuboCop for Ruby.

    AutomationsDevelopment tools
    .json1,566
  • update-search-year

    Automatically adds current year to WebSearch queries when no year is specified. This hook intercepts WebSearch tool usage and appends the current year to queries that don't already contain a year, ensuring search results are current and…

    AutomationsPre Tool
    .json1,356
  • smart-formatting

    Smart code formatting based on file type. Automatically formats code using Prettier, Black, gofmt, rustfmt, and other language-specific formatters.

    AutomationsDevelopment tools
    .json1,352
  • dependency-checker

    Advanced dependency analysis and security checking. Monitors for outdated packages, security vulnerabilities, and license compatibility.

    AutomationsAutomation
    .json1,055
  • nextjs-code-quality-enforcer

    Enforce Next.js best practices, proper file structure, component patterns, and TypeScript usage with automated code reviews and suggestions. Validates Next.js App Router conventions, Server/Client component patterns, proper imports, and…

    AutomationsDevelopment tools
    .json1,038
  • security-scanner

    Scan code for security vulnerabilities and secrets after modifications. Uses multiple security tools to detect potential issues.

    AutomationsSecurity
    .json978
  • run-tests-after-changes

    Automatically run quick tests after code modifications to ensure nothing breaks. This hook executes 'npm run test:quick' silently after any Edit operation and provides feedback on test status. Helps catch breaking changes immediately…

    AutomationsPost Tool
    .json811
  • change-tracker

    Track file changes in a simple log. Records which files were modified and when for easy tracking of Claude Code activity.

    AutomationsDevelopment tools
    .json772
  • format-python-files

    Automatically format Python files after any Edit operation using black formatter. This hook runs 'black' on any .py file that Claude modifies, ensuring consistent Python code formatting. Requires black to be installed ('pip install…

    AutomationsPost Tool
    .json679
  • agents-md-loader

    Automatically loads AGENTS.md configuration file content at session start to ensure Claude Code follows project-specific agent behavior. Only loads if AGENTS.md exists, otherwise passes empty context. Supports the universal AGENTS.md…

    AutomationsAutomation
    .json677
  • file-protection

    Protect critical files from accidental modification. Prevents editing of important system files, configuration files, and production code.

    AutomationsSecurity
    .json601
  • auto-git-add

    Automatically stage modified files with git add after editing. Helps maintain a clean git workflow by staging changes as they're made.

    AutomationsGit Workflow
    .json599
  • telegram-notifications

    Send Telegram notifications when Claude Code finishes working. Requires TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID environment variables. Get bot token from @BotFather, get chat ID by messaging the bot and visiting…

    AutomationsAutomation
    .json570
  • dangerous-command-blocker

    for pattern, desc in critical_paths: if re.search(pattern, cmd, re.IGNORECASE): print(f'🛑 BLOCKED: Critical path protection activated!', file=sys.stderr) print(f'', file=sys.stderr) print(f'Protected resource: {desc}', file=sys.stderr)…

    AutomationsSecurity
    .py549
  • dangerous-command-blocker

    Advanced protection against dangerous shell commands with multi-level security. Blocks catastrophic operations (rm -rf /, dd, mkfs), protects critical paths (.claude/, .git/, node_modules/), and warns about suspicious patterns. Features:…

    AutomationsSecurity
    .json547
  • backup-before-edit

    Create automatic backup of files before any Edit operation for safety. This hook creates a timestamped backup copy (filename.backup.timestamp) of any existing file before Claude modifies it. Provides a safety net to recover previous…

    AutomationsPre Tool
    .json533
  • secret-scanner

    print('❌ COMMIT BLOCKED: Remove secrets before committing', file=sys.stderr) print('', file=sys.stderr) print('How to fix:', file=sys.stderr) print(' 1. Move secrets to environment variables:', file=sys.stderr) print(' • Create/update .env…

    AutomationsSecurity
    .py531
  • secret-scanner

    Automatically detects hardcoded secrets before git commits. Scans for API keys from 30+ providers (Anthropic: sk-ant-..., OpenAI: sk-..., AWS: AKIA..., Stripe: sk_live_..., Google: AIza..., GitHub: ghp_..., Vercel, Supabase, Hugging Face:…

    AutomationsSecurity
    .json531
  • test-runner

    Automatically run relevant tests after code changes. Detects test files and runs appropriate test commands based on file extensions and project structure.

    AutomationsTesting
    .json472
  • file-backup

    Automatically backup files before editing. Creates timestamped backups in a .backups directory when files are modified.

    AutomationsDevelopment tools
    .json449
  • command-logger

    Log all Claude Code commands to a file for audit and debugging purposes. Simple logging that records tool usage with timestamps.

    AutomationsDevelopment tools
    .json437
  • performance-monitor

    Monitor system performance during Claude Code operations. Tracks CPU, memory usage, and execution time for performance optimization.

    AutomationsPerformance
    .json409
  • format-javascript-files

    Automatically format JavaScript/TypeScript files after any Edit operation using prettier. This hook runs 'npx prettier --write' on any .js, .ts, .jsx, or .tsx file that Claude modifies, ensuring consistent code formatting. Uses npx so…

    AutomationsPost Tool
    .json394
  • conventional-commits

    Enforce conventional commit message format for all git commits. Validates commit messages follow the pattern: type(scope): description. Supported types: feat, fix, docs, style, refactor, perf, test, chore, ci, build, revert. Ensures…

    AutomationsGit
    .json340
  • build-on-change

    Automatically trigger build processes when source files change. Detects common build tools and runs appropriate build commands.

    AutomationsAutomation
    .json334
  • git-add-changes

    Automatically stage changes in git after file modifications for easier commit workflow. This hook runs 'git add' on any file that Claude edits or writes, automatically staging changes for the next commit. Includes error suppression so it…

    AutomationsPost Tool
    .json317
  • context-timeline

    Real-time browser visualization of Claude Code's context window and subagent/tool execution as a git-graph timeline. Opens http://localhost:7878 on SessionStart with a vertical timeline (most recent on top), one column per agent (main +…

    AutomationsMonitoring
    .json296
  • telegram-detailed-notifications

    Send detailed Telegram notifications with session information when Claude Code finishes. Includes working directory, session duration, and system info. Requires TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID environment variables.

    AutomationsAutomation
    .json282
  • prevent-direct-push

    Prevent direct pushes to protected branches (main, develop). Blocks git push commands targeting main or develop branches to enforce Git Flow workflow. Requires using feature/release/hotfix branches and pull requests instead of direct…

    AutomationsGit
    .json232
  • deployment-health-monitor

    Monitor deployment status, error rates, and performance metrics, sending notifications for failed deployments or performance degradation. Tracks Vercel deployment health, monitors build success/failure rates, and provides alerts for…

    AutomationsAutomation
    .json219
  • vercel-auto-deploy

    Automatically trigger Vercel deployments when code changes are committed, with environment-specific deployment strategies and rollback on failure. Setup: Export environment variables 'export VERCEL_TOKEN=your_token' and 'export…

    AutomationsAutomation
    .json204
  • validate-branch-name

    Validate Git Flow branch naming conventions before checkout. Ensures branches follow the pattern: feature/*, release/v*.*.*, hotfix/*. Prevents creation of branches that don't follow Git Flow standards.

    AutomationsGit
    .json193
  • validate-branch-name

    Git Flow branches must follow these patterns: • feature/ • release/v . . • hotfix/

    AutomationsGit
    .py193
  • performance-budget-guard

    Monitor bundle size and Core Web Vitals metrics during development, blocking deployments that exceed performance budgets with detailed reports. Automatically analyzes Next.js build output, checks bundle sizes against predefined budgets,…

    AutomationsPerformance
    .json179
  • vercel-environment-sync

    Synchronize environment variables between local development and Vercel deployments, ensuring consistency across all environments. Detects changes to .env files and provides options to sync with Vercel, validates environment variable…

    AutomationsAutomation
    .json176
  • discord-detailed-notifications

    Send detailed Discord notifications with session information when Claude Code finishes. Includes working directory, session duration, and system info with rich embeds. Requires DISCORD_WEBHOOK_URL environment variable.

    AutomationsAutomation
    .json122
  • slack-notifications

    Send Slack notifications when Claude Code finishes working. Requires SLACK_WEBHOOK_URL environment variable. Get webhook URL from Slack App settings -> Incoming Webhooks.

    AutomationsAutomation
    .json119
  • telegram-error-notifications

    Send Telegram notifications when Claude Code encounters long-running operations or when tools take significant time. Helps monitor productivity and catch potential issues. Requires TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID environment…

    AutomationsAutomation
    .json111
  • worktree-ghostty

    Worktree Ghostty Layout. Opens a 3-panel Ghostty layout when creating worktrees: Claude Code (left) | lazygit (top-right) / yazi (bottom-right). Creates worktrees in a sibling directory (../worktrees/ / /) and cleans up on…

    AutomationsDevelopment tools
    .json104
  • langsmith-tracing

    Automatically send Claude Code conversation traces to LangSmith for monitoring and analysis. Prerequisites: jq (brew install jq on macOS or sudo apt-get install jq on Linux), curl and uuidgen (usually pre-installed), LangSmith account and…

    AutomationsMonitoring
    .json103
  • langsmith-tracing

    posts_batch=$(echo "$posts_batch" | jq --argjson data "$assistant_data" '. += [$data]')

    AutomationsMonitoring
    .sh101
  • slack-detailed-notifications

    Send detailed Slack notifications with session information when Claude Code finishes. Includes working directory, session duration, and system info. Requires SLACK_WEBHOOK_URL environment variable.

    AutomationsAutomation
    .json98
  • notify-before-bash

    Show notification before any Bash command execution for security awareness. This hook displays a simple echo message '🔔 About to run bash command...' before Claude executes any bash command, giving you visibility into when system commands…

    AutomationsPre Tool
    .json97
  • discord-notifications

    Send Discord notifications when Claude Code finishes working. Requires DISCORD_WEBHOOK_URL environment variable. Get webhook URL from Discord Server Settings -> Integrations -> Webhooks.

    AutomationsAutomation
    .json91
  • discord-error-notifications

    Send Discord notifications when Claude Code encounters long-running operations or when tools take significant time. Helps monitor productivity and catch potential issues with rich embeds. Requires DISCORD_WEBHOOK_URL environment variable.

    AutomationsAutomation
    .json79

Need help with Claude Code?

Ask Dr AI - it explains things simply.

How it works

From component to Claude Code, without friction.

  1. Choose

    Agents, skills, commands and connectors ready to install.

  2. Copy

    A single install command in your project.

  3. Install

    Claude Code starts using it automatically.

  4. Ship

    You are working with AI for real the same day.

Frequently asked questions

Installing hooks in your Claude Code application is a simple process. First, open the Doutor AI Library and look for the automations section. Once you find the hook you want, follow the installation instructions, which include integrating it with your project and the configuration it needs.

Sources

Prompts and resources curated from international sources, normalized and categorized: over 11 thousand. A Doutor AI bot checks the sources every day and brings in what is new.

  • Daily updates
  • Over 11 thousand resources
  • Normalized and categorized

Need a tailor-made solution?

Not sure where to start with AI in your business? Get a free assessment and a tailored plan - no commitment.

Save hours every week with AI, no hassle

Doutor AI gives you 1,859 ready-to-copy AI prompts, by industry and in plain English - plus a complete technical library for those who want to go further.

See plans