Skip to content

Instantly share code, notes, and snippets.

@jtmuller5
Created January 1, 2026 21:47
Show Gist options
  • Select an option

  • Save jtmuller5/7dfc08b42cef78dd4610268a99843810 to your computer and use it in GitHub Desktop.

Select an option

Save jtmuller5/7dfc08b42cef78dd4610268a99843810 to your computer and use it in GitHub Desktop.
Claude Code hook to delay tool calls to avoid rate limiting (designed for use with Claude Code Router)
{
"permissions": {
"allow": ["Bash(mkdir:*)"]
},
"env": { "CLAUDE_TOOL_DELAY": "2" },
"hooks": {
"PreToolUse": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "echo \"⏳ Delaying tool execution by ${CLAUDE_TOOL_DELAY}s...\" && sleep \"${CLAUDE_TOOL_DELAY}\""
}
]
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment