[Bug] Hook Navigation Infinite Loop on Duplicate Entries
Resolved 💬 3 comments Opened Aug 27, 2025 by chitcommit Closed Jan 4, 2026
Bug Description
Issue: Hook navigation system enters infinite loop when similar/duplicate hooks exist
Bug Description
What happens: When navigating through hooks in the /hooks command interface, if there are duplicate or similar hook commands, the navigation system jumps back to the first instance
when trying to select the second one, creating an infinite recursive loop that prevents users from selecting the correct hook.
Reproduction Steps
- Add two similar echo commands in hooks configuration:
- First: echo"Don't forget to use registry.chitty.cc... (broken syntax)
- Second: echo "Don't forget to use registry.chitty.cc... (fixed syntax)
- Use /hooks command to view/edit hooks
- Try to navigate to the second (fixed) echo command
- System jumps back to first instance repeatedly
Expected Behavior
- Should allow navigation through all hooks even if content is similar
- Should treat each hook entry as unique based on position/index
- Should allow selection of any hook regardless of content similarity
Actual Behavior
- Navigation loops back to first matching instance
- Cannot select second/subsequent similar hooks
- Creates infinite navigation loop
- User cannot fix/remove duplicate entries through UI
Impact
- Severity: High - Prevents hook management through UI
- Workaround: Must manually edit settings.json/hooks.json
- Makes it impossible to fix duplicate/broken hooks through Claude Code interface
Technical Details
- Appears to be matching hooks by content rather than index
- Navigation system doesn't handle duplicate entries properly
- No unique identifier for each hook entry
Suggested Fix
- Use array index or unique ID for hook navigation, not content matching
- Allow navigation by position rather than content
- Add duplicate detection with proper handling
Environment Info
- Platform: darwin
- Terminal: Apple_Terminal
- Version: 1.0.92
- Feedback ID: bf49f79a-f09d-4d55-bec6-cfb34879a228
Errors
[{"error":"Error: String not found in file. Failed to apply edit.\n at kM (/$bunfs/root/claude:1674:737)\n at renderToolUseRejectedMessage (/$bunfs/root/claude:1731:973)\n at JF (/$bunfs/root/claude:187:19415)\n at jb (/$bunfs/root/claude:189:42805)\n at CY (/$bunfs/root/claude:189:38347)\n at ty (/$bunfs/root/claude:189:38275)\n at wF (/$bunfs/root/claude:189:38129)\n at PI (/$bunfs/root/claude:189:35208)\n at XX (/$bunfs/root/claude:187:4842)\n at JX (/$bunfs/root/claude:189:32454)","timestamp":"2025-08-27T16:15:24.069Z"},{"error":"Error: Agent file /Users/nb/.claude/agents/devops-automator.md is missing required 'description' in frontmatter\n at qG9 (/$bunfs/root/claude:2272:6729)\n at <anonymous> (/$bunfs/root/claude:2272:5239)\n at map (native:1:11)\n at <anonymous> (/$bunfs/root/claude:2272:5169)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-08-27T16:15:38.585Z"},{"error":"Error: Agent file /Users/nb/.claude/agents/services/api-gateway/README.md is missing required 'name' in frontmatter\n at qG9 (/$bunfs/root/claude:2272:6729)\n at <anonymous> (/$bunfs/root/claude:2272:5239)\n at map (native:1:11)\n at <anonymous> (/$bunfs/root/claude:2272:5169)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-08-27T16:15:38.585Z"},{"error":"Error: Agent file /Users/nb/.claude/agents/CLAUDE.md is missing required 'name' in frontmatter\n at qG9 (/$bunfs/root/claude:2272:6729)\n at <anonymous> (/$bunfs/root/claude:2272:5239)\n at map (native:1:11)\n at <anonymous> (/$bunfs/root/claude:2272:5169)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-08-27T16:15:38.585Z"},{"error":"Error: Agent file /Users/nb/.claude/agents/innovation-strategist.md is missing required 'name' in frontmatter\n at qG9 (/$bunfs/root/claude:2272:6729)\n at <anonymous> (/$bunfs/root/claude:2272:5239)\n at map (native:1:11)\n at <anonymous> (/$bunfs/root/claude:2272:5169)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-08-27T16:15:38.586Z"},{"error":"Error: Agent file /Users/nb/.claude/agents/infra-architect.md is missing required 'description' in frontmatter\n at qG9 (/$bunfs/root/claude:2272:6729)\n at <anonymous> (/$bunfs/root/claude:2272:5239)\n at map (native:1:11)\n at <anonymous> (/$bunfs/root/claude:2272:5169)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-08-27T16:15:38.586Z"},{"error":"Error: Agent file /Users/nb/.claude/agents/autonomous-executive-summary.md is missing required 'name' in frontmatter\n at qG9 (/$bunfs/root/claude:2272:6729)\n at <anonymous> (/$bunfs/root/claude:2272:5239)\n at map (native:1:11)\n at <anonymous> (/$bunfs/root/claude:2272:5169)\n at processTicksA
Note: Error logs were truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗