Share session output as artifacts - Claude Code Docs
Documentation Index Fetch the complete documentation index at: /docs/llms.txt Use this file to discover all available pages before exploring further. Skip to main content Assistant Responses are generated using AI and may contain mistakes. Artifacts are available on Pro, Max, Ultra, Team, and Enterprise plans and require a session signed in with /login . See Availability for the full set of requirements. An artifact is a live, interactive web page that Claude Code publishes from your session to a private URL on claude.ai.
You open it in a browser, and it updates in place as the session continues. Share it from the page header when you want someone else to see it too. When to use an artifact Use an artifact when terminal text is the wrong medium for what Claude produced: output that is easier to look at and interact with than to read line by line. Claude builds the page from anything your session can reach, including your codebase and data it pulls through your connected tools , so the page can show things that would take paragraphs to describe.
For example, ask Claude to: Walk a reviewer through a pull request with annotated diffs Render a dashboard from data the session already pulled Lay out several design or implementation options side by side Keep an investigation timeline that fills in while a long task runs Send a teammate a link instead of pasting output into Slack Publish a status board that pulls fresh data through MCP connectors each time someone opens it See What you can build for prompts that match these, and Pull live data with MCP connectors for the connector-backed board’s prompt.
What an artifact is not An artifact is a capture of work: one self-contained page with no backend, so it can’t serve multiple routes. For a hosted internal tool with a backend, deploy it on your own infrastructure instead. See Page constraints for the full set of limits. Create an artifact Claude may publish an artifact on its own when the output suits a page, or you can ask for one directly. To ask, name the feature or describe the visual output you want in plain language.
A good candidate is anything easier to see than to read as text, such as an annotated diff, a chart, or a set of options to compare. The prompts below are two examples; see What you can build for more patterns. Make an artifact that walks through this PR with the diff annotated inline. Build a dashboard artifact of last week's deploy failures by service and keep it updated as you investigate. Unless you name a location, Claude writes the page to an HTML or Markdown file in a temporary directory outside your project, then publishes it.
The artifact stays private to you until you share it . After the first publish, Claude prints the URL, and your browser opens to the new page. Reopen the page : press Ctrl+] at any time to reopen the session’s most recent artifact See this session’s artifacts : a ⧉ pill below the prompt shows the artifact’s name, or a count when the session has several. In fullscreen rendering , click it to open the /artifacts list Keep the browser from opening : set CLAUDE_CODE_ARTIFACT_AUTO_OPEN=0 in your environment Remote Control : if you sent the prompt through Remote Control from claude.ai, Claude Desktop, or the Claude mobile app, no tab opens on the machine running the session.
The browser opens there the next time Claude publishes the artifact from a prompt you type at the terminal Claude picks the artifact’s title and a browser-tab icon that matches what the page is, such as a chart or a calendar. The title appears in your gallery of artifacts on claude.ai and in shared links. Ask Claude for a specific title or tab icon if you want one. If Claude responds that it can’t publish, or writes a local HTML file without a link, artifacts aren’t enabled for your session.
Check the Availability requirements. If the terminal shows Artifacts need a claude.ai login , see that error’s entry for how to sign in. When Claude Code asks before publishing A new artifact that Claude publishes in response to a prompt you type goes through without a permission prompt or classifier review. In these cases Claude Code asks you first, or in auto mode has the classifier review the publish: When What Claude Code does The session is in plan mode Asks before the first publish of each artifact The publish declares runtime capabilities for the page, such as connector calls or file downloads Asks before that publish You shared the artifact publicly Asks at least once per conversation before changing it, and before each reply to a comment on it Claude publishes in a turn that a session-scoped scheduled task firing in your session started, rather than a prompt you typed Asks before the first publish of each artifact Claude can’t read the file without your approval Asks before publishing it.
An allow rule for the Artifact tool doesn’t skip this prompt In Manual or acceptEdits mode, Claude makes a small change to an artifact’s file it can’t edit without your approval, such as a project file in Manual mode Asks before publishing the change. You’re asked even if an allow rule covers the Artifact tool, because the edit to the file needs your approval To let Claude read a file outside your working directories without your approval, add its folder as a working directory with --add-dir at launch or /add-dir during the session.
Claude already reads files in those directories, and in the temporary directory it writes pages to, without asking. If a publish prompt includes a sentence such as Also makes 1 edit to that file on disk. , Claude is changing the artifact’s file and publishing it in one step. When you approve the prompt, Claude Code publishes the page, then writes the change to your file. Update an artifact Ask Claude to revise the page, or let a long-running task republish as it makes progress.
Claude edits the underlying file and publishes again to the same URL. Add a per-region breakdown below the summary chart and republish. Anyone with the page open sees the update in place. Each publish becomes a version, and from the Share control in the page header you can choose which version viewers see. To update an artifact from a different session, give Claude its URL, or attach it with /artifacts . Without either, a new session creates a new artifact instead of updating one.
Update https://claude.ai/code/artifact/5fbea6f3-... with today's numbers. Turn off one-step artifact updates A one-step update is a small change Claude makes to an artifact’s file as part of a publish, instead of through an Edit or Write call. To turn one-step updates off, set CLAUDE_CODE_ARTIFACT_PUBLISH_EDITS to 0 . This example adds the variable to the env block in ~/.claude/settings.json : { "env" : { "CLAUDE_CODE_ARTIFACT_PUBLISH_EDITS" : "0" } } Then quit and relaunch Claude Code, because a running session doesn’t reread the variable.
Find an artifact again Run /artifacts in Claude Code to list the artifacts you own and the ones shared with you. The current session’s artifacts come first, under This session . Select an artifact, then press one of these keys: Enter : opens it in your browser when it’s already attached to the current session, and attaches it when it isn’t o : opens it in your browser c : copies its link d : outside a cloud session , permanently deletes an artifact you own after you confirm.
Its link stops working for everyone, including you Claude Code reads the list from your claude.ai account, so /artifacts works in a new session and after /clear , when an artifact’s link has scrolled out of the terminal. Share an artifact A new artifact is visible only to you. To share it, open the artifact in your browser and use the Share control in the page header. The header also links to your gallery at claude.ai/code/artifacts , which lists every artifact you have created.
Viewers in your organization can see who published the page: on an artifact shared within your organizatio
The rest of this page is on the live site.