Background task kill/completion notification wakes the session and re-reads full context -- costs a full turn with no user input
Summary
When a session has a still-tracked background Bash task (run_in_background: true) and the
conversation has already ended (user said goodbye, no further input expected), a later
completion/kill notification for that task still wakes the session and triggers a full model
turn. That turn re-reads the entire conversation context and produces a reply, consuming real
usage, even though no user action occurred and nobody is present to read the reply.
What happened
- Started a local dev server as a background Bash task mid-session, for iterative testing.
- Conversation concluded normally (user said goodbye, assistant said goodbye back).
- Hours later, the machine went to sleep and later woke; the background process was killed by
the OS for low memory.
- The resulting task-notification ("...was killed because the system is running low on
memory") arrived and re-invoked the model, which read back the entire (very long, all-day)
conversation and replied.
- The user's usage dropped by ~10% for this, despite having typed nothing since saying goodbye.
Why this is surprising
- The notification is purely informational — nothing about it requires or benefits from a full
model turn, since there's no pending user request to serve.
- The cost of that turn scales with the size of the conversation (all-day session, in this
case), not with the size or importance of the notification.
- Nothing surfaces this cost in advance, or lets the user opt a visibly-ended session out of
"wake and react" behavior for background-task events.
Suggested fixes (any one would help)
- Let a session that has ended (last turn was a plain conversational close, no pending tool
state) suppress or defer background-task wake turns, surfacing them on the user's next real
input instead of spending a full turn immediately.
- Don't require re-reading the entire transcript for a turn that's only reporting on an
unrelated background process finishing/dying.
- Surface the estimated cost of a notification-driven turn before it runs (related to #92062's
point about per-turn cost being invisible).
Environment
Claude Code, Windows 10. Long single-conversation session; background task launched via the
Bash tool's run_in_background.
Related: #92062 (background-task usage generally invisible/uncapped), #73440 (memory-pressure
reaper kills tasks silently) — this report is specifically about the notification turn itself
costing usage after the conversation had already ended, distinct from both.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗