A developer has created a Bash script to measure the execution time of hooks within the Claude Code environment. This script, `hook-latency-wrap.sh`, acts as a wrapper around existing hook commands, recording their elapsed time in milliseconds and logging it to a JSONL file. This allows developers to identify which specific hooks are causing delays in the response time of Claude Code, a problem that becomes more pronounced as more hooks are added. The wrapper utilizes the `$EPOCHREALTIME` variable for precise timing and ensures the original exit code of the hook is preserved. AI
IMPACT Enables developers to optimize the performance of AI assistant tools by identifying and addressing slow-running components.
RANK_REASON The item describes a custom script for improving a specific tool's functionality, not a new release from a frontier lab or a significant industry event.
Read on dev.to — Claude Code tag →
- Bash
- Claude Code
- cost_guard.sh
- hook-latency-wrap.sh
- macOS
- MessageDisplay
- obsidian_context.sh
- PreToolUse
- SessionStart
- UserPromptSubmit
- Ventura
AI-generated summary · Google Gemini · from 1 sources. How we write summaries →