What
The list of error kinds Claude Code can report for a failed request to the API now includes three more:
connection_failed: the network connection failed.stream_idle_timeout: Claude Code's own idle timer gave up waiting for the reply to continue.computer_slept: the connection dropped because the computer went to sleep.
When the connection to the API is lost, the error now carries one of these as its apiError field, either computer_slept or connection_failed. A suspended stream (StreamSuspended) is never labelled connection_failed. The message you see, "Connection to the API was lost", is unchanged. Before, this error had no apiError field.
Why
Programs built on Claude Code through the SDK can tell a sleeping computer apart from a network failure or a timeout, and react to each differently.