[BUG] Hook Configuration Progressive Duplication Causing Performance Issues

Resolved 💬 6 comments Opened Jul 15, 2025 by V-Andriy Closed Jul 24, 2025

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

  1. Progressive Duplication: Hooks gradually multiply over time

during active Claude Code sessions

  1. Performance Impact: Multiple ESLint processes run

simultaneously (observed up to 10 instances)

  1. Resource Consumption: High CPU/memory usage from duplicate

processes

  1. Workflow Disruption: Significant slowdown during file editing

operations

Steps to Reproduce

  1. Configure PostToolUse hooks for ESLint checking
  2. Use Claude Code for extended file editing session
  3. Observe progressive increase in hook execution time
  4. 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.

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗