Expand description
Claude Code background tasks and print-mode turns (hive-mind#2301, #3015).
After the main thread goes idle, claude -p waits for background tasks
(Agent, or Bash with run_in_background) up to
CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS, then writes
“Background tasks still running after 600s; terminating” to stderr and
stops every task. The result event still says success, but the work is
unfinished, so the run is incomplete and should be resumed.
Structs§
- Background
Task - A background task that has not reported an end.
- Background
Task Assessment - Whether a print-mode turn ended with background work unfinished.
- Background
Task State - Background tasks and print-mode turn state over a message list.
- Stopped
Background Task - A background task stopped while the main thread was idle.
Statics§
- PRINT_
BG_ CEILING_ PATTERN - Claude’s announcement that it stopped background tasks at its ceiling.
Functions§
- assess_
background_ tasks - Decide whether a print-mode turn ended with background work unfinished.
- extract_
observed_ models - Model ids a tool reports about itself (hive-mind#2840).
- is_
real_ model_ id - Whether a model id names a real model;
<synthetic>does not. - print_
wait_ ceiling_ seconds - Read the print-mode wait ceiling (seconds) from Claude’s stderr announcement.
- track_
background_ tasks - Follow background tasks and the print-mode turn over a message list.