{"version":"2.1.234","anchor":"diagnostics-logging-builds-its-payload-lazily-and-swallows-f","canonical_anchor":"diagnostics-logging-builds-its-payload-lazily-and-swallows-f","heading":"Diagnostics logging builds its payload lazily and swallows failures","tier":"internal","area":"Elsewhere","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.234\/e\/diagnostics-logging-builds-its-payload-lazily-and-swallows-f","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.234","markdown":"### Diagnostics logging builds its payload lazily and swallows failures\n\nDiagnostics logging only builds its payload when a diagnostics file is set, and never throws.\n\n**What**\n\nThe diagnostics log writer now accepts a function as its payload and calls it only when a diagnostics file is configured, so the cost is skipped otherwise. If building or serialising the payload throws, it writes a failure record instead of letting the error escape.\n\n**Details**\n\n- Active only when `CLAUDE_CODE_DIAGNOSTICS_FILE` is set.\n\n**Evidence**\n\n`diagnostics_payload_failed`\n\n- Area: Elsewhere\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 1\/5"}