Artifacts & Code
Claude doesn't just write code — it generates real files you can download and run.
What are Artifacts?
Artifacts are Claude's way of generating real files rather than just code blocks in chat. When you ask Claude to write a script, build a webpage, or create a document, it can render an Artifact — a file that appears in a preview panel on the right side of the screen, and that you can copy, download, or iterate on.
Types of Artifacts
| Artifact type | Extension | What it does |
|---|---|---|
| Python script | .py | Runnable Python code |
| HTML page | .html | Rendered live preview in the panel |
| React component | .jsx | Interactive UI, rendered live |
| Markdown document | .md | Formatted document preview |
| SQL file | .sql | Query or schema file |
| Mermaid diagram | .mermaid | Flowcharts, ER diagrams rendered live |
| CSV / JSON | .csv / .json | Structured data files |
Triggering Artifacts
Claude automatically creates an Artifact when you ask for something that's clearly a standalone file. You can also explicitly request one:
- "Write a Python script to clean this CSV and save to a new file" → Python Artifact
- "Create an HTML dashboard showing these metrics" → HTML Artifact (with live preview)
- "Build an interactive bar chart React component" → React Artifact (interactive)
- "Draw an ER diagram for this schema" → Mermaid Artifact
- "Write the CREATE TABLE DDL for a customer database" → SQL Artifact
Iterating on Artifacts
Once an Artifact exists, you can modify it by asking Claude to make changes:
- "Add error handling to the file reading function"
- "Change the bar chart to a line chart and add a date filter"
- "Add a phone number column to the customer table"
Claude updates the Artifact in-place. You can see the full version history by clicking the version indicator in the Artifact panel.
React Artifacts for data engineers
React Artifacts are particularly powerful — Claude can build interactive dashboards, data grids, and calculators that run live in the browser:
Claude will produce a complete React component using Tailwind, recharts, and shadcn/ui components — rendered and interactive immediately in the Artifact panel.
Downloading and using Artifacts
Every Artifact has a Copy and Download button in the top right of the panel. Download gives you the actual file — .py, .html, .sql, .md, etc. You can then open it directly in VS Code, run it in terminal, or deploy it.
2. Claude generates a React or HTML Artifact
3. Iterate: "add X feature", "fix Y bug", "make Z cleaner"
4. Download the final file
5. Deploy to GitHub Pages, Vercel, or embed in your site
This entire website was built using this exact workflow with Claude.