{"version":"2.1.283","anchor":"preview-frame-stubs-windowclaudeuse-and-reports-which-ar","canonical_anchor":"preview-frame-stubs-windowclaudeuse-and-reports-which-ar","heading":"Artifact preview now notices code that calls window.claude.use()","tier":"notice","area":"Artifacts","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.283\/e\/preview-frame-stubs-windowclaudeuse-and-reports-which-ar","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.283","markdown":"### Artifact preview now notices code that calls window.claude.use()\n\nThe artifact preview check stubs window.claude.use(), records which capabilities a page asked for, and tells Claude to test those parts after publishing\n\n**Unclear.** What decides whether this preview feature is available is not known.\n\n**What**\n\nWhen Claude builds an HTML artifact (a small web page or app), Claude Code first loads it in a preview frame and runs a health check on it. The script injected into that frame now defines a read-only `window.claude` object.\n\n- `window.claude.use(name)` records the capability name it was asked for, up to a capped number of names, and then resolves to `null`.\n\n- The check's result gains `uses` and `usesMore`, which list the requested names and whether more were cut off. These are merged into the preview check alongside the things it already reported: overflows, SVG clipping, Mermaid diagrams, content security policy and dialogs.\n\n- When a page calls it, Claude is told: \"no artifact runtime in preview: window.claude.use() resolved null for \u2026, so the code that needs \u2026 did not run here \u2014 exercise it after publishing\". The names are filled in at runtime.\n\n**Why**\n\nThe preview has no artifact runtime, so any part of a page that depends on `window.claude.use()` cannot actually run there. Before, the check did not notice this and such code paths could look fine. Now Claude is told which parts were not exercised and that they need testing once the artifact is published.\n\n- Area: Artifacts\n- Names: `window.claude.use`\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 3\/5"}