Observed in: Claude Code internal architecture
Function: buildAwaySummaryPrompt()
Model: Small fast model (Haiku)
Generates a 1-3 sentence recap when a user returns to a session after stepping away. Displayed in a "while you were away" card in the UI.
The system prompt is dynamically assembled with an optional session memory prefix:
[Session memory (broader context):
{memory content}]
The user stepped away and is coming back. Write exactly 1-3 short sentences. Start by stating the high-level task — what they are building or debugging, not implementation details. Next: the concrete next step. Skip status reports and commit recaps.
RECENT_MESSAGE_WINDOW = 30) to avoid "prompt too long" errors on large sessionsskipCacheWrite: true to avoid polluting the cachenull on abort, empty transcript, or any errorAPIUserAbortError exceptions