Artifacts & Deep Links — Sharing Session Output
Artifacts — Publish Live Pages From a Session
Section titled “Artifacts — Publish Live Pages From a Session”An artifact is an interactive web page Claude Code publishes from your session to a private URL on claude.ai. It updates in place as the session continues. Use it when output is easier to look at than read as terminal text.
Pro/Max/Team/Enterprise,
/loginauth (not API key), Anthropic API only. Pro/Max artifacts stay private to you; Team/Enterprise can share within the org.
Create / update
Section titled “Create / update”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 andkeep it updated as you investigate.Claude writes an HTML/MD file, asks permission to publish, prints the URL. Ctrl+] reopens the latest artifact. Ask for revisions and it republishes to the same URL — viewers see it update live. To update from a different session, give Claude the artifact URL.
What works well
Section titled “What works well”- PR walkthroughs with margin annotations, color-coded by severity
- Option comparisons: 4 layout variants side by side with tradeoffs
- Interactive tuning: sliders bound to an easing curve/duration, animation live
- Decision boards that flow back: a drag-to-triage board with a “Copy as prompt” button whose output you paste back into the session
- Live progress: a migration checklist Claude checks off as it works
Constraints
Section titled “Constraints”One self-contained page: no external requests (CSP), no backend, no multi-page routing, ≤16 MiB, .html/.htm/.md only. It’s a capture of work, not an app. Put your design tokens in CLAUDE.md and Claude will match your branding.
Disable: "disableArtifact": true or CLAUDE_CODE_DISABLE_ARTIFACT=1.
Deep Links — Launch Sessions From URLs
Section titled “Deep Links — Launch Sessions From URLs”A claude-cli:// URL opens a local Claude Code session with a working directory and a pre-filled (not sent) prompt. Put them in runbooks, alerts, dashboards, wikis.
claude-cli://open?repo=acme/payments&q=Investigate%20the%20failed%20deploy| Param | Meaning |
|---|---|
q | URL-encoded prompt to pre-fill (max 5,000 chars, %0A = newline) |
cwd | Absolute path for the working directory |
repo | GitHub owner/name — resolves to your most recently used local clone |
Safety: the link never executes anything — a “Prompt from an external link” warning shows until you review and press Enter. Registration is automatic on first interactive session; disable with disableDeepLinkRegistration.
Note: GitHub-rendered Markdown strips claude-cli:// links — put them in code blocks there. From the shell: open/xdg-open/Start-Process the URL. VS Code variant: vscode://anthropic.claude-code/open.
Real Case: Incident Runbook
Section titled “Real Case: Incident Runbook”## High 5xx rate on web-gateway1. Acknowledge the page in PagerDuty.2. [Open Claude Code in the gateway repo](claude-cli://open?repo=acme/web-gateway&q=5xx%20rate%20is%20elevated.%20Check%20recent%20deploys%20and%20error%20logs%20from%20the%20last%2030%20minutes.)3. Post initial findings in #incident — ask Claude for an artifact timeline and share the link in the channel.🧠 Quick Recall
Section titled “🧠 Quick Recall”- Trick: “Artifacts go OUT (publish results); deep links come IN (launch sessions).”
👨🏫 Teach It
Section titled “👨🏫 Teach It”- Show: publish a PR-walkthrough artifact and open it on the projector.
- They’ll trip on: expecting artifacts to fetch live data — the CSP blocks all external requests.
Learning path: ⬅ 50-agent-view-and-workflows.md · Index · ➡ 52-output-styles-voice-ui.md
Written by Fenil Patel