claude-code - 💡(How to fix) Fix [FEATURE] Fire hooks on background task completion [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#48657Fetched 2026-04-16 06:54:30
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
labeled ×2commented ×1
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single feature request (not multiple bundled together)

What do you want?

No hooks fire on background task completion (run_in_background: true). As a result, it is not possible to use hooks to add additional context when background tasks complete.

Background task completions and Monitor notifications are injected directly into the conversation, bypassing the hook pipeline entirely. Either PostToolUse should fire when a background task completes, or a new hook event type should be added for this.

extent analysis

TL;DR

To address the issue of hooks not firing on background task completion, consider adding a new hook event type specifically for background task completions.

Guidance

  • Investigate the current hook pipeline to understand why PostToolUse does not fire for background tasks, and determine if modifications can be made to include these events.
  • Evaluate the feasibility of introducing a new hook event type for background task completions, considering potential impacts on existing functionality and backwards compatibility.
  • Review the documentation for run_in_background: true to ensure it clearly communicates the current behavior and limitations regarding hook events.
  • Consider reaching out to the development team or maintainers for further discussion on the best approach to implement hook events for background task completions.

Notes

The ideal solution may depend on the specific requirements and constraints of the project, including performance considerations and the need for backwards compatibility.

Recommendation

Apply workaround: Introduce a new hook event type for background task completions, as this approach allows for more flexibility and explicit handling of these events without potentially disrupting existing functionality.

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