Back to Hooks

Update Search Year

Hooks pre-tool 3,255

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 relevant.

Install Command
npx claude-code-templates@latest --hook pre-tool/update-search-year
View on GitHub
claude-code — update-search-year

Content

JSON
{
"description": "Automatically adds current year to WebSearch queries when no year is specified. ..."
"hooks": {
"PreToolUse": [1 item]
}
}

Stack Builder

0 components

Your stack is empty

Browse components and click the + button to add them to your stack for easy installation.