claude-code - 💡(How to fix) Fix [Feature Request] Surface hook identity in async hook completion messages [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#53215Fetched 2026-04-26 05:21:26
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
labeled ×2commented ×1

Error Message

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/badawi/.local/share/claude/versions/2.1.119 (expected in multi-process scenarios)\n at mH6 (/$bunfs/root/src/entrypoints/cli.js:2736:2177)\n at E$8 (/$bunfs/root/src/entrypoints/cli.js:2736:1257)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-25T10:39:16.767Z"},{"error":"AxiosError: Request failed with status code 404\n at zl (/$bunfs/root/src/entrypoints/cli.js:114:1194)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:119:12696)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:865:50)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/src/entrypoints/cli.js:121:2467)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-25T10:43:17.928Z"},{"error":"MaxFileReadTokenExceededError: File content (30602 tokens) exceeds maximum allowed tokens (25000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n at qC7 (/$bunfs/root/src/entrypoints/cli.js:4789:12701)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-25T10:43:22.073Z"}]

Code Example

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/badawi/.local/share/claude/versions/2.1.119 (expected in multi-process scenarios)\n    at mH6 (/$bunfs/root/src/entrypoints/cli.js:2736:2177)\n    at E$8 (/$bunfs/root/src/entrypoints/cli.js:2736:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-25T10:39:16.767Z"},{"error":"AxiosError: Request failed with status code 404\n    at zl (/$bunfs/root/src/entrypoints/cli.js:114:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:119:12696)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:121:2467)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-25T10:43:17.928Z"},{"error":"MaxFileReadTokenExceededError: File content (30602 tokens) exceeds maximum allowed tokens (25000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n    at qC7 (/$bunfs/root/src/entrypoints/cli.js:4789:12701)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-25T10:43:22.073Z"}]
RAW_BUFFERClick to expand / collapse

Bug Description Title: Surface hook identity in async hook completion messages

Body:

When async hooks complete, the harness emits a generic Async hook PostToolUse completed line — one per hook, with no indication of which specific hook fired. With multiple async hooks on the same event (e.g., 5 PostToolUse:Bash hooks), pressing ctrl+o shows a wall of identical lines:

⎿ Async hook PostToolUse completed ⎿ Async hook PostToolUse completed ⎿ Async hook PostToolUse completed ⎿ Async hook PostToolUse completed ⎿ Async hook PostToolUse completed

This makes it impossible to tell at a glance which hook ran, how long each took, or whether a specific one failed silently. Debugging hook performance/regressions currently requires adding sidecar logging in each hook script.

Requested:

Either (a) include the hook command (or a derived label) in the completion line:

⎿ Async hook PostToolUse completed: kanban_review_on_commit.sh (1.2s) ⎿ Async hook PostToolUse completed: pr_lesson_extract.sh (0.4s)

…or (b) add an optional name / label field on hook entries in settings.json that the harness uses in the completion message:

{ "type": "command", "command": "bash $HOME/.claude/hooks/kanban_review_on_commit.sh", "async": true, "name": "kanban-review" }

Either path solves it. Would also help with /doctor-style hook health diagnostics down the line.

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.1.119
  • Feedback ID: 23d485fe-26d7-4b46-a5e1-b37b26f51978

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/badawi/.local/share/claude/versions/2.1.119 (expected in multi-process scenarios)\n    at mH6 (/$bunfs/root/src/entrypoints/cli.js:2736:2177)\n    at E$8 (/$bunfs/root/src/entrypoints/cli.js:2736:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-25T10:39:16.767Z"},{"error":"AxiosError: Request failed with status code 404\n    at zl (/$bunfs/root/src/entrypoints/cli.js:114:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:119:12696)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:121:2467)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-25T10:43:17.928Z"},{"error":"MaxFileReadTokenExceededError: File content (30602 tokens) exceeds maximum allowed tokens (25000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n    at qC7 (/$bunfs/root/src/entrypoints/cli.js:4789:12701)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-25T10:43:22.073Z"}]

extent analysis

TL;DR

To address the issue of generic async hook completion messages, consider adding a unique identifier or label to each hook in the settings.json file.

Guidance

  • Review the proposed solutions in the issue description, specifically adding a "name" field to hook entries in settings.json, to provide a clear identifier for each hook.
  • Consider the benefits of including the hook command or a derived label in the completion message for easier debugging and performance monitoring.
  • Evaluate the trade-offs between the two proposed solutions: (a) including the hook command in the completion line, and (b) adding an optional name/label field in settings.json.
  • Investigate how the harness currently handles async hook completion messages and how it can be modified to include the proposed changes.

Example

No code snippet is provided as the issue does not contain sufficient information to create a specific example.

Notes

The issue highlights the need for better debugging and performance monitoring capabilities for async hooks. The proposed solutions aim to address this by providing a clear identifier for each hook in the completion message.

Recommendation

Apply workaround (b) by adding an optional name/label field to hook entries in settings.json, as it provides a flexible and scalable solution for identifying and debugging async hooks.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Feature Request] Surface hook identity in async hook completion messages [1 comments, 2 participants]