Short answerArtifacts need a Pro, Max, Team or Enterprise plan, a session signed in to claude.ai on the Anthropic API, an organization policy that allows them, and an interactive Claude Code surface. The file must be HTML or Markdown in UTF-8, one page, and 16 MiB or smaller once rendered.
This guide follows Anthropic’s availability table and page constraints; check them for the latest version requirements.
Step 1: Check the session can publish at all
| Needs to be true | If not | |
|---|---|---|
| Plan[1] | Pro, Max, Team or Enterprise | Upgrade, or publish elsewhere |
| Sign-in[1] | The session is signed in to a claude.ai account with /login. API keys, gateway tokens and cloud-provider credentials can’t publish. | Run /login in the CLI or desktop app |
| Model provider[1] | Anthropic API. Not available on Amazon Bedrock, Google Cloud’s Agent Platform or Microsoft Foundry. | Switch provider, or publish elsewhere |
| Organization policy[1] | CMEK, HIPAA and Zero Data Retention are not enabled; on Team and Enterprise an Owner hasn’t turned artifacts off | Ask an Owner |
| Surface[1] | The Claude Code CLI, or the desktop app 1.13576.0 or later. Off by default in the Agent SDK, the GitHub Action, MCP-server contexts, with -p and when CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC is set. | Use an interactive session |
| Policy download[1] | Claude Code can load your organization’s policy from api.anthropic.com | Ask IT to allow api.anthropic.com through the proxy or filter |
| Your own settings[1] | Artifacts aren’t off in /config, enableArtifact isn’t false, CLAUDE_CODE_DISABLE_ARTIFACT isn’t set and Artifact isn’t in permissions.deny | Turn the setting back on, unless managed settings turned it off |
When Claude Code can’t load your organization’s policy, artifacts are unavailable, and Claude says why when you ask for one. It keeps retrying in the background, so artifacts appear once the policy loads.
Step 2: Check the file
| Requirement | |
|---|---|
| File type[1] | .html, .htm or .md, decoding as UTF-8 (or UTF-16 LE with a byte-order mark), with no U+FFFD replacement character |
| Location[1] | Not at a path that names a network host |
| Size[1] | The rendered page is 16 MiB or smaller; large embedded images are the usual cause |
| One page[1] | Relative links don’t resolve, so other pages, images and scripts next to the file won’t load |
Step 3: Check the page loads what it needs
An artifact runs under a strict Content Security Policy. It can load Google Fonts and scripts from five public CDN hosts (cdnjs, unpkg, the Tailwind and jQuery CDNs and selected jsDelivr paths). External images and every other external script, stylesheet and font are blocked, so Claude embeds images as data URIs. A page that publishes but looks broken often depends on a blocked resource.
Step 4: Check the prompt you’re seeing
Some publishes ask first: in plan mode, when the page declares connector calls or downloads, when the artifact is already public, or when Claude needs your approval to read the file. Approve the prompt, or add the file’s folder as a working directory with --add-dir so Claude can read it without asking.
If you can’t meet a requirement
Some requirements are policy, not settings: an API-key or cloud-provider session, a ZDR organization, or a headless pipeline. In that case, publish through an MCP server instead. With Overto connected, Claude Code publishes the same HTML, or a multi-page site with its images and scripts, to your team’s workspace, where reviewers comment and Claude reads the feedback.
Frequently asked questions
Why does Claude Code write a local HTML file instead of a link?
Artifacts aren’t enabled for that session. Claude Code needs every requirement to be met: a supported plan, a claude.ai login, the Anthropic API, an allowed organization policy and a supported surface. When one isn’t met, it writes a local file or says it can’t publish.
What does “Artifacts need a claude.ai login” mean?
The session isn’t backed by a claude.ai account, for example because it uses an API key. Sign in with /login. Anthropic’s errors page has the details for that message.
Can I publish an artifact from a headless run with -p?
Not by default. Artifacts are off by default when you run Claude Code with -p from your own terminal or scripts, in the Agent SDK and in the GitHub Action.
My page is over 16 MiB. What can I do?
Shrink embedded images, prefer SVG or CSS for diagrams, and summarize large datasets instead of inlining them. If the page really needs more, publish it as a multi-file site somewhere that serves one, such as Overto.
How do I publish when artifacts aren’t available to me?
Connect another place to publish. Overto is a remote MCP server: Claude Code publishes HTML pages, multi-page sites, Markdown and files to your workspace over an OAuth connection, separate from your claude.ai login. Connect your agent.
Sources
Third-party facts on this page come from each vendor’s own pages, last checked on . Products change often; check the source before relying on a detail.
Last checked . Claude and Claude Code are trademarks of Anthropic. Overto is an independent product and is not affiliated with or endorsed by Anthropic.