A chat answer is a dead end. You read it, copy what you need, and the rest scrolls away. An artifact is different: Claude writes the answer into a separate panel that you can run, edit, and keep. A mockup becomes a clickable prototype, a data question becomes a chart you can poke at, a spec becomes a document you can hand over.
That shift changes the shape of the conversation, the way you iterate, and, if you pay per token, the bill. What follows: what artifacts are good for, the loop that produces a usable result, and the mistakes that sink them.
What an artifact actually is
An artifact is a self-contained block of output rendered outside the chat bubble. Claude creates one when the response suits it, and you can ask for one explicitly. In practice you will see a few types:
- Single-file web apps — HTML, CSS, and JavaScript in one document you can preview and interact with.
- React components — a component you can render, then copy into a real project.
- Documents — specs, briefs, and reports that stay readable outside the transcript.
- Diagrams — SVG or Mermaid charts that render instead of sitting there as code.
- Code files — standalone scripts, classes, and config you intend to download.
When to use one
- A prototype you need to click. A pricing page, a calculator, a settings panel.
- A visual you cannot describe in prose. Flowcharts, architecture diagrams, state machines.
- A document longer than a screen. A spec or runbook that needs headings and structure.
- Something you keep iterating on. One file in one place means each revision builds on the last.
When not to
- One-line answers. Rendering a paragraph as an artifact adds ceremony, not value.
- Text headed for another tool. Write the email in chat and copy it out.
- Anything with unscrubbed customer data. Artifacts are easy to share; assume the content will be seen.
- Production code. A first draft has no tests, no error handling, and no review.
The iteration loop
- 1Write the spec first. One paragraph: what it does, who uses it, what data it holds, what it must not do.
- 2Ask for version one in a single pass. Do not refine mid-generation; get something runnable.
- 3Change one thing per turn. "Move the total to the header" is testable. "Make it cleaner" is not.
- 4Name the good version. A version you cannot return to is one you will lose.
- 5Break out when the thread gets long. Paste the current file into a fresh chat and continue from there.
Artifact: single-file budget splitter, current version below. Change: cap housing at 40% of take-home pay and show a warning above the cap. Keep: layout, colors, and every other field exactly as they are. Do not: rename elements or rewrite the whole file. Output: only the changed function and the changed markup.
What artifacts cost
On claude.ai, artifacts come with the plan, and the plan usage limits are the real ceiling. Every revision is a message, and a large artifact is a large message, so a heavy editing session spends limits faster than a question-and-answer session does.
Build the same deliverable through the API and the feature becomes tokens. The artifact source is input on every turn, and every revision sends it again. A few hundred lines of component is a few thousand tokens; fifty revisions of it is six figures of input before anything ships.
- Patch, do not regenerate. Ask for the changed section, not a new file.
- Restart when the file grows. A fresh chat with the current source beats a thread carrying every abandoned draft.
- Keep stable instructions first. An artifact that changes above a cached prefix stops paying.
- Keep sample data small. A fixture with 300 rows is re-read on every single turn.
Common mistakes
- Vague first prompt. "Build me a dashboard" returns the average of every dashboard the model has seen.
- Five changes in one turn. When the layout breaks, you cannot tell which change did it.
- Letting the file drift. Silent rewrites of untouched sections make diffs useless.
- Never leaving the thread. The conversation becomes an archaeology dig.
- Mistaking the demo for the product. Placeholder data, no empty states, no error path.
Before you call it done
- 1Copy the code out and run it locally.
- 2Replace sample data and add empty and error states.
- 3Check labels and keyboard focus; a prototype should still be usable.
- 4Pin the final version and write one line on how to run it.
Frequently asked questions
Do artifacts cost extra?
On claude.ai they are part of the plan; what they consume is usage. Through the API, every revision bills the artifact source as input tokens. Long files and many revisions drive the cost, not the artifact itself.
Can I edit the code directly?
Yes. You can edit inside the artifact panel and keep working from your version. For a one-line change that is usually faster than describing it in prose and waiting for a rewrite.
Why did Claude stop updating my artifact?
Usually context. The thread grew, earlier drafts crowded out the instruction, and the model lost the current state. Paste the file into a fresh chat with a short spec and continue there.
Are artifacts shareable?
Many can be shared or published from the interface. Strip API keys, customer names, and internal URLs before you ask for one, and treat the panel as public until you know otherwise.
Do artifacts work for backend code?
Partly. A single-file script can be generated and reviewed, but anything needing a database, secrets, or a deploy target belongs in your editor. Treat artifact code as a starting draft with a reviewer still required.
All content is original. The workflow, prompts, and checklists were written for this site; the topic was informed by artifact material in Claude product documentation and course outlines. No course text or documentation is reproduced. Cost figures are computed at build time from the TokenCalc AI catalog.