Claude Code now recognizes API errors about misplaced 'system' role messages and pinpoints the offending message
Claude Code can now detect a specific class of API error: when the API complains that a system role message needs to come before or after other messages, or that the top-level system parameter should be used instead for the initial system prompt. A new parser extracts the index of the offending message from the error text when it's present.
This allows Claude Code to recognize and potentially handle this error condition more precisely, since it can now identify exactly which message in the conversation caused the problem.
What Claude Code does with the detected error or message index beyond parsing it is not stated.