[BUG] Hook Configuration Progressive Duplication Causing Performance Issues
Summary
Claude Code hooks progressively duplicate during sessions,
causing multiple simultaneous executions (up to 10+ ESLint
processes) after each file edit, resulting in severe performance
degradation.
Environment
- Claude Code Version: v1.0.51
- OS: macOS (Darwin 24.5.0)
- Platform: PNPM-based Next.js 15 project
- Config Location: .claude/settings.local.json
Problem Description
- Progressive Duplication: Hooks gradually multiply over time
during active Claude Code sessions
- Performance Impact: Multiple ESLint processes run
simultaneously (observed up to 10 instances)
- Resource Consumption: High CPU/memory usage from duplicate
processes
- Workflow Disruption: Significant slowdown during file editing
operations
Steps to Reproduce
- Configure PostToolUse hooks for ESLint checking
- Use Claude Code for extended file editing session
- Observe progressive increase in hook execution time
- Check system processes during file edits - multiple ESLint
instances running
Expected Behavior
Single hook execution per configured trigger event.
Actual Behavior
Multiple identical hook executions (2x, 5x, 10x+) for single
trigger event, increasing over session duration.
Current Configuration (After Manual Cleanup)
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write|MultiEdit",
"hooks": [
{
"type": "command",
"command": "python3 '/path/to/eslint_check.py'"
}
]
}
]
}
}
Workaround
Manual cleanup of configuration file and Claude Code session
restart.
Suspected Root Cause
Hook registry not properly cleared between operations, leading to
accumulation of hook configurations in memory.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗